diff options
author | henrikg@webrtc.org <henrikg@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-12-06 16:05:17 +0000 |
---|---|---|
committer | henrikg@webrtc.org <henrikg@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-12-06 16:05:17 +0000 |
commit | 7b72264dd14dcffb873d096339de6ed47015ac43 (patch) | |
tree | c651b094eec9d2f99ba613d8714b20d7228c6609 /voice_engine | |
parent | 4383539b27ae877337679901c1cc9120f3a83fef (diff) | |
download | webrtc-7b72264dd14dcffb873d096339de6ed47015ac43.tar.gz |
Allow opening an AEC dump from an existing file handle.
This is necessary for Chromium to be able enable the dump with the sanbox enabled. It will open the file in the browser process and pass the handle to the render process.
This changes FileWrapper to deal with the case were the file handle is not managed by the wrapper.
BUG=2567
R=andrew@webrtc.org, henrika@webrtc.org, perkj@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/4649004
git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@5239 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'voice_engine')
-rw-r--r-- | voice_engine/include/voe_audio_processing.h | 6 | ||||
-rw-r--r-- | voice_engine/voe_audio_processing_impl.cc | 11 | ||||
-rw-r--r-- | voice_engine/voe_audio_processing_impl.h | 1 |
3 files changed, 18 insertions, 0 deletions
diff --git a/voice_engine/include/voe_audio_processing.h b/voice_engine/include/voe_audio_processing.h index 3ba7b1a2..8b40360a 100644 --- a/voice_engine/include/voe_audio_processing.h +++ b/voice_engine/include/voe_audio_processing.h @@ -35,6 +35,8 @@ #ifndef WEBRTC_VOICE_ENGINE_VOE_AUDIO_PROCESSING_H #define WEBRTC_VOICE_ENGINE_VOE_AUDIO_PROCESSING_H +#include <stdio.h> + #include "webrtc/common_types.h" namespace webrtc { @@ -191,6 +193,10 @@ public: // The file can later be used for off-line analysis of the AP performance. virtual int StartDebugRecording(const char* fileNameUTF8) = 0; + // Same as above but sets and uses an existing file handle. Takes ownership + // of |file_handle| and passes it on to the audio processing module. + virtual int StartDebugRecording(FILE* file_handle) = 0; + // Disables recording of AP debugging information. virtual int StopDebugRecording() = 0; diff --git a/voice_engine/voe_audio_processing_impl.cc b/voice_engine/voe_audio_processing_impl.cc index a57ede93..63a4ed76 100644 --- a/voice_engine/voe_audio_processing_impl.cc +++ b/voice_engine/voe_audio_processing_impl.cc @@ -972,6 +972,17 @@ int VoEAudioProcessingImpl::StartDebugRecording(const char* fileNameUTF8) { return _shared->audio_processing()->StartDebugRecording(fileNameUTF8); } +int VoEAudioProcessingImpl::StartDebugRecording(FILE* file_handle) { + WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), + "StartDebugRecording()"); + if (!_shared->statistics().Initialized()) { + _shared->SetLastError(VE_NOT_INITED, kTraceError); + return -1; + } + + return _shared->audio_processing()->StartDebugRecording(file_handle); +} + int VoEAudioProcessingImpl::StopDebugRecording() { WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_shared->instance_id(), -1), "StopDebugRecording()"); diff --git a/voice_engine/voe_audio_processing_impl.h b/voice_engine/voe_audio_processing_impl.h index 309d997b..524439d5 100644 --- a/voice_engine/voe_audio_processing_impl.h +++ b/voice_engine/voe_audio_processing_impl.h @@ -79,6 +79,7 @@ class VoEAudioProcessingImpl : public VoEAudioProcessing { virtual int GetEcDelayMetrics(int& delay_median, int& delay_std); virtual int StartDebugRecording(const char* fileNameUTF8); + virtual int StartDebugRecording(FILE* file_handle); virtual int StopDebugRecording(); |