Correct WebRtc_Word8 in adm
Correct WebRtc_Word8 usage in adm BUG=http://code.google.com/p/webrtc/issues/detail?id=311&sort=-id TEST=buidl on all platforms Review URL: https://webrtc-codereview.appspot.com/428001 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1814 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
af1f792cc3
commit
28f3913ca9
@ -138,8 +138,9 @@ WebRtc_Word32 AudioDeviceAndroidOpenSLES::Init() {
|
|||||||
_recWarning = 0;
|
_recWarning = 0;
|
||||||
_recError = 0;
|
_recError = 0;
|
||||||
|
|
||||||
SLEngineOption EngineOption[] = { (SLuint32) SL_ENGINEOPTION_THREADSAFE,
|
SLEngineOption EngineOption[] = {
|
||||||
(SLuint32) SL_BOOLEAN_TRUE };
|
{ (SLuint32) SL_ENGINEOPTION_THREADSAFE, (SLuint32) SL_BOOLEAN_TRUE },
|
||||||
|
};
|
||||||
WebRtc_Word32 res = slCreateEngine(&_slEngineObject, 1, EngineOption, 0,
|
WebRtc_Word32 res = slCreateEngine(&_slEngineObject, 1, EngineOption, 0,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
//WebRtc_Word32 res = slCreateEngine( &_slEngineObject, 0, NULL, 0, NULL,
|
//WebRtc_Word32 res = slCreateEngine( &_slEngineObject, 0, NULL, 0, NULL,
|
||||||
@ -964,7 +965,7 @@ WebRtc_Word32 AudioDeviceAndroidOpenSLES::InitPlayout() {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 res(-1);
|
WebRtc_Word32 res = -1;
|
||||||
SLDataFormat_PCM pcm;
|
SLDataFormat_PCM pcm;
|
||||||
SLDataSource audioSource;
|
SLDataSource audioSource;
|
||||||
SLDataLocator_AndroidSimpleBufferQueue simpleBufferQueue;
|
SLDataLocator_AndroidSimpleBufferQueue simpleBufferQueue;
|
||||||
@ -1120,17 +1121,13 @@ WebRtc_Word32 AudioDeviceAndroidOpenSLES::InitRecording() {
|
|||||||
" Recording object is NULL");
|
" Recording object is NULL");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
WebRtc_Word32 res(-1);
|
|
||||||
WebRtc_Word32 numInputs(0);
|
// TODO(leozwang) clean up following commented out code
|
||||||
WebRtc_UWord32 inputDeviceIDs[N_MAX_INPUT_DEVICES];
|
// WebRtc_Word32 numInputs(0);
|
||||||
SLAudioInputDescriptor audioInputDescriptor;
|
// WebRtc_UWord32 inputDeviceIDs[N_MAX_INPUT_DEVICES];
|
||||||
SLDataSource audioSource;
|
// SLAudioInputDescriptor audioInputDescriptor;
|
||||||
SLDataLocator_IODevice micLocator;
|
// bool micAvailable(false);
|
||||||
SLDataSink audioSink;
|
// WebRtc_UWord32 micDeviceID(0);
|
||||||
SLDataFormat_PCM pcm;
|
|
||||||
SLDataLocator_AndroidSimpleBufferQueue simpleBufferQueue;
|
|
||||||
bool micAvailable(false);
|
|
||||||
WebRtc_UWord32 micDeviceID(0);
|
|
||||||
|
|
||||||
/* // Get the Audio IO DEVICE CAPABILITIES interface, which is also implicit
|
/* // Get the Audio IO DEVICE CAPABILITIES interface, which is also implicit
|
||||||
res = (*_slEngineObject)->GetInterface(_slEngineObject,
|
res = (*_slEngineObject)->GetInterface(_slEngineObject,
|
||||||
@ -1202,6 +1199,14 @@ WebRtc_Word32 AudioDeviceAndroidOpenSLES::InitRecording() {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
WebRtc_Word32 res(-1);
|
||||||
|
SLDataSource audioSource;
|
||||||
|
SLDataLocator_IODevice micLocator;
|
||||||
|
SLDataSink audioSink;
|
||||||
|
SLDataFormat_PCM pcm;
|
||||||
|
SLDataLocator_AndroidSimpleBufferQueue simpleBufferQueue;
|
||||||
|
|
||||||
// Setup the data source structure
|
// Setup the data source structure
|
||||||
micLocator.locatorType = SL_DATALOCATOR_IODEVICE;
|
micLocator.locatorType = SL_DATALOCATOR_IODEVICE;
|
||||||
micLocator.deviceType = SL_IODEVICE_AUDIOINPUT;
|
micLocator.deviceType = SL_IODEVICE_AUDIOINPUT;
|
||||||
@ -1932,15 +1937,16 @@ void AudioDeviceAndroidOpenSLES::UpdateRecordingDelay() {
|
|||||||
|
|
||||||
WebRtc_Word32 AudioDeviceAndroidOpenSLES::InitSampleRate() {
|
WebRtc_Word32 AudioDeviceAndroidOpenSLES::InitSampleRate() {
|
||||||
|
|
||||||
WebRtc_Word32 res(-1);
|
// TODO(leozwang) clean up following commented out code
|
||||||
WebRtc_Word32 numOutputs(0);
|
// WebRtc_Word32 res(-1);
|
||||||
WebRtc_UWord32 headsetDeviceID(0);
|
// WebRtc_Word32 numOutputs(0);
|
||||||
WebRtc_UWord32 earpieceDeviceID(0);
|
// WebRtc_UWord32 headsetDeviceID(0);
|
||||||
bool headsetAvailable(false);
|
// WebRtc_UWord32 earpieceDeviceID(0);
|
||||||
bool earpieceAvailable(false);
|
// bool headsetAvailable(false);
|
||||||
bool foundSampleRate(false);
|
// bool earpieceAvailable(false);
|
||||||
WebRtc_UWord32 outputDeviceIDs[N_MAX_OUTPUT_DEVICES];
|
// bool foundSampleRate(false);
|
||||||
SLAudioOutputDescriptor audioOutputDescriptor;
|
// WebRtc_UWord32 outputDeviceIDs[N_MAX_OUTPUT_DEVICES];
|
||||||
|
// SLAudioOutputDescriptor audioOutputDescriptor;
|
||||||
|
|
||||||
if (_slEngineObject == NULL) {
|
if (_slEngineObject == NULL) {
|
||||||
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, " SL Object is NULL");
|
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id, " SL Object is NULL");
|
||||||
|
@ -247,6 +247,7 @@ private:
|
|||||||
SLDeviceVolumeItf _slMicVolume;
|
SLDeviceVolumeItf _slMicVolume;
|
||||||
|
|
||||||
WebRtc_UWord32 _micDeviceId;
|
WebRtc_UWord32 _micDeviceId;
|
||||||
|
WebRtc_UWord32 _recQueueSeq;
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
EventWrapper& _timeEventRec;
|
EventWrapper& _timeEventRec;
|
||||||
@ -263,7 +264,6 @@ private:
|
|||||||
// Recording buffer
|
// Recording buffer
|
||||||
WebRtc_Word8 _recQueueBuffer[N_REC_QUEUE_BUFFERS][2
|
WebRtc_Word8 _recQueueBuffer[N_REC_QUEUE_BUFFERS][2
|
||||||
* REC_BUF_SIZE_IN_SAMPLES];
|
* REC_BUF_SIZE_IN_SAMPLES];
|
||||||
WebRtc_UWord32 _recQueueSeq;
|
|
||||||
WebRtc_Word8 _recBuffer[N_REC_BUFFERS][2*REC_BUF_SIZE_IN_SAMPLES];
|
WebRtc_Word8 _recBuffer[N_REC_BUFFERS][2*REC_BUF_SIZE_IN_SAMPLES];
|
||||||
WebRtc_UWord32 _recLength[N_REC_BUFFERS];
|
WebRtc_UWord32 _recLength[N_REC_BUFFERS];
|
||||||
WebRtc_UWord32 _recSeqNumber[N_REC_BUFFERS];
|
WebRtc_UWord32 _recSeqNumber[N_REC_BUFFERS];
|
||||||
|
@ -322,7 +322,8 @@ WebRtc_Word32 AudioDeviceBuffer::SetVQEData(WebRtc_UWord32 playDelayMS, WebRtc_U
|
|||||||
// StartInputFileRecording
|
// StartInputFileRecording
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WebRtc_Word32 AudioDeviceBuffer::StartInputFileRecording(const WebRtc_Word8 fileName[kAdmMaxFileNameSize])
|
WebRtc_Word32 AudioDeviceBuffer::StartInputFileRecording(
|
||||||
|
const char fileName[kAdmMaxFileNameSize])
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, "%s", __FUNCTION__);
|
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, "%s", __FUNCTION__);
|
||||||
|
|
||||||
@ -354,7 +355,8 @@ WebRtc_Word32 AudioDeviceBuffer::StopInputFileRecording()
|
|||||||
// StartOutputFileRecording
|
// StartOutputFileRecording
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WebRtc_Word32 AudioDeviceBuffer::StartOutputFileRecording(const WebRtc_Word8 fileName[kAdmMaxFileNameSize])
|
WebRtc_Word32 AudioDeviceBuffer::StartOutputFileRecording(
|
||||||
|
const char fileName[kAdmMaxFileNameSize])
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, "%s", __FUNCTION__);
|
WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, "%s", __FUNCTION__);
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Use of this source code is governed by a BSD-style license
|
* 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
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@ -44,21 +44,28 @@ public:
|
|||||||
WebRtc_Word32 SetPlayoutChannels(WebRtc_UWord8 channels);
|
WebRtc_Word32 SetPlayoutChannels(WebRtc_UWord8 channels);
|
||||||
WebRtc_UWord8 RecordingChannels() const;
|
WebRtc_UWord8 RecordingChannels() const;
|
||||||
WebRtc_UWord8 PlayoutChannels() const;
|
WebRtc_UWord8 PlayoutChannels() const;
|
||||||
WebRtc_Word32 SetRecordingChannel(const AudioDeviceModule::ChannelType channel);
|
WebRtc_Word32 SetRecordingChannel(
|
||||||
WebRtc_Word32 RecordingChannel(AudioDeviceModule::ChannelType& channel) const;
|
const AudioDeviceModule::ChannelType channel);
|
||||||
|
WebRtc_Word32 RecordingChannel(
|
||||||
|
AudioDeviceModule::ChannelType& channel) const;
|
||||||
|
|
||||||
WebRtc_Word32 SetRecordedBuffer(const WebRtc_Word8* audioBuffer, WebRtc_UWord32 nSamples);
|
WebRtc_Word32 SetRecordedBuffer(const WebRtc_Word8* audioBuffer,
|
||||||
|
WebRtc_UWord32 nSamples);
|
||||||
WebRtc_Word32 SetCurrentMicLevel(WebRtc_UWord32 level);
|
WebRtc_Word32 SetCurrentMicLevel(WebRtc_UWord32 level);
|
||||||
WebRtc_Word32 SetVQEData(WebRtc_UWord32 playDelayMS, WebRtc_UWord32 recDelayMS, WebRtc_Word32 clockDrift);
|
WebRtc_Word32 SetVQEData(WebRtc_UWord32 playDelayMS,
|
||||||
|
WebRtc_UWord32 recDelayMS,
|
||||||
|
WebRtc_Word32 clockDrift);
|
||||||
WebRtc_Word32 DeliverRecordedData();
|
WebRtc_Word32 DeliverRecordedData();
|
||||||
WebRtc_UWord32 NewMicLevel() const;
|
WebRtc_UWord32 NewMicLevel() const;
|
||||||
|
|
||||||
WebRtc_Word32 RequestPlayoutData(WebRtc_UWord32 nSamples);
|
WebRtc_Word32 RequestPlayoutData(WebRtc_UWord32 nSamples);
|
||||||
WebRtc_Word32 GetPlayoutData(WebRtc_Word8* audioBuffer);
|
WebRtc_Word32 GetPlayoutData(WebRtc_Word8* audioBuffer);
|
||||||
|
|
||||||
WebRtc_Word32 StartInputFileRecording(const WebRtc_Word8 fileName[kAdmMaxFileNameSize]);
|
WebRtc_Word32 StartInputFileRecording(
|
||||||
|
const char fileName[kAdmMaxFileNameSize]);
|
||||||
WebRtc_Word32 StopInputFileRecording();
|
WebRtc_Word32 StopInputFileRecording();
|
||||||
WebRtc_Word32 StartOutputFileRecording(const WebRtc_Word8 fileName[kAdmMaxFileNameSize]);
|
WebRtc_Word32 StartOutputFileRecording(
|
||||||
|
const char fileName[kAdmMaxFileNameSize]);
|
||||||
WebRtc_Word32 StopOutputFileRecording();
|
WebRtc_Word32 StopOutputFileRecording();
|
||||||
|
|
||||||
AudioDeviceBuffer();
|
AudioDeviceBuffer();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Use of this source code is governed by a BSD-style license
|
* 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
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@ -34,12 +34,12 @@ class AudioDeviceGeneric
|
|||||||
virtual WebRtc_Word16 RecordingDevices() = 0;
|
virtual WebRtc_Word16 RecordingDevices() = 0;
|
||||||
virtual WebRtc_Word32 PlayoutDeviceName(
|
virtual WebRtc_Word32 PlayoutDeviceName(
|
||||||
WebRtc_UWord16 index,
|
WebRtc_UWord16 index,
|
||||||
WebRtc_Word8 name[kAdmMaxDeviceNameSize],
|
char name[kAdmMaxDeviceNameSize],
|
||||||
WebRtc_Word8 guid[kAdmMaxGuidSize]) = 0;
|
char guid[kAdmMaxGuidSize]) = 0;
|
||||||
virtual WebRtc_Word32 RecordingDeviceName(
|
virtual WebRtc_Word32 RecordingDeviceName(
|
||||||
WebRtc_UWord16 index,
|
WebRtc_UWord16 index,
|
||||||
WebRtc_Word8 name[kAdmMaxDeviceNameSize],
|
char name[kAdmMaxDeviceNameSize],
|
||||||
WebRtc_Word8 guid[kAdmMaxGuidSize]) = 0;
|
char guid[kAdmMaxGuidSize]) = 0;
|
||||||
|
|
||||||
// Device selection
|
// Device selection
|
||||||
virtual WebRtc_Word32 SetPlayoutDevice(WebRtc_UWord16 index) = 0;
|
virtual WebRtc_Word32 SetPlayoutDevice(WebRtc_UWord16 index) = 0;
|
||||||
|
@ -1468,7 +1468,10 @@ WebRtc_Word32 AudioDeviceModuleImpl::SetPlayoutDevice(WindowsDeviceType device)
|
|||||||
// PlayoutDeviceName
|
// PlayoutDeviceName
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WebRtc_Word32 AudioDeviceModuleImpl::PlayoutDeviceName(WebRtc_UWord16 index, WebRtc_Word8 name[kAdmMaxDeviceNameSize], WebRtc_Word8 guid[kAdmMaxGuidSize])
|
WebRtc_Word32 AudioDeviceModuleImpl::PlayoutDeviceName(
|
||||||
|
WebRtc_UWord16 index,
|
||||||
|
char name[kAdmMaxDeviceNameSize],
|
||||||
|
char guid[kAdmMaxGuidSize])
|
||||||
{
|
{
|
||||||
CHECK_INITIALIZED();
|
CHECK_INITIALIZED();
|
||||||
|
|
||||||
@ -1499,7 +1502,10 @@ WebRtc_Word32 AudioDeviceModuleImpl::PlayoutDeviceName(WebRtc_UWord16 index, Web
|
|||||||
// RecordingDeviceName
|
// RecordingDeviceName
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WebRtc_Word32 AudioDeviceModuleImpl::RecordingDeviceName(WebRtc_UWord16 index, WebRtc_Word8 name[kAdmMaxDeviceNameSize], WebRtc_Word8 guid[kAdmMaxGuidSize])
|
WebRtc_Word32 AudioDeviceModuleImpl::RecordingDeviceName(
|
||||||
|
WebRtc_UWord16 index,
|
||||||
|
char name[kAdmMaxDeviceNameSize],
|
||||||
|
char guid[kAdmMaxGuidSize])
|
||||||
{
|
{
|
||||||
CHECK_INITIALIZED();
|
CHECK_INITIALIZED();
|
||||||
|
|
||||||
@ -1536,7 +1542,8 @@ WebRtc_Word16 AudioDeviceModuleImpl::RecordingDevices()
|
|||||||
|
|
||||||
WebRtc_UWord16 nRecordingDevices = _ptrAudioDevice->RecordingDevices();
|
WebRtc_UWord16 nRecordingDevices = _ptrAudioDevice->RecordingDevices();
|
||||||
|
|
||||||
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: #recording devices=%d", nRecordingDevices);
|
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id,
|
||||||
|
"output: #recording devices=%d", nRecordingDevices);
|
||||||
return ((WebRtc_Word16)nRecordingDevices);
|
return ((WebRtc_Word16)nRecordingDevices);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1698,7 +1705,8 @@ WebRtc_Word32 AudioDeviceModuleImpl::RegisterAudioCallback(AudioTransport* audio
|
|||||||
// StartRawInputFileRecording
|
// StartRawInputFileRecording
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WebRtc_Word32 AudioDeviceModuleImpl::StartRawInputFileRecording(const WebRtc_Word8 pcmFileNameUTF8[kAdmMaxFileNameSize])
|
WebRtc_Word32 AudioDeviceModuleImpl::StartRawInputFileRecording(
|
||||||
|
const char pcmFileNameUTF8[kAdmMaxFileNameSize])
|
||||||
{
|
{
|
||||||
CHECK_INITIALIZED();
|
CHECK_INITIALIZED();
|
||||||
|
|
||||||
@ -1725,7 +1733,8 @@ WebRtc_Word32 AudioDeviceModuleImpl::StopRawInputFileRecording()
|
|||||||
// StartRawOutputFileRecording
|
// StartRawOutputFileRecording
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WebRtc_Word32 AudioDeviceModuleImpl::StartRawOutputFileRecording(const WebRtc_Word8 pcmFileNameUTF8[kAdmMaxFileNameSize])
|
WebRtc_Word32 AudioDeviceModuleImpl::StartRawOutputFileRecording(
|
||||||
|
const char pcmFileNameUTF8[kAdmMaxFileNameSize])
|
||||||
{
|
{
|
||||||
CHECK_INITIALIZED();
|
CHECK_INITIALIZED();
|
||||||
|
|
||||||
@ -2037,22 +2046,28 @@ AudioDeviceModule::AudioLayer AudioDeviceModuleImpl::PlatformAudioLayer() const
|
|||||||
switch (_platformAudioLayer)
|
switch (_platformAudioLayer)
|
||||||
{
|
{
|
||||||
case kPlatformDefaultAudio:
|
case kPlatformDefaultAudio:
|
||||||
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: kPlatformDefaultAudio");
|
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id,
|
||||||
|
"output: kPlatformDefaultAudio");
|
||||||
break;
|
break;
|
||||||
case kWindowsWaveAudio:
|
case kWindowsWaveAudio:
|
||||||
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: kWindowsWaveAudio");
|
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id,
|
||||||
|
"output: kWindowsWaveAudio");
|
||||||
break;
|
break;
|
||||||
case kWindowsCoreAudio:
|
case kWindowsCoreAudio:
|
||||||
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: kWindowsCoreAudio");
|
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id,
|
||||||
|
"output: kWindowsCoreAudio");
|
||||||
break;
|
break;
|
||||||
case kLinuxAlsaAudio:
|
case kLinuxAlsaAudio:
|
||||||
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: kLinuxAlsaAudio");
|
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id,
|
||||||
|
"output: kLinuxAlsaAudio");
|
||||||
break;
|
break;
|
||||||
case kDummyAudio:
|
case kDummyAudio:
|
||||||
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id, "output: kDummyAudio");
|
WEBRTC_TRACE(kTraceStateInfo, kTraceAudioDevice, _id,
|
||||||
|
"output: kDummyAudio");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, "output: INVALID");
|
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
|
||||||
|
"output: INVALID");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Use of this source code is governed by a BSD-style license
|
* 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
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@ -74,12 +74,12 @@ public:
|
|||||||
virtual WebRtc_Word16 RecordingDevices();
|
virtual WebRtc_Word16 RecordingDevices();
|
||||||
virtual WebRtc_Word32 PlayoutDeviceName(
|
virtual WebRtc_Word32 PlayoutDeviceName(
|
||||||
WebRtc_UWord16 index,
|
WebRtc_UWord16 index,
|
||||||
WebRtc_Word8 name[kAdmMaxDeviceNameSize],
|
char name[kAdmMaxDeviceNameSize],
|
||||||
WebRtc_Word8 guid[kAdmMaxGuidSize]);
|
char guid[kAdmMaxGuidSize]);
|
||||||
virtual WebRtc_Word32 RecordingDeviceName(
|
virtual WebRtc_Word32 RecordingDeviceName(
|
||||||
WebRtc_UWord16 index,
|
WebRtc_UWord16 index,
|
||||||
WebRtc_Word8 name[kAdmMaxDeviceNameSize],
|
char name[kAdmMaxDeviceNameSize],
|
||||||
WebRtc_Word8 guid[kAdmMaxGuidSize]);
|
char guid[kAdmMaxGuidSize]);
|
||||||
|
|
||||||
// Device selection
|
// Device selection
|
||||||
virtual WebRtc_Word32 SetPlayoutDevice(WebRtc_UWord16 index);
|
virtual WebRtc_Word32 SetPlayoutDevice(WebRtc_UWord16 index);
|
||||||
@ -179,10 +179,10 @@ public:
|
|||||||
|
|
||||||
// Recording of raw PCM data
|
// Recording of raw PCM data
|
||||||
virtual WebRtc_Word32 StartRawOutputFileRecording(
|
virtual WebRtc_Word32 StartRawOutputFileRecording(
|
||||||
const WebRtc_Word8 pcmFileNameUTF8[kAdmMaxFileNameSize]);
|
const char pcmFileNameUTF8[kAdmMaxFileNameSize]);
|
||||||
virtual WebRtc_Word32 StopRawOutputFileRecording();
|
virtual WebRtc_Word32 StopRawOutputFileRecording();
|
||||||
virtual WebRtc_Word32 StartRawInputFileRecording(
|
virtual WebRtc_Word32 StartRawInputFileRecording(
|
||||||
const WebRtc_Word8 pcmFileNameUTF8[kAdmMaxFileNameSize]);
|
const char pcmFileNameUTF8[kAdmMaxFileNameSize]);
|
||||||
virtual WebRtc_Word32 StopRawInputFileRecording();
|
virtual WebRtc_Word32 StopRawInputFileRecording();
|
||||||
|
|
||||||
// Native sample rate controls (samples/sec)
|
// Native sample rate controls (samples/sec)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Use of this source code is governed by a BSD-style license
|
* 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
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@ -42,7 +42,9 @@ WebRtc_UWord32 AudioDeviceUtility::GetTimeInMS()
|
|||||||
return timeGetTime();
|
return timeGetTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AudioDeviceUtility::StringCompare(const WebRtc_Word8* str1 , const WebRtc_Word8* str2, const WebRtc_UWord32 length)
|
bool AudioDeviceUtility::StringCompare(
|
||||||
|
const char* str1 , const char* str2,
|
||||||
|
const WebRtc_UWord32 length)
|
||||||
{
|
{
|
||||||
return ((_strnicmp(str1, str2, length) == 0) ? true : false);
|
return ((_strnicmp(str1, str2, length) == 0) ? true : false);
|
||||||
}
|
}
|
||||||
@ -112,7 +114,8 @@ void AudioDeviceUtility::Sleep(WebRtc_UWord32 milliseconds)
|
|||||||
nanosleep(&t,NULL);
|
nanosleep(&t,NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AudioDeviceUtility::StringCompare(const WebRtc_Word8* str1 , const WebRtc_Word8* str2, const WebRtc_UWord32 length)
|
bool AudioDeviceUtility::StringCompare(
|
||||||
|
const char* str1 , const char* str2, const WebRtc_UWord32 length)
|
||||||
{
|
{
|
||||||
return (strncasecmp(str1, str2, length) == 0)?true: false;
|
return (strncasecmp(str1, str2, length) == 0)?true: false;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Use of this source code is governed by a BSD-style license
|
* 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
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@ -22,8 +22,8 @@ public:
|
|||||||
static WebRtc_UWord32 GetTimeInMS();
|
static WebRtc_UWord32 GetTimeInMS();
|
||||||
static void Sleep(WebRtc_UWord32 milliseconds);
|
static void Sleep(WebRtc_UWord32 milliseconds);
|
||||||
static void WaitForKey();
|
static void WaitForKey();
|
||||||
static bool StringCompare(const WebRtc_Word8* str1,
|
static bool StringCompare(const char* str1,
|
||||||
const WebRtc_Word8* str2,
|
const char* str2,
|
||||||
const WebRtc_UWord32 length);
|
const WebRtc_UWord32 length);
|
||||||
virtual WebRtc_Word32 Init() = 0;
|
virtual WebRtc_Word32 Init() = 0;
|
||||||
|
|
||||||
|
@ -135,7 +135,8 @@ void AudioDeviceDummy::AttachAudioBuffer(AudioDeviceBuffer* audioBuffer)
|
|||||||
// ActiveAudioLayer
|
// ActiveAudioLayer
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WebRtc_Word32 AudioDeviceDummy::ActiveAudioLayer(AudioDeviceModule::AudioLayer& audioLayer) const
|
WebRtc_Word32 AudioDeviceDummy::ActiveAudioLayer(
|
||||||
|
AudioDeviceModule::AudioLayer& audioLayer) const
|
||||||
{
|
{
|
||||||
audioLayer = AudioDeviceModule::kDummyAudio;
|
audioLayer = AudioDeviceModule::kDummyAudio;
|
||||||
return 0;
|
return 0;
|
||||||
@ -161,16 +162,19 @@ WebRtc_Word32 AudioDeviceDummy::Init()
|
|||||||
|
|
||||||
// RECORDING
|
// RECORDING
|
||||||
strncpy(threadName, "webrtc_audio_module_rec_thread", 63);
|
strncpy(threadName, "webrtc_audio_module_rec_thread", 63);
|
||||||
_ptrThreadRec = ThreadWrapper::CreateThread(RecThreadFunc, this, kRealtimePriority, threadName);
|
_ptrThreadRec = ThreadWrapper::CreateThread(
|
||||||
|
RecThreadFunc, this, kRealtimePriority, threadName);
|
||||||
if (_ptrThreadRec == NULL)
|
if (_ptrThreadRec == NULL)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id, " failed to create the rec audio thread");
|
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
|
||||||
|
" failed to create the rec audio thread");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_ptrThreadRec->Start(threadID))
|
if (!_ptrThreadRec->Start(threadID))
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id, " failed to start the rec audio thread");
|
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
|
||||||
|
" failed to start the rec audio thread");
|
||||||
delete _ptrThreadRec;
|
delete _ptrThreadRec;
|
||||||
_ptrThreadRec = NULL;
|
_ptrThreadRec = NULL;
|
||||||
return -1;
|
return -1;
|
||||||
@ -179,7 +183,8 @@ WebRtc_Word32 AudioDeviceDummy::Init()
|
|||||||
|
|
||||||
if (!_timeEventRec.StartTimer(periodic, REC_TIMER_PERIOD_MS))
|
if (!_timeEventRec.StartTimer(periodic, REC_TIMER_PERIOD_MS))
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id, " failed to start the rec timer event");
|
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
|
||||||
|
" failed to start the rec timer event");
|
||||||
if (_ptrThreadRec->Stop())
|
if (_ptrThreadRec->Stop())
|
||||||
{
|
{
|
||||||
delete _ptrThreadRec;
|
delete _ptrThreadRec;
|
||||||
@ -187,24 +192,28 @@ WebRtc_Word32 AudioDeviceDummy::Init()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, " unable to stop the activated rec thread");
|
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
|
||||||
|
" unable to stop the activated rec thread");
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// PLAYOUT
|
// PLAYOUT
|
||||||
strncpy(threadName, "webrtc_audio_module_play_thread", 63);
|
strncpy(threadName, "webrtc_audio_module_play_thread", 63);
|
||||||
_ptrThreadPlay = ThreadWrapper::CreateThread(PlayThreadFunc, this, kRealtimePriority, threadName);
|
_ptrThreadPlay = ThreadWrapper::CreateThread(
|
||||||
|
PlayThreadFunc, this, kRealtimePriority, threadName);
|
||||||
if (_ptrThreadPlay == NULL)
|
if (_ptrThreadPlay == NULL)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id, " failed to create the play audio thread");
|
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
|
||||||
|
" failed to create the play audio thread");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
threadID = 0;
|
threadID = 0;
|
||||||
if (!_ptrThreadPlay->Start(threadID))
|
if (!_ptrThreadPlay->Start(threadID))
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id, " failed to start the play audio thread");
|
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
|
||||||
|
" failed to start the play audio thread");
|
||||||
delete _ptrThreadPlay;
|
delete _ptrThreadPlay;
|
||||||
_ptrThreadPlay = NULL;
|
_ptrThreadPlay = NULL;
|
||||||
return -1;
|
return -1;
|
||||||
@ -213,7 +222,8 @@ WebRtc_Word32 AudioDeviceDummy::Init()
|
|||||||
|
|
||||||
if (!_timeEventPlay.StartTimer(periodic, PLAY_TIMER_PERIOD_MS))
|
if (!_timeEventPlay.StartTimer(periodic, PLAY_TIMER_PERIOD_MS))
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id, " failed to start the play timer event");
|
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
|
||||||
|
" failed to start the play timer event");
|
||||||
if (_ptrThreadPlay->Stop())
|
if (_ptrThreadPlay->Stop())
|
||||||
{
|
{
|
||||||
delete _ptrThreadPlay;
|
delete _ptrThreadPlay;
|
||||||
@ -221,7 +231,8 @@ WebRtc_Word32 AudioDeviceDummy::Init()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, " unable to stop the activated play thread");
|
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
|
||||||
|
" unable to stop the activated play thread");
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -261,7 +272,8 @@ WebRtc_Word32 AudioDeviceDummy::Terminate()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, " failed to close down the rec audio thread");
|
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
|
||||||
|
" failed to close down the rec audio thread");
|
||||||
}
|
}
|
||||||
|
|
||||||
_critSect.Enter();
|
_critSect.Enter();
|
||||||
@ -285,7 +297,8 @@ WebRtc_Word32 AudioDeviceDummy::Terminate()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, " failed to close down the play audio thread");
|
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
|
||||||
|
" failed to close down the play audio thread");
|
||||||
}
|
}
|
||||||
|
|
||||||
_critSect.Enter();
|
_critSect.Enter();
|
||||||
@ -696,7 +709,8 @@ WebRtc_Word32 AudioDeviceDummy::MicrophoneVolumeIsAvailable(bool& available)
|
|||||||
|
|
||||||
WebRtc_Word32 AudioDeviceDummy::SetMicrophoneVolume(WebRtc_UWord32 volume)
|
WebRtc_Word32 AudioDeviceDummy::SetMicrophoneVolume(WebRtc_UWord32 volume)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceStream, kTraceAudioDevice, _id, "AudioDeviceDummy::SetMicrophoneVolume(volume=%u)", volume);
|
WEBRTC_TRACE(kTraceStream, kTraceAudioDevice, _id,
|
||||||
|
"AudioDeviceDummy::SetMicrophoneVolume(volume=%u)", volume);
|
||||||
|
|
||||||
CriticalSectionScoped lock(_critSect);
|
CriticalSectionScoped lock(_critSect);
|
||||||
|
|
||||||
@ -720,7 +734,8 @@ WebRtc_Word32 AudioDeviceDummy::MicrophoneVolume(WebRtc_UWord32& volume) const
|
|||||||
// MaxMicrophoneVolume
|
// MaxMicrophoneVolume
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WebRtc_Word32 AudioDeviceDummy::MaxMicrophoneVolume(WebRtc_UWord32& maxVolume) const
|
WebRtc_Word32 AudioDeviceDummy::MaxMicrophoneVolume(
|
||||||
|
WebRtc_UWord32& maxVolume) const
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceStream, kTraceAudioDevice, _id, "%s", __FUNCTION__);
|
WEBRTC_TRACE(kTraceStream, kTraceAudioDevice, _id, "%s", __FUNCTION__);
|
||||||
|
|
||||||
@ -731,7 +746,8 @@ WebRtc_Word32 AudioDeviceDummy::MaxMicrophoneVolume(WebRtc_UWord32& maxVolume) c
|
|||||||
// MinMicrophoneVolume
|
// MinMicrophoneVolume
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WebRtc_Word32 AudioDeviceDummy::MinMicrophoneVolume(WebRtc_UWord32& minVolume) const
|
WebRtc_Word32 AudioDeviceDummy::MinMicrophoneVolume(
|
||||||
|
WebRtc_UWord32& minVolume) const
|
||||||
{
|
{
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -741,7 +757,8 @@ WebRtc_Word32 AudioDeviceDummy::MinMicrophoneVolume(WebRtc_UWord32& minVolume) c
|
|||||||
// MicrophoneVolumeStepSize
|
// MicrophoneVolumeStepSize
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WebRtc_Word32 AudioDeviceDummy::MicrophoneVolumeStepSize(WebRtc_UWord16& stepSize) const
|
WebRtc_Word32 AudioDeviceDummy::MicrophoneVolumeStepSize(
|
||||||
|
WebRtc_UWord16& stepSize) const
|
||||||
{
|
{
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -783,7 +800,8 @@ WebRtc_Word32 AudioDeviceDummy::SetPlayoutDevice(WebRtc_UWord16 index)
|
|||||||
// SetPlayoutDevice II (II)
|
// SetPlayoutDevice II (II)
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WebRtc_Word32 AudioDeviceDummy::SetPlayoutDevice(AudioDeviceModule::WindowsDeviceType device)
|
WebRtc_Word32 AudioDeviceDummy::SetPlayoutDevice(
|
||||||
|
AudioDeviceModule::WindowsDeviceType device)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -792,7 +810,10 @@ WebRtc_Word32 AudioDeviceDummy::SetPlayoutDevice(AudioDeviceModule::WindowsDevic
|
|||||||
// PlayoutDeviceName
|
// PlayoutDeviceName
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WebRtc_Word32 AudioDeviceDummy::PlayoutDeviceName(WebRtc_UWord16 index, WebRtc_Word8 name[kAdmMaxDeviceNameSize], WebRtc_Word8 guid[kAdmMaxGuidSize])
|
WebRtc_Word32 AudioDeviceDummy::PlayoutDeviceName(
|
||||||
|
WebRtc_UWord16 index,
|
||||||
|
char name[kAdmMaxDeviceNameSize],
|
||||||
|
char guid[kAdmMaxGuidSize])
|
||||||
{
|
{
|
||||||
|
|
||||||
if (index != 0)
|
if (index != 0)
|
||||||
@ -814,7 +835,10 @@ WebRtc_Word32 AudioDeviceDummy::PlayoutDeviceName(WebRtc_UWord16 index, WebRtc_W
|
|||||||
// RecordingDeviceName
|
// RecordingDeviceName
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WebRtc_Word32 AudioDeviceDummy::RecordingDeviceName(WebRtc_UWord16 index, WebRtc_Word8 name[kAdmMaxDeviceNameSize], WebRtc_Word8 guid[kAdmMaxGuidSize])
|
WebRtc_Word32 AudioDeviceDummy::RecordingDeviceName(
|
||||||
|
WebRtc_UWord16 index,
|
||||||
|
char name[kAdmMaxDeviceNameSize],
|
||||||
|
char guid[kAdmMaxGuidSize])
|
||||||
{
|
{
|
||||||
|
|
||||||
if (index != 0)
|
if (index != 0)
|
||||||
@ -868,7 +892,8 @@ WebRtc_Word32 AudioDeviceDummy::SetRecordingDevice(WebRtc_UWord16 index)
|
|||||||
// SetRecordingDevice II (II)
|
// SetRecordingDevice II (II)
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WebRtc_Word32 AudioDeviceDummy::SetRecordingDevice(AudioDeviceModule::WindowsDeviceType device)
|
WebRtc_Word32 AudioDeviceDummy::SetRecordingDevice(
|
||||||
|
AudioDeviceModule::WindowsDeviceType device)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -919,7 +944,8 @@ WebRtc_Word32 AudioDeviceDummy::InitPlayout()
|
|||||||
// Initialize the speaker (devices might have been added or removed)
|
// Initialize the speaker (devices might have been added or removed)
|
||||||
if (InitSpeaker() == -1)
|
if (InitSpeaker() == -1)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, " InitSpeaker() failed");
|
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
|
||||||
|
" InitSpeaker() failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
_playIsInitialized = true;
|
_playIsInitialized = true;
|
||||||
@ -949,7 +975,8 @@ WebRtc_Word32 AudioDeviceDummy::InitRecording()
|
|||||||
// Initialize the microphone (devices might have been added or removed)
|
// Initialize the microphone (devices might have been added or removed)
|
||||||
if (InitMicrophone() == -1)
|
if (InitMicrophone() == -1)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id, " InitMicrophone() failed");
|
WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
|
||||||
|
" InitMicrophone() failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
_recIsInitialized = true;
|
_recIsInitialized = true;
|
||||||
@ -1106,7 +1133,8 @@ bool AudioDeviceDummy::Playing() const
|
|||||||
// SetPlayoutBuffer
|
// SetPlayoutBuffer
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WebRtc_Word32 AudioDeviceDummy::SetPlayoutBuffer(const AudioDeviceModule::BufferType type, WebRtc_UWord16 sizeMS)
|
WebRtc_Word32 AudioDeviceDummy::SetPlayoutBuffer(
|
||||||
|
const AudioDeviceModule::BufferType type, WebRtc_UWord16 sizeMS)
|
||||||
{
|
{
|
||||||
|
|
||||||
CriticalSectionScoped lock(_critSect);
|
CriticalSectionScoped lock(_critSect);
|
||||||
@ -1120,7 +1148,8 @@ WebRtc_Word32 AudioDeviceDummy::SetPlayoutBuffer(const AudioDeviceModule::Buffer
|
|||||||
// PlayoutBuffer
|
// PlayoutBuffer
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WebRtc_Word32 AudioDeviceDummy::PlayoutBuffer(AudioDeviceModule::BufferType& type, WebRtc_UWord16& sizeMS) const
|
WebRtc_Word32 AudioDeviceDummy::PlayoutBuffer(
|
||||||
|
AudioDeviceModule::BufferType& type, WebRtc_UWord16& sizeMS) const
|
||||||
{
|
{
|
||||||
CriticalSectionScoped lock(_critSect);
|
CriticalSectionScoped lock(_critSect);
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Use of this source code is governed by a BSD-style license
|
* 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
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@ -37,14 +37,22 @@ public:
|
|||||||
// Device enumeration
|
// Device enumeration
|
||||||
virtual WebRtc_Word16 PlayoutDevices();
|
virtual WebRtc_Word16 PlayoutDevices();
|
||||||
virtual WebRtc_Word16 RecordingDevices();
|
virtual WebRtc_Word16 RecordingDevices();
|
||||||
virtual WebRtc_Word32 PlayoutDeviceName(WebRtc_UWord16 index, WebRtc_Word8 name[kAdmMaxDeviceNameSize], WebRtc_Word8 guid[kAdmMaxGuidSize]);
|
virtual WebRtc_Word32 PlayoutDeviceName(
|
||||||
virtual WebRtc_Word32 RecordingDeviceName(WebRtc_UWord16 index, WebRtc_Word8 name[kAdmMaxDeviceNameSize], WebRtc_Word8 guid[kAdmMaxGuidSize]);
|
WebRtc_UWord16 index,
|
||||||
|
char name[kAdmMaxDeviceNameSize],
|
||||||
|
char guid[kAdmMaxGuidSize]);
|
||||||
|
virtual WebRtc_Word32 RecordingDeviceName(
|
||||||
|
WebRtc_UWord16 index,
|
||||||
|
char name[kAdmMaxDeviceNameSize],
|
||||||
|
char guid[kAdmMaxGuidSize]);
|
||||||
|
|
||||||
// Device selection
|
// Device selection
|
||||||
virtual WebRtc_Word32 SetPlayoutDevice(WebRtc_UWord16 index);
|
virtual WebRtc_Word32 SetPlayoutDevice(WebRtc_UWord16 index);
|
||||||
virtual WebRtc_Word32 SetPlayoutDevice(AudioDeviceModule::WindowsDeviceType device);
|
virtual WebRtc_Word32 SetPlayoutDevice(
|
||||||
|
AudioDeviceModule::WindowsDeviceType device);
|
||||||
virtual WebRtc_Word32 SetRecordingDevice(WebRtc_UWord16 index);
|
virtual WebRtc_Word32 SetRecordingDevice(WebRtc_UWord16 index);
|
||||||
virtual WebRtc_Word32 SetRecordingDevice(AudioDeviceModule::WindowsDeviceType device);
|
virtual WebRtc_Word32 SetRecordingDevice(
|
||||||
|
AudioDeviceModule::WindowsDeviceType device);
|
||||||
|
|
||||||
// Audio transport initialization
|
// Audio transport initialization
|
||||||
virtual WebRtc_Word32 PlayoutIsAvailable(bool& available);
|
virtual WebRtc_Word32 PlayoutIsAvailable(bool& available);
|
||||||
@ -67,8 +75,10 @@ public:
|
|||||||
virtual bool AGC() const;
|
virtual bool AGC() const;
|
||||||
|
|
||||||
// Volume control based on the Windows Wave API (Windows only)
|
// Volume control based on the Windows Wave API (Windows only)
|
||||||
virtual WebRtc_Word32 SetWaveOutVolume(WebRtc_UWord16 volumeLeft, WebRtc_UWord16 volumeRight);
|
virtual WebRtc_Word32 SetWaveOutVolume(
|
||||||
virtual WebRtc_Word32 WaveOutVolume(WebRtc_UWord16& volumeLeft, WebRtc_UWord16& volumeRight) const;
|
WebRtc_UWord16 volumeLeft, WebRtc_UWord16 volumeRight);
|
||||||
|
virtual WebRtc_Word32 WaveOutVolume(
|
||||||
|
WebRtc_UWord16& volumeLeft, WebRtc_UWord16& volumeRight) const;
|
||||||
|
|
||||||
// Audio mixer initialization
|
// Audio mixer initialization
|
||||||
virtual WebRtc_Word32 SpeakerIsAvailable(bool& available);
|
virtual WebRtc_Word32 SpeakerIsAvailable(bool& available);
|
||||||
@ -92,7 +102,8 @@ public:
|
|||||||
virtual WebRtc_Word32 MicrophoneVolume(WebRtc_UWord32& volume) const;
|
virtual WebRtc_Word32 MicrophoneVolume(WebRtc_UWord32& volume) const;
|
||||||
virtual WebRtc_Word32 MaxMicrophoneVolume(WebRtc_UWord32& maxVolume) const;
|
virtual WebRtc_Word32 MaxMicrophoneVolume(WebRtc_UWord32& maxVolume) const;
|
||||||
virtual WebRtc_Word32 MinMicrophoneVolume(WebRtc_UWord32& minVolume) const;
|
virtual WebRtc_Word32 MinMicrophoneVolume(WebRtc_UWord32& minVolume) const;
|
||||||
virtual WebRtc_Word32 MicrophoneVolumeStepSize(WebRtc_UWord16& stepSize) const;
|
virtual WebRtc_Word32 MicrophoneVolumeStepSize(
|
||||||
|
WebRtc_UWord16& stepSize) const;
|
||||||
|
|
||||||
// Speaker mute control
|
// Speaker mute control
|
||||||
virtual WebRtc_Word32 SpeakerMuteIsAvailable(bool& available);
|
virtual WebRtc_Word32 SpeakerMuteIsAvailable(bool& available);
|
||||||
@ -118,8 +129,10 @@ public:
|
|||||||
virtual WebRtc_Word32 StereoRecording(bool& enabled) const;
|
virtual WebRtc_Word32 StereoRecording(bool& enabled) const;
|
||||||
|
|
||||||
// Delay information and control
|
// Delay information and control
|
||||||
virtual WebRtc_Word32 SetPlayoutBuffer(const AudioDeviceModule::BufferType type, WebRtc_UWord16 sizeMS);
|
virtual WebRtc_Word32 SetPlayoutBuffer(
|
||||||
virtual WebRtc_Word32 PlayoutBuffer(AudioDeviceModule::BufferType& type, WebRtc_UWord16& sizeMS) const;
|
const AudioDeviceModule::BufferType type, WebRtc_UWord16 sizeMS);
|
||||||
|
virtual WebRtc_Word32 PlayoutBuffer(
|
||||||
|
AudioDeviceModule::BufferType& type, WebRtc_UWord16& sizeMS) const;
|
||||||
virtual WebRtc_Word32 PlayoutDelay(WebRtc_UWord16& delayMS) const;
|
virtual WebRtc_Word32 PlayoutDelay(WebRtc_UWord16& delayMS) const;
|
||||||
virtual WebRtc_Word32 RecordingDelay(WebRtc_UWord16& delayMS) const;
|
virtual WebRtc_Word32 RecordingDelay(WebRtc_UWord16& delayMS) const;
|
||||||
|
|
||||||
|
@ -932,8 +932,8 @@ WebRtc_Word32 AudioDeviceLinuxALSA::SetPlayoutDevice(
|
|||||||
|
|
||||||
WebRtc_Word32 AudioDeviceLinuxALSA::PlayoutDeviceName(
|
WebRtc_Word32 AudioDeviceLinuxALSA::PlayoutDeviceName(
|
||||||
WebRtc_UWord16 index,
|
WebRtc_UWord16 index,
|
||||||
WebRtc_Word8 name[kAdmMaxDeviceNameSize],
|
char name[kAdmMaxDeviceNameSize],
|
||||||
WebRtc_Word8 guid[kAdmMaxGuidSize])
|
char guid[kAdmMaxGuidSize])
|
||||||
{
|
{
|
||||||
|
|
||||||
const WebRtc_UWord16 nDevices(PlayoutDevices());
|
const WebRtc_UWord16 nDevices(PlayoutDevices());
|
||||||
@ -955,8 +955,8 @@ WebRtc_Word32 AudioDeviceLinuxALSA::PlayoutDeviceName(
|
|||||||
|
|
||||||
WebRtc_Word32 AudioDeviceLinuxALSA::RecordingDeviceName(
|
WebRtc_Word32 AudioDeviceLinuxALSA::RecordingDeviceName(
|
||||||
WebRtc_UWord16 index,
|
WebRtc_UWord16 index,
|
||||||
WebRtc_Word8 name[kAdmMaxDeviceNameSize],
|
char name[kAdmMaxDeviceNameSize],
|
||||||
WebRtc_Word8 guid[kAdmMaxGuidSize])
|
char guid[kAdmMaxGuidSize])
|
||||||
{
|
{
|
||||||
|
|
||||||
const WebRtc_UWord16 nDevices(RecordingDevices());
|
const WebRtc_UWord16 nDevices(RecordingDevices());
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Use of this source code is governed by a BSD-style license
|
* 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
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@ -45,12 +45,12 @@ public:
|
|||||||
virtual WebRtc_Word16 RecordingDevices();
|
virtual WebRtc_Word16 RecordingDevices();
|
||||||
virtual WebRtc_Word32 PlayoutDeviceName(
|
virtual WebRtc_Word32 PlayoutDeviceName(
|
||||||
WebRtc_UWord16 index,
|
WebRtc_UWord16 index,
|
||||||
WebRtc_Word8 name[kAdmMaxDeviceNameSize],
|
char name[kAdmMaxDeviceNameSize],
|
||||||
WebRtc_Word8 guid[kAdmMaxGuidSize]);
|
char guid[kAdmMaxGuidSize]);
|
||||||
virtual WebRtc_Word32 RecordingDeviceName(
|
virtual WebRtc_Word32 RecordingDeviceName(
|
||||||
WebRtc_UWord16 index,
|
WebRtc_UWord16 index,
|
||||||
WebRtc_Word8 name[kAdmMaxDeviceNameSize],
|
char name[kAdmMaxDeviceNameSize],
|
||||||
WebRtc_Word8 guid[kAdmMaxGuidSize]);
|
char guid[kAdmMaxGuidSize]);
|
||||||
|
|
||||||
// Device selection
|
// Device selection
|
||||||
virtual WebRtc_Word32 SetPlayoutDevice(WebRtc_UWord16 index);
|
virtual WebRtc_Word32 SetPlayoutDevice(WebRtc_UWord16 index);
|
||||||
|
@ -1071,8 +1071,8 @@ WebRtc_Word32 AudioDeviceLinuxPulse::SetPlayoutDevice(
|
|||||||
|
|
||||||
WebRtc_Word32 AudioDeviceLinuxPulse::PlayoutDeviceName(
|
WebRtc_Word32 AudioDeviceLinuxPulse::PlayoutDeviceName(
|
||||||
WebRtc_UWord16 index,
|
WebRtc_UWord16 index,
|
||||||
WebRtc_Word8 name[kAdmMaxDeviceNameSize],
|
char name[kAdmMaxDeviceNameSize],
|
||||||
WebRtc_Word8 guid[kAdmMaxGuidSize])
|
char guid[kAdmMaxGuidSize])
|
||||||
{
|
{
|
||||||
|
|
||||||
const WebRtc_UWord16 nDevices = PlayoutDevices();
|
const WebRtc_UWord16 nDevices = PlayoutDevices();
|
||||||
@ -1113,8 +1113,8 @@ WebRtc_Word32 AudioDeviceLinuxPulse::PlayoutDeviceName(
|
|||||||
|
|
||||||
WebRtc_Word32 AudioDeviceLinuxPulse::RecordingDeviceName(
|
WebRtc_Word32 AudioDeviceLinuxPulse::RecordingDeviceName(
|
||||||
WebRtc_UWord16 index,
|
WebRtc_UWord16 index,
|
||||||
WebRtc_Word8 name[kAdmMaxDeviceNameSize],
|
char name[kAdmMaxDeviceNameSize],
|
||||||
WebRtc_Word8 guid[kAdmMaxGuidSize])
|
char guid[kAdmMaxGuidSize])
|
||||||
{
|
{
|
||||||
|
|
||||||
const WebRtc_UWord16 nDevices(RecordingDevices());
|
const WebRtc_UWord16 nDevices(RecordingDevices());
|
||||||
@ -2124,13 +2124,13 @@ WebRtc_Word32 AudioDeviceLinuxPulse::InitSamplingFrequency()
|
|||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 AudioDeviceLinuxPulse::GetDefaultDeviceInfo(bool recDevice,
|
WebRtc_Word32 AudioDeviceLinuxPulse::GetDefaultDeviceInfo(bool recDevice,
|
||||||
WebRtc_Word8* name,
|
char* name,
|
||||||
WebRtc_UWord16& index)
|
WebRtc_UWord16& index)
|
||||||
{
|
{
|
||||||
WebRtc_Word8 tmpName[kAdmMaxDeviceNameSize] = {0};
|
char tmpName[kAdmMaxDeviceNameSize] = {0};
|
||||||
// subtract length of "default: "
|
// subtract length of "default: "
|
||||||
WebRtc_UWord16 nameLen = kAdmMaxDeviceNameSize - 9;
|
WebRtc_UWord16 nameLen = kAdmMaxDeviceNameSize - 9;
|
||||||
WebRtc_Word8* pName = NULL;
|
char* pName = NULL;
|
||||||
|
|
||||||
if (name)
|
if (name)
|
||||||
{
|
{
|
||||||
@ -2792,7 +2792,7 @@ bool AudioDeviceLinuxPulse::PlayThreadProcess()
|
|||||||
if (_outputDeviceIndex > 0)
|
if (_outputDeviceIndex > 0)
|
||||||
{
|
{
|
||||||
// Get the playout device name
|
// Get the playout device name
|
||||||
_playDeviceName = new WebRtc_Word8[kAdmMaxDeviceNameSize];
|
_playDeviceName = new char[kAdmMaxDeviceNameSize];
|
||||||
_deviceIndex = _outputDeviceIndex;
|
_deviceIndex = _outputDeviceIndex;
|
||||||
PlayoutDevices();
|
PlayoutDevices();
|
||||||
}
|
}
|
||||||
@ -3026,7 +3026,7 @@ bool AudioDeviceLinuxPulse::RecThreadProcess()
|
|||||||
if (_inputDeviceIndex > 0)
|
if (_inputDeviceIndex > 0)
|
||||||
{
|
{
|
||||||
// Get the recording device name
|
// Get the recording device name
|
||||||
_recDeviceName = new WebRtc_Word8[kAdmMaxDeviceNameSize];
|
_recDeviceName = new char[kAdmMaxDeviceNameSize];
|
||||||
_deviceIndex = _inputDeviceIndex;
|
_deviceIndex = _inputDeviceIndex;
|
||||||
RecordingDevices();
|
RecordingDevices();
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Use of this source code is governed by a BSD-style license
|
* 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
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@ -113,12 +113,12 @@ public:
|
|||||||
virtual WebRtc_Word16 RecordingDevices();
|
virtual WebRtc_Word16 RecordingDevices();
|
||||||
virtual WebRtc_Word32 PlayoutDeviceName(
|
virtual WebRtc_Word32 PlayoutDeviceName(
|
||||||
WebRtc_UWord16 index,
|
WebRtc_UWord16 index,
|
||||||
WebRtc_Word8 name[kAdmMaxDeviceNameSize],
|
char name[kAdmMaxDeviceNameSize],
|
||||||
WebRtc_Word8 guid[kAdmMaxGuidSize]);
|
char guid[kAdmMaxGuidSize]);
|
||||||
virtual WebRtc_Word32 RecordingDeviceName(
|
virtual WebRtc_Word32 RecordingDeviceName(
|
||||||
WebRtc_UWord16 index,
|
WebRtc_UWord16 index,
|
||||||
WebRtc_Word8 name[kAdmMaxDeviceNameSize],
|
char name[kAdmMaxDeviceNameSize],
|
||||||
WebRtc_Word8 guid[kAdmMaxGuidSize]);
|
char guid[kAdmMaxGuidSize]);
|
||||||
|
|
||||||
// Device selection
|
// Device selection
|
||||||
virtual WebRtc_Word32 SetPlayoutDevice(WebRtc_UWord16 index);
|
virtual WebRtc_Word32 SetPlayoutDevice(WebRtc_UWord16 index);
|
||||||
@ -278,7 +278,7 @@ private:
|
|||||||
|
|
||||||
WebRtc_Word32 CheckPulseAudioVersion();
|
WebRtc_Word32 CheckPulseAudioVersion();
|
||||||
WebRtc_Word32 InitSamplingFrequency();
|
WebRtc_Word32 InitSamplingFrequency();
|
||||||
WebRtc_Word32 GetDefaultDeviceInfo(bool recDevice, WebRtc_Word8* name,
|
WebRtc_Word32 GetDefaultDeviceInfo(bool recDevice, char* name,
|
||||||
WebRtc_UWord16& index);
|
WebRtc_UWord16& index);
|
||||||
WebRtc_Word32 InitPulseAudio();
|
WebRtc_Word32 InitPulseAudio();
|
||||||
WebRtc_Word32 TerminatePulseAudio();
|
WebRtc_Word32 TerminatePulseAudio();
|
||||||
@ -346,11 +346,11 @@ private:
|
|||||||
WebRtc_UWord16 _deviceIndex;
|
WebRtc_UWord16 _deviceIndex;
|
||||||
WebRtc_Word16 _numPlayDevices;
|
WebRtc_Word16 _numPlayDevices;
|
||||||
WebRtc_Word16 _numRecDevices;
|
WebRtc_Word16 _numRecDevices;
|
||||||
WebRtc_Word8* _playDeviceName;
|
char* _playDeviceName;
|
||||||
WebRtc_Word8* _recDeviceName;
|
char* _recDeviceName;
|
||||||
WebRtc_Word8* _playDisplayDeviceName;
|
char* _playDisplayDeviceName;
|
||||||
WebRtc_Word8* _recDisplayDeviceName;
|
char* _recDisplayDeviceName;
|
||||||
WebRtc_Word8 _paServerVersion[32];
|
char _paServerVersion[32];
|
||||||
|
|
||||||
WebRtc_Word8* _playBuffer;
|
WebRtc_Word8* _playBuffer;
|
||||||
size_t _playbackBufferSize;
|
size_t _playbackBufferSize;
|
||||||
|
@ -1109,7 +1109,7 @@ void AudioMixerManagerLinuxPulse::PaSinkInputInfoCallbackHandler(
|
|||||||
{
|
{
|
||||||
if (eol)
|
if (eol)
|
||||||
{
|
{
|
||||||
// Signal that we are done.
|
// Signal that we are done
|
||||||
LATE(pa_threaded_mainloop_signal)(_paMainloop, 0);
|
LATE(pa_threaded_mainloop_signal)(_paMainloop, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1139,8 +1139,8 @@ WebRtc_Word32 AudioDeviceMac::SetPlayoutDevice(
|
|||||||
|
|
||||||
WebRtc_Word32 AudioDeviceMac::PlayoutDeviceName(
|
WebRtc_Word32 AudioDeviceMac::PlayoutDeviceName(
|
||||||
WebRtc_UWord16 index,
|
WebRtc_UWord16 index,
|
||||||
WebRtc_Word8 name[kAdmMaxDeviceNameSize],
|
char name[kAdmMaxDeviceNameSize],
|
||||||
WebRtc_Word8 guid[kAdmMaxGuidSize])
|
char guid[kAdmMaxGuidSize])
|
||||||
{
|
{
|
||||||
|
|
||||||
const WebRtc_UWord16 nDevices(PlayoutDevices());
|
const WebRtc_UWord16 nDevices(PlayoutDevices());
|
||||||
@ -1162,8 +1162,8 @@ WebRtc_Word32 AudioDeviceMac::PlayoutDeviceName(
|
|||||||
|
|
||||||
WebRtc_Word32 AudioDeviceMac::RecordingDeviceName(
|
WebRtc_Word32 AudioDeviceMac::RecordingDeviceName(
|
||||||
WebRtc_UWord16 index,
|
WebRtc_UWord16 index,
|
||||||
WebRtc_Word8 name[kAdmMaxDeviceNameSize],
|
char name[kAdmMaxDeviceNameSize],
|
||||||
WebRtc_Word8 guid[kAdmMaxGuidSize])
|
char guid[kAdmMaxGuidSize])
|
||||||
{
|
{
|
||||||
|
|
||||||
const WebRtc_UWord16 nDevices(RecordingDevices());
|
const WebRtc_UWord16 nDevices(RecordingDevices());
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Use of this source code is governed by a BSD-style license
|
* 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
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@ -78,12 +78,12 @@ public:
|
|||||||
virtual WebRtc_Word16 RecordingDevices();
|
virtual WebRtc_Word16 RecordingDevices();
|
||||||
virtual WebRtc_Word32 PlayoutDeviceName(
|
virtual WebRtc_Word32 PlayoutDeviceName(
|
||||||
WebRtc_UWord16 index,
|
WebRtc_UWord16 index,
|
||||||
WebRtc_Word8 name[kAdmMaxDeviceNameSize],
|
char name[kAdmMaxDeviceNameSize],
|
||||||
WebRtc_Word8 guid[kAdmMaxGuidSize]);
|
char guid[kAdmMaxGuidSize]);
|
||||||
virtual WebRtc_Word32 RecordingDeviceName(
|
virtual WebRtc_Word32 RecordingDeviceName(
|
||||||
WebRtc_UWord16 index,
|
WebRtc_UWord16 index,
|
||||||
WebRtc_Word8 name[kAdmMaxDeviceNameSize],
|
char name[kAdmMaxDeviceNameSize],
|
||||||
WebRtc_Word8 guid[kAdmMaxGuidSize]);
|
char guid[kAdmMaxGuidSize]);
|
||||||
|
|
||||||
// Device selection
|
// Device selection
|
||||||
virtual WebRtc_Word32 SetPlayoutDevice(WebRtc_UWord16 index);
|
virtual WebRtc_Word32 SetPlayoutDevice(WebRtc_UWord16 index);
|
||||||
|
@ -1857,7 +1857,10 @@ WebRtc_Word32 AudioDeviceWindowsCore::SetPlayoutDevice(AudioDeviceModule::Window
|
|||||||
// PlayoutDeviceName
|
// PlayoutDeviceName
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WebRtc_Word32 AudioDeviceWindowsCore::PlayoutDeviceName(WebRtc_UWord16 index, WebRtc_Word8 name[kAdmMaxDeviceNameSize], WebRtc_Word8 guid[kAdmMaxGuidSize])
|
WebRtc_Word32 AudioDeviceWindowsCore::PlayoutDeviceName(
|
||||||
|
WebRtc_UWord16 index,
|
||||||
|
char name[kAdmMaxDeviceNameSize],
|
||||||
|
char guid[kAdmMaxGuidSize])
|
||||||
{
|
{
|
||||||
|
|
||||||
bool defaultCommunicationDevice(false);
|
bool defaultCommunicationDevice(false);
|
||||||
@ -1935,7 +1938,10 @@ WebRtc_Word32 AudioDeviceWindowsCore::PlayoutDeviceName(WebRtc_UWord16 index, We
|
|||||||
// RecordingDeviceName
|
// RecordingDeviceName
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WebRtc_Word32 AudioDeviceWindowsCore::RecordingDeviceName(WebRtc_UWord16 index, WebRtc_Word8 name[kAdmMaxDeviceNameSize], WebRtc_Word8 guid[kAdmMaxGuidSize])
|
WebRtc_Word32 AudioDeviceWindowsCore::RecordingDeviceName(
|
||||||
|
WebRtc_UWord16 index,
|
||||||
|
char name[kAdmMaxDeviceNameSize],
|
||||||
|
char guid[kAdmMaxGuidSize])
|
||||||
{
|
{
|
||||||
|
|
||||||
bool defaultCommunicationDevice(false);
|
bool defaultCommunicationDevice(false);
|
||||||
|
@ -100,8 +100,14 @@ public:
|
|||||||
// Device enumeration
|
// Device enumeration
|
||||||
virtual WebRtc_Word16 PlayoutDevices();
|
virtual WebRtc_Word16 PlayoutDevices();
|
||||||
virtual WebRtc_Word16 RecordingDevices();
|
virtual WebRtc_Word16 RecordingDevices();
|
||||||
virtual WebRtc_Word32 PlayoutDeviceName(WebRtc_UWord16 index, WebRtc_Word8 name[kAdmMaxDeviceNameSize], WebRtc_Word8 guid[kAdmMaxGuidSize]);
|
virtual WebRtc_Word32 PlayoutDeviceName(
|
||||||
virtual WebRtc_Word32 RecordingDeviceName(WebRtc_UWord16 index, WebRtc_Word8 name[kAdmMaxDeviceNameSize], WebRtc_Word8 guid[kAdmMaxGuidSize]);
|
WebRtc_UWord16 index,
|
||||||
|
char name[kAdmMaxDeviceNameSize],
|
||||||
|
char guid[kAdmMaxGuidSize]);
|
||||||
|
virtual WebRtc_Word32 RecordingDeviceName(
|
||||||
|
WebRtc_UWord16 index,
|
||||||
|
char name[kAdmMaxDeviceNameSize],
|
||||||
|
char guid[kAdmMaxGuidSize]);
|
||||||
|
|
||||||
// Device selection
|
// Device selection
|
||||||
virtual WebRtc_Word32 SetPlayoutDevice(WebRtc_UWord16 index);
|
virtual WebRtc_Word32 SetPlayoutDevice(WebRtc_UWord16 index);
|
||||||
|
@ -1374,7 +1374,10 @@ WebRtc_Word32 AudioDeviceWindowsWave::SetPlayoutDevice(AudioDeviceModule::Window
|
|||||||
// PlayoutDeviceName
|
// PlayoutDeviceName
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WebRtc_Word32 AudioDeviceWindowsWave::PlayoutDeviceName(WebRtc_UWord16 index, WebRtc_Word8 name[kAdmMaxDeviceNameSize], WebRtc_Word8 guid[kAdmMaxGuidSize])
|
WebRtc_Word32 AudioDeviceWindowsWave::PlayoutDeviceName(
|
||||||
|
WebRtc_UWord16 index,
|
||||||
|
char name[kAdmMaxDeviceNameSize],
|
||||||
|
char guid[kAdmMaxGuidSize])
|
||||||
{
|
{
|
||||||
|
|
||||||
WebRtc_UWord16 nDevices(PlayoutDevices());
|
WebRtc_UWord16 nDevices(PlayoutDevices());
|
||||||
@ -1476,7 +1479,10 @@ WebRtc_Word32 AudioDeviceWindowsWave::PlayoutDeviceName(WebRtc_UWord16 index, We
|
|||||||
// RecordingDeviceName
|
// RecordingDeviceName
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
WebRtc_Word32 AudioDeviceWindowsWave::RecordingDeviceName(WebRtc_UWord16 index, WebRtc_Word8 name[kAdmMaxDeviceNameSize], WebRtc_Word8 guid[kAdmMaxGuidSize])
|
WebRtc_Word32 AudioDeviceWindowsWave::RecordingDeviceName(
|
||||||
|
WebRtc_UWord16 index,
|
||||||
|
char name[kAdmMaxDeviceNameSize],
|
||||||
|
char guid[kAdmMaxGuidSize])
|
||||||
{
|
{
|
||||||
|
|
||||||
WebRtc_UWord16 nDevices(RecordingDevices());
|
WebRtc_UWord16 nDevices(RecordingDevices());
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Use of this source code is governed by a BSD-style license
|
* 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
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@ -54,8 +54,14 @@ public:
|
|||||||
// Device enumeration
|
// Device enumeration
|
||||||
virtual WebRtc_Word16 PlayoutDevices();
|
virtual WebRtc_Word16 PlayoutDevices();
|
||||||
virtual WebRtc_Word16 RecordingDevices();
|
virtual WebRtc_Word16 RecordingDevices();
|
||||||
virtual WebRtc_Word32 PlayoutDeviceName(WebRtc_UWord16 index, WebRtc_Word8 name[kAdmMaxDeviceNameSize], WebRtc_Word8 guid[kAdmMaxGuidSize]);
|
virtual WebRtc_Word32 PlayoutDeviceName(
|
||||||
virtual WebRtc_Word32 RecordingDeviceName(WebRtc_UWord16 index, WebRtc_Word8 name[kAdmMaxDeviceNameSize], WebRtc_Word8 guid[kAdmMaxGuidSize]);
|
WebRtc_UWord16 index,
|
||||||
|
char name[kAdmMaxDeviceNameSize],
|
||||||
|
char guid[kAdmMaxGuidSize]);
|
||||||
|
virtual WebRtc_Word32 RecordingDeviceName(
|
||||||
|
WebRtc_UWord16 index,
|
||||||
|
char name[kAdmMaxDeviceNameSize],
|
||||||
|
char guid[kAdmMaxGuidSize]);
|
||||||
|
|
||||||
// Device selection
|
// Device selection
|
||||||
virtual WebRtc_Word32 SetPlayoutDevice(WebRtc_UWord16 index);
|
virtual WebRtc_Word32 SetPlayoutDevice(WebRtc_UWord16 index);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Use of this source code is governed by a BSD-style license
|
* 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
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@ -20,7 +20,9 @@
|
|||||||
// Helper functions
|
// Helper functions
|
||||||
#if defined(ANDROID)
|
#if defined(ANDROID)
|
||||||
char filenameStr[2][256] =
|
char filenameStr[2][256] =
|
||||||
{ 0}; // Allow two buffers for those API calls taking two filenames
|
{ {0},
|
||||||
|
{0},
|
||||||
|
}; // Allow two buffers for those API calls taking two filenames
|
||||||
int currentStr = 0;
|
int currentStr = 0;
|
||||||
|
|
||||||
char* GetFilename(char* filename)
|
char* GetFilename(char* filename)
|
||||||
@ -192,10 +194,7 @@ private:
|
|||||||
WebRtc_UWord32 _playCount;
|
WebRtc_UWord32 _playCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
int api_test();
|
#if !defined(MAC_IPHONE)
|
||||||
|
|
||||||
|
|
||||||
#if !defined(MAC_IPHONE) && !defined(ANDROID)
|
|
||||||
int api_test();
|
int api_test();
|
||||||
|
|
||||||
int main(int /*argc*/, char* /*argv*/[])
|
int main(int /*argc*/, char* /*argv*/[])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user