aboutsummaryrefslogtreecommitdiff
path: root/webrtc/modules
diff options
context:
space:
mode:
authorxians@webrtc.org <xians@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2014-04-14 10:50:37 +0000
committerxians@webrtc.org <xians@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2014-04-14 10:50:37 +0000
commit5692531f18cae04d8a8107793dc74ae932bdf219 (patch)
tree76f909776b6b5e9fa9e416f756f4d5f77dc6d99b /webrtc/modules
parenta956ec2019c28598b0abcc801b17b6589230cca9 (diff)
downloadwebrtc-5692531f18cae04d8a8107793dc74ae932bdf219.tar.gz
Added a new OnMoreData() interface which will not feed the playout data to APM.
BUG=3147 R=andrew@webrtc.org Review URL: https://webrtc-codereview.appspot.com/11059005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5895 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'webrtc/modules')
-rw-r--r--webrtc/modules/audio_device/include/audio_device_defines.h23
-rw-r--r--webrtc/modules/audio_device/test/audio_device_test_api.cc12
-rw-r--r--webrtc/modules/audio_device/test/func_test_manager.cc15
-rw-r--r--webrtc/modules/audio_device/test/func_test_manager.h12
4 files changed, 47 insertions, 15 deletions
diff --git a/webrtc/modules/audio_device/include/audio_device_defines.h b/webrtc/modules/audio_device/include/audio_device_defines.h
index 9f3e24b10a..0704ea8321 100644
--- a/webrtc/modules/audio_device/include/audio_device_defines.h
+++ b/webrtc/modules/audio_device/include/audio_device_defines.h
@@ -101,13 +101,32 @@ public:
// Method to pass the captured audio data to the specific VoE channel.
// |voe_channel| is the id of the VoE channel which is the sink to the
// capture data.
- // TODO(xians): Make the interface pure virtual after libjingle
- // has its implementation.
+ // TODO(xians): Remove this interface after Libjingle switches to
+ // PushCaptureData().
virtual void OnData(int voe_channel, const void* audio_data,
int bits_per_sample, int sample_rate,
int number_of_channels,
int number_of_frames) {}
+ // Method to push the captured audio data to the specific VoE channel.
+ // The data will not undergo audio processing.
+ // |voe_channel| is the id of the VoE channel which is the sink to the
+ // capture data.
+ // TODO(xians): Make the interface pure virtual after Libjingle
+ // has its implementation.
+ virtual void PushCaptureData(int voe_channel, const void* audio_data,
+ int bits_per_sample, int sample_rate,
+ int number_of_channels,
+ int number_of_frames) {}
+
+ // Method to pull mixed render audio data from all active VoE channels.
+ // The data will not be passed as reference for audio processing internally.
+ // TODO(xians): Support getting the unmixed render data from specific VoE
+ // channel.
+ virtual void PullRenderData(int bits_per_sample, int sample_rate,
+ int number_of_channels, int number_of_frames,
+ void* audio_data) {}
+
protected:
virtual ~AudioTransport() {}
};
diff --git a/webrtc/modules/audio_device/test/audio_device_test_api.cc b/webrtc/modules/audio_device/test/audio_device_test_api.cc
index 7692b12a46..fb00e0a4e4 100644
--- a/webrtc/modules/audio_device/test/audio_device_test_api.cc
+++ b/webrtc/modules/audio_device/test/audio_device_test_api.cc
@@ -142,10 +142,14 @@ class AudioTransportAPI: public AudioTransport {
return 0;
}
- virtual void OnData(int voe_channel, const void* audio_data,
- int bits_per_sample, int sample_rate,
- int number_of_channels,
- int number_of_frames) {}
+ virtual void PushCaptureData(int voe_channel, const void* audio_data,
+ int bits_per_sample, int sample_rate,
+ int number_of_channels,
+ int number_of_frames) {}
+
+ virtual void PullRenderData(int bits_per_sample, int sample_rate,
+ int number_of_channels, int number_of_frames,
+ void* audio_data) {}
private:
uint32_t rec_count_;
uint32_t play_count_;
diff --git a/webrtc/modules/audio_device/test/func_test_manager.cc b/webrtc/modules/audio_device/test/func_test_manager.cc
index 7024e2c6e4..30123d1ba8 100644
--- a/webrtc/modules/audio_device/test/func_test_manager.cc
+++ b/webrtc/modules/audio_device/test/func_test_manager.cc
@@ -542,11 +542,16 @@ int AudioTransportImpl::OnDataAvailable(const int voe_channels[],
return 0;
}
-void AudioTransportImpl::OnData(int voe_channel,
- const void* audio_data,
- int bits_per_sample, int sample_rate,
- int number_of_channels,
- int number_of_frames) {}
+void AudioTransportImpl::PushCaptureData(int voe_channel,
+ const void* audio_data,
+ int bits_per_sample, int sample_rate,
+ int number_of_channels,
+ int number_of_frames) {}
+
+void AudioTransportImpl::PullRenderData(int bits_per_sample, int sample_rate,
+ int number_of_channels,
+ int number_of_frames,
+ void* audio_data) {}
FuncTestManager::FuncTestManager() :
_processThread(NULL),
diff --git a/webrtc/modules/audio_device/test/func_test_manager.h b/webrtc/modules/audio_device/test/func_test_manager.h
index 6e21466e67..bd32f627ae 100644
--- a/webrtc/modules/audio_device/test/func_test_manager.h
+++ b/webrtc/modules/audio_device/test/func_test_manager.h
@@ -131,10 +131,14 @@ public:
bool key_pressed,
bool need_audio_processing);
- virtual void OnData(int voe_channel, const void* audio_data,
- int bits_per_sample, int sample_rate,
- int number_of_channels,
- int number_of_frames);
+ virtual void PushCaptureData(int voe_channel, const void* audio_data,
+ int bits_per_sample, int sample_rate,
+ int number_of_channels,
+ int number_of_frames);
+
+ virtual void PullRenderData(int bits_per_sample, int sample_rate,
+ int number_of_channels, int number_of_frames,
+ void* audio_data);
AudioTransportImpl(AudioDeviceModule* audioDevice);
~AudioTransportImpl();