зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1326463 - Fix OpenBSD build broken by webrtc.org 49 update. r=gaston, r=jesup
--HG-- extra : histedit_source : e18f813ace63db9f9ea6b35437e9b87bb84f4e26%2C9da31e71e8591e1ba49000c0261b55404802b32d
This commit is contained in:
Родитель
c6aea6cc68
Коммит
2663bd16e0
|
@ -153,8 +153,6 @@
|
|||
'sources': [
|
||||
'sndio/audio_device_sndio.cc',
|
||||
'sndio/audio_device_sndio.h',
|
||||
'sndio/audio_device_utility_sndio.cc',
|
||||
'sndio/audio_device_utility_sndio.h',
|
||||
],
|
||||
}],
|
||||
['include_alsa_audio==1', {
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include "webrtc/modules/audio_device/android/audio_track_jni.h"
|
||||
#include "webrtc/modules/audio_device/android/opensles_player.h"
|
||||
#elif defined(WEBRTC_AUDIO_SNDIO)
|
||||
#include "audio_device_utility_sndio.h"
|
||||
#include "audio_device_sndio.h"
|
||||
#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
|
||||
#if defined(LINUX_ALSA)
|
||||
|
@ -297,8 +296,6 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects()
|
|||
{
|
||||
WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "attempting to use the Sndio audio API...");
|
||||
_platformAudioLayer = kSndioAudio;
|
||||
// Create the sndio implementation of the Device Utility.
|
||||
ptrAudioDeviceUtility = new AudioDeviceUtilitySndio(Id());
|
||||
}
|
||||
#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
|
||||
// Create the *Linux* implementation of the Audio Device
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "webrtc/modules/audio_device/audio_device_config.h"
|
||||
#include "webrtc/modules/audio_device/audio_device_utility.h"
|
||||
#include "webrtc/modules/audio_device/sndio/audio_device_sndio.h"
|
||||
|
||||
#include "webrtc/system_wrappers/include/event_wrapper.h"
|
||||
|
@ -699,9 +698,9 @@ int32_t AudioDeviceSndio::StartRecording()
|
|||
return 0;
|
||||
}
|
||||
|
||||
_ptrThreadRec = new rtc::PlatformThread(RecThreadFunc,
|
||||
this,
|
||||
threadName);
|
||||
_ptrThreadRec.reset(new rtc::PlatformThread(
|
||||
RecThreadFunc, this, "webrtc_audio_module_capture_thread"));
|
||||
|
||||
if (_ptrThreadRec == NULL)
|
||||
{
|
||||
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
|
||||
|
@ -724,17 +723,7 @@ int32_t AudioDeviceSndio::StartRecording()
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (!_ptrThreadRec->Start())
|
||||
{
|
||||
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
|
||||
" failed to start the rec audio thread");
|
||||
_recording = false;
|
||||
sio_stop(_recHandle);
|
||||
_ptrThreadRec.reset();
|
||||
delete [] _recordingBuffer;
|
||||
_recordingBuffer = NULL;
|
||||
return -1;
|
||||
}
|
||||
_ptrThreadRec->Start();
|
||||
_recording = true;
|
||||
return 0;
|
||||
}
|
||||
|
@ -796,9 +785,9 @@ int32_t AudioDeviceSndio::StartPlayout()
|
|||
return 0;
|
||||
}
|
||||
|
||||
_ptrThreadPlay = new rtc::PlatformThread(PlayThreadFunc,
|
||||
this,
|
||||
threadName);
|
||||
_ptrThreadPlay.reset(new rtc::PlatformThread(
|
||||
PlayThreadFunc, this, "webrtc_audio_module_play_thread"));
|
||||
|
||||
if (_ptrThreadPlay == NULL)
|
||||
{
|
||||
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
|
||||
|
@ -818,17 +807,7 @@ int32_t AudioDeviceSndio::StartPlayout()
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (!_ptrThreadPlay->Start())
|
||||
{
|
||||
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
|
||||
" failed to start the play audio thread");
|
||||
sio_stop(_playHandle);
|
||||
_ptrThreadPlay.reset();
|
||||
_ptrThreadPlay = NULL;
|
||||
delete [] _playoutBuffer;
|
||||
_playoutBuffer = NULL;
|
||||
return -1;
|
||||
}
|
||||
_ptrThreadPlay->Start();
|
||||
_playing = true;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "webrtc/modules/audio_device/sndio/audio_device_utility_sndio.h"
|
||||
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
|
||||
#include "webrtc/system_wrappers/include/trace.h"
|
||||
|
||||
namespace webrtc
|
||||
{
|
||||
|
||||
AudioDeviceUtilitySndio::AudioDeviceUtilitySndio(const int32_t id) :
|
||||
_critSect(*CriticalSectionWrapper::CreateCriticalSection()), _id(id)
|
||||
{
|
||||
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, id,
|
||||
"%s created", __FUNCTION__);
|
||||
}
|
||||
|
||||
AudioDeviceUtilitySndio::~AudioDeviceUtilitySndio()
|
||||
{
|
||||
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id,
|
||||
"%s destroyed", __FUNCTION__);
|
||||
{
|
||||
CriticalSectionScoped lock(&_critSect);
|
||||
|
||||
// XXX free stuff here...
|
||||
}
|
||||
|
||||
delete &_critSect;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// API
|
||||
// ============================================================================
|
||||
|
||||
|
||||
int32_t AudioDeviceUtilitySndio::Init()
|
||||
{
|
||||
|
||||
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id,
|
||||
" OS info: %s", "POSIX using sndio");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
} // namespace webrtc
|
|
@ -1,36 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_UTILITY_SNDIO_H
|
||||
#define WEBRTC_AUDIO_DEVICE_AUDIO_DEVICE_UTILITY_SNDIO_H
|
||||
|
||||
#include "webrtc/modules/audio_device/audio_device_utility.h"
|
||||
#include "webrtc/modules/audio_device/include/audio_device.h"
|
||||
|
||||
namespace webrtc
|
||||
{
|
||||
class CriticalSectionWrapper;
|
||||
|
||||
class AudioDeviceUtilitySndio: public AudioDeviceUtility
|
||||
{
|
||||
public:
|
||||
AudioDeviceUtilitySndio(const int32_t id);
|
||||
virtual ~AudioDeviceUtilitySndio();
|
||||
|
||||
virtual int32_t Init() override;
|
||||
|
||||
private:
|
||||
CriticalSectionWrapper& _critSect;
|
||||
int32_t _id;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif
|
Загрузка…
Ссылка в новой задаче