Skip to content

Commit e78feb7

Browse files
author
xians
committed
Revert "Merge 663413002 to M39:"
This reverts commit 255ee24. [email protected] Revert of Reland 597923002: Fix the way how we create webrtc::AudioProcessing in Chrome (patchset #4 id:60001 of https://codereview.chromium.org/663413002/) Reason for revert: This CL broke the configuration of AudioProcessing, we have to revert it to fix the echo issues it introduces. Original issue's description: > Reland 597923002: Fix the way how we create webrtc::AudioProcessing in Chrome. > > The original review thread is in https://codereview.chromium.org/588523002/ > > Fix the way how we create webrtc::AudioProcessing in Chrome. > > [email protected],[email protected] > > BUG=415935 > TEST=all webrtc tests in all bots + manual test to verify the agc loggings exist. Review URL: https://codereview.chromium.org/730563002 Cr-Commit-Position: refs/branch-heads/2171@{#419} Cr-Branched-From: 267aeeb-refs/heads/master@{#297060}
1 parent e821cb3 commit e78feb7

File tree

10 files changed

+13
-74
lines changed

10 files changed

+13
-74
lines changed

build/android/pylib/gtest/setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ def _GenerateDepsDirUsingIsolate(suite_name, isolate_file_path=None):
118118
'--config-variable', 'component', 'static_library',
119119
'--config-variable', 'fastbuild', '0',
120120
'--config-variable', 'icu_use_data_file_flag', '1',
121-
'--config-variable', 'libpeer_target_type', 'static_library',
122121
# TODO(maruel): This may not be always true.
123122
'--config-variable', 'target_arch', 'arm',
124123
'--config-variable', 'use_openssl', '0',

content/content_tests.gypi

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -838,21 +838,6 @@
838838
'../third_party/webrtc/modules/modules.gyp:desktop_capture',
839839
],
840840
}],
841-
['enable_webrtc==1 and OS=="mac"', {
842-
'variables': {
843-
'libpeer_target_type%': 'static_library',
844-
},
845-
'conditions': [
846-
['libpeer_target_type!="static_library"', {
847-
'copies': [{
848-
'destination': '<(PRODUCT_DIR)/Libraries',
849-
'files': [
850-
'<(PRODUCT_DIR)/libpeerconnection.so',
851-
],
852-
}],
853-
}],
854-
],
855-
}],
856841
['enable_webrtc==1 and chromeos==1', {
857842
'sources': [
858843
'browser/media/capture/desktop_capture_device_aura_unittest.cc',

content/content_unittests.isolate

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,6 @@
5656
],
5757
},
5858
}],
59-
['OS=="linux" and libpeer_target_type=="loadable_module"', {
60-
'variables': {
61-
'isolate_dependency_tracked': [
62-
'<(PRODUCT_DIR)/lib/libpeerconnection.so',
63-
],
64-
},
65-
}],
6659
['OS=="mac"', {
6760
'variables': {
6861
'command': [
@@ -98,13 +91,6 @@
9891
],
9992
},
10093
}],
101-
['OS=="win" and libpeer_target_type=="loadable_module"', {
102-
'variables': {
103-
'isolate_dependency_tracked': [
104-
'<(PRODUCT_DIR)/libpeerconnection.dll',
105-
],
106-
},
107-
}],
10894
],
10995
'includes': [
11096
'../base/base.isolate',

content/renderer/media/media_stream_audio_processor.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "media/base/audio_fifo.h"
2020
#include "media/base/channel_layout.h"
2121
#include "third_party/WebKit/public/platform/WebMediaConstraints.h"
22-
#include "third_party/libjingle/overrides/init_webrtc.h"
2322
#include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface.h"
2423
#include "third_party/webrtc/modules/audio_processing/typing_detection.h"
2524

@@ -424,7 +423,7 @@ void MediaStreamAudioProcessor::InitializeAudioProcessingModule(
424423
#endif
425424

426425
// Create and configure the webrtc::AudioProcessing.
427-
audio_processing_.reset(CreateWebRtcAudioProcessing(config));
426+
audio_processing_.reset(webrtc::AudioProcessing::Create(config));
428427

429428
// Enable the audio processing components.
430429
if (echo_cancellation) {

content/renderer/media/media_stream_audio_processor_options.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,15 @@ void EnableTypingDetection(AudioProcessing* audio_processing,
251251
void StartEchoCancellationDump(AudioProcessing* audio_processing,
252252
base::File aec_dump_file) {
253253
DCHECK(aec_dump_file.IsValid());
254-
if (audio_processing->StartDebugRecordingForPlatformFile(
255-
aec_dump_file.TakePlatformFile())) {
256-
DLOG(ERROR) << "Fail to start AEC debug recording";
254+
255+
FILE* stream = base::FileToFILE(aec_dump_file.Pass(), "w");
256+
if (!stream) {
257+
LOG(ERROR) << "Failed to open AEC dump file";
258+
return;
257259
}
260+
261+
if (audio_processing->StartDebugRecording(stream))
262+
DLOG(ERROR) << "Fail to start AEC debug recording";
258263
}
259264

260265
void StopEchoCancellationDump(AudioProcessing* audio_processing) {

third_party/libjingle/BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,6 @@ if (enable_webrtc) {
548548
deps = [
549549
":libjingle_webrtc_common",
550550
"//third_party/webrtc",
551-
"//third_party/webrtc/modules/audio_processing",
552551
"//third_party/webrtc/system_wrappers",
553552
"//third_party/webrtc/voice_engine",
554553
]

third_party/libjingle/libjingle.gyp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,6 @@
589589
'<(libjingle_source)/talk/media/webrtc/webrtcvoiceengine.h',
590590
],
591591
'dependencies': [
592-
'<(DEPTH)/third_party/webrtc/modules/modules.gyp:audio_processing',
593592
'<(DEPTH)/third_party/webrtc/system_wrappers/source/system_wrappers.gyp:system_wrappers',
594593
'<(DEPTH)/third_party/webrtc/voice_engine/voice_engine.gyp:voice_engine',
595594
'<(DEPTH)/third_party/webrtc/webrtc.gyp:webrtc',

third_party/libjingle/overrides/init_webrtc.cc

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
#include "base/metrics/field_trial.h"
1212
#include "base/native_library.h"
1313
#include "base/path_service.h"
14-
#include "third_party/webrtc/common.h"
15-
#include "third_party/webrtc/modules/audio_processing/include/audio_processing.h"
1614
#include "webrtc/base/basictypes.h"
1715
#include "webrtc/base/logging.h"
1816

@@ -55,13 +53,6 @@ bool InitializeWebRtcModule() {
5553
return true;
5654
}
5755

58-
webrtc::AudioProcessing* CreateWebRtcAudioProcessing(
59-
const webrtc::Config& config) {
60-
// libpeerconnection is being compiled as a static lib, use
61-
// webrtc::AudioProcessing directly.
62-
return webrtc::AudioProcessing::Create(config);
63-
}
64-
6556
#else // !LIBPEERCONNECTION_LIB
6657

6758
// When being compiled as a shared library, we need to bridge the gap between
@@ -71,7 +62,6 @@ webrtc::AudioProcessing* CreateWebRtcAudioProcessing(
7162
// Global function pointers to the factory functions in the shared library.
7263
CreateWebRtcMediaEngineFunction g_create_webrtc_media_engine = NULL;
7364
DestroyWebRtcMediaEngineFunction g_destroy_webrtc_media_engine = NULL;
74-
CreateWebRtcAudioProcessingFunction g_create_webrtc_audio_processing = NULL;
7565

7666
// Returns the full or relative path to the libpeerconnection module depending
7767
// on what platform we're on.
@@ -145,8 +135,8 @@ bool InitializeWebRtcModule() {
145135
&AddTraceEvent,
146136
&g_create_webrtc_media_engine,
147137
&g_destroy_webrtc_media_engine,
148-
&init_diagnostic_logging,
149-
&g_create_webrtc_audio_processing);
138+
&init_diagnostic_logging);
139+
150140
if (init_ok)
151141
rtc::SetExtraLoggingInit(init_diagnostic_logging);
152142
return init_ok;
@@ -170,12 +160,4 @@ void DestroyWebRtcMediaEngine(cricket::MediaEngineInterface* media_engine) {
170160
g_destroy_webrtc_media_engine(media_engine);
171161
}
172162

173-
webrtc::AudioProcessing* CreateWebRtcAudioProcessing(
174-
const webrtc::Config& config) {
175-
// The same as CreateWebRtcMediaEngine(), we call InitializeWebRtcModule here
176-
// for convenience of tests.
177-
InitializeWebRtcModule();
178-
return g_create_webrtc_audio_processing(config);
179-
}
180-
181163
#endif // LIBPEERCONNECTION_LIB

third_party/libjingle/overrides/init_webrtc.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ class WebRtcVideoEncoderFactory;
2323

2424
namespace webrtc {
2525
class AudioDeviceModule;
26-
class AudioProcessing;
27-
class Config;
2826
} // namespace webrtc
2927

3028
typedef std::string (*FieldTrialFindFullName)(const std::string& trial_name);
@@ -41,9 +39,6 @@ typedef void (*DestroyWebRtcMediaEngineFunction)(
4139
typedef void (*InitDiagnosticLoggingDelegateFunctionFunction)(
4240
void (*DelegateFunction)(const std::string&));
4341

44-
typedef webrtc::AudioProcessing* (*CreateWebRtcAudioProcessingFunction)(
45-
const webrtc::Config& config);
46-
4742
// A typedef for the main initialize function in libpeerconnection.
4843
// This will initialize logging in the module with the proper arguments
4944
// as well as provide pointers back to a couple webrtc factory functions.
@@ -61,8 +56,7 @@ typedef bool (*InitializeModuleFunction)(
6156
webrtc::AddTraceEventPtr trace_add_trace_event,
6257
CreateWebRtcMediaEngineFunction* create_media_engine,
6358
DestroyWebRtcMediaEngineFunction* destroy_media_engine,
64-
InitDiagnosticLoggingDelegateFunctionFunction* init_diagnostic_logging,
65-
CreateWebRtcAudioProcessingFunction* create_audio_processing);
59+
InitDiagnosticLoggingDelegateFunctionFunction* init_diagnostic_logging);
6660

6761
#if !defined(LIBPEERCONNECTION_IMPLEMENTATION)
6862
// Load and initialize the shared WebRTC module (libpeerconnection).
@@ -71,11 +65,6 @@ typedef bool (*InitializeModuleFunction)(
7165
// If not called explicitly, this function will still be called from the main
7266
// CreateWebRtcMediaEngine factory function the first time it is called.
7367
bool InitializeWebRtcModule();
74-
75-
// Return a webrtc::AudioProcessing object.
76-
webrtc::AudioProcessing* CreateWebRtcAudioProcessing(
77-
const webrtc::Config& config);
78-
7968
#endif
8069

8170
#endif // THIRD_PARTY_LIBJINGLE_OVERRIDES_INIT_WEBRTC_H_

third_party/libjingle/overrides/initialize_module.cc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "base/logging.h"
99
#include "init_webrtc.h"
1010
#include "talk/media/webrtc/webrtcmediaengine.h"
11-
#include "third_party/webrtc/modules/audio_processing/include/audio_processing.h"
1211
#include "webrtc/base/basictypes.h"
1312
#include "webrtc/base/logging.h"
1413

@@ -72,9 +71,7 @@ bool InitializeModule(const CommandLine& command_line,
7271
CreateWebRtcMediaEngineFunction* create_media_engine,
7372
DestroyWebRtcMediaEngineFunction* destroy_media_engine,
7473
InitDiagnosticLoggingDelegateFunctionFunction*
75-
init_diagnostic_logging,
76-
CreateWebRtcAudioProcessingFunction*
77-
create_audio_processing) {
74+
init_diagnostic_logging) {
7875
#if !defined(OS_MACOSX) && !defined(OS_ANDROID)
7976
g_alloc = alloc;
8077
g_dealloc = dealloc;
@@ -85,7 +82,6 @@ bool InitializeModule(const CommandLine& command_line,
8582
*create_media_engine = &CreateWebRtcMediaEngine;
8683
*destroy_media_engine = &DestroyWebRtcMediaEngine;
8784
*init_diagnostic_logging = &rtc::InitDiagnosticLoggingDelegateFunction;
88-
*create_audio_processing = &webrtc::AudioProcessing::Create;
8985

9086
if (CommandLine::Init(0, NULL)) {
9187
#if !defined(OS_WIN)

0 commit comments

Comments
 (0)