Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: content/renderer/media/media_stream_dependency_factory.cc

Issue 187913002: Support the Aec dump for the APM in chrome (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: minor fix to one comment. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/media_stream_dependency_factory.cc
diff --git a/content/renderer/media/media_stream_dependency_factory.cc b/content/renderer/media/media_stream_dependency_factory.cc
index be33d64dc5fe5744042734105fbf7b80226edfb8..d7b27938a1afba81c8db2453d7f4d9edd6c0614b 100644
--- a/content/renderer/media/media_stream_dependency_factory.cc
+++ b/content/renderer/media/media_stream_dependency_factory.cc
@@ -753,18 +753,34 @@ bool MediaStreamDependencyFactory::OnControlMessageReceived(
void MediaStreamDependencyFactory::OnAecDumpFile(
IPC::PlatformFileForTransit file_handle) {
DCHECK_EQ(aec_dump_file_, base::kInvalidPlatformFileValue);
- if (PeerConnectionFactoryCreated()) {
- base::PlatformFile file =
- IPC::PlatformFileForTransitToPlatformFile(file_handle);
- DCHECK_NE(file, base::kInvalidPlatformFileValue);
- StartAecDump(file);
- } else {
- aec_dump_file_ = IPC::PlatformFileForTransitToPlatformFile(file_handle);
- DCHECK_NE(aec_dump_file_, base::kInvalidPlatformFileValue);
+ base::PlatformFile file =
+ IPC::PlatformFileForTransitToPlatformFile(file_handle);
+ DCHECK_NE(file, base::kInvalidPlatformFileValue);
+
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableAudioTrackProcessing)) {
+ EnsureWebRtcAudioDeviceImpl();
+ GetWebRtcAudioDevice()->EnableAecDump(file);
+ return;
}
+
+ // TODO(xians): Remove the following code after kEnableAudioTrackProcessing
+ // is removed.
+ if (PeerConnectionFactoryCreated())
+ StartAecDump(file);
+ else
+ aec_dump_file_ = file;
}
void MediaStreamDependencyFactory::OnDisableAecDump() {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableAudioTrackProcessing)) {
+ GetWebRtcAudioDevice()->DisableAecDump();
+ return;
+ }
+
+ // TODO(xians): Remove the following code after kEnableAudioTrackProcessing
+ // is removed.
if (aec_dump_file_ != base::kInvalidPlatformFileValue)
base::ClosePlatformFile(aec_dump_file_);
aec_dump_file_ = base::kInvalidPlatformFileValue;
« no previous file with comments | « content/renderer/media/media_stream_audio_processor_unittest.cc ('k') | content/renderer/media/webrtc_audio_capturer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698