Reland 28629004: adding new AEC dump start interface for chrome.
This is required because we are not allow to pass CRT objects across dll boundaries, that says, when we pass a file descriptor from chrome dll to libpeerconnection dll, the file descriptor will become invalid immediate, more information can be found here: http://msdn.microsoft.com/en-us/library/ms235460.aspx R=andresp@webrtc.org, andrew@webrtc.org, bjornv@webrtc.org, henrike@webrtc.org, henrikg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/30629004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7418 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -157,6 +157,7 @@ source_set("audio_processing") {
|
||||
}
|
||||
|
||||
deps += [
|
||||
"../../base:rtc_base_approved",
|
||||
"../../common_audio",
|
||||
"../../system_wrappers",
|
||||
]
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
{
|
||||
'variables': {
|
||||
'audio_processing_dependencies': [
|
||||
'<(webrtc_root)/base/base.gyp:rtc_base_approved',
|
||||
'<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
|
||||
'<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
|
||||
],
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "webrtc/base/platform_file.h"
|
||||
#include "webrtc/common_audio/include/audio_util.h"
|
||||
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
|
||||
#include "webrtc/modules/audio_processing/audio_buffer.h"
|
||||
@ -716,6 +717,12 @@ int AudioProcessingImpl::StartDebugRecording(FILE* handle) {
|
||||
#endif // WEBRTC_AUDIOPROC_DEBUG_DUMP
|
||||
}
|
||||
|
||||
int AudioProcessingImpl::StartDebugRecordingForPlatformFile(
|
||||
rtc::PlatformFile handle) {
|
||||
FILE* stream = rtc::FdopenPlatformFileForWriting(handle);
|
||||
return StartDebugRecording(stream);
|
||||
}
|
||||
|
||||
int AudioProcessingImpl::StopDebugRecording() {
|
||||
CriticalSectionScoped crit_scoped(crit_);
|
||||
|
||||
|
||||
@ -125,6 +125,8 @@ class AudioProcessingImpl : public AudioProcessing {
|
||||
virtual int StartDebugRecording(
|
||||
const char filename[kMaxFilenameSize]) OVERRIDE;
|
||||
virtual int StartDebugRecording(FILE* handle) OVERRIDE;
|
||||
virtual int StartDebugRecordingForPlatformFile(
|
||||
rtc::PlatformFile handle) OVERRIDE;
|
||||
virtual int StopDebugRecording() OVERRIDE;
|
||||
virtual EchoCancellation* echo_cancellation() const OVERRIDE;
|
||||
virtual EchoControlMobile* echo_control_mobile() const OVERRIDE;
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
#include <stddef.h> // size_t
|
||||
#include <stdio.h> // FILE
|
||||
|
||||
#include "webrtc/base/platform_file.h"
|
||||
#include "webrtc/common.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
@ -325,6 +326,13 @@ class AudioProcessing {
|
||||
// of |handle| and closes it at StopDebugRecording().
|
||||
virtual int StartDebugRecording(FILE* handle) = 0;
|
||||
|
||||
// Same as above but uses an existing PlatformFile handle. Takes ownership
|
||||
// of |handle| and closes it at StopDebugRecording().
|
||||
// TODO(xians): Make this interface pure virtual.
|
||||
virtual int StartDebugRecordingForPlatformFile(rtc::PlatformFile handle) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Stops recording debugging information, and closes the file. Recording
|
||||
// cannot be resumed in the same file (without overwriting it).
|
||||
virtual int StopDebugRecording() = 0;
|
||||
|
||||
Reference in New Issue
Block a user