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

Side by Side Diff: third_party/libjingle/overrides/initialize_module.cc

Issue 663413002: Reland 597923002: Fix the way how we create webrtc::AudioProcessing in Chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed two extra empty line caused by rebasing Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « third_party/libjingle/overrides/init_webrtc.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "allocator_shim/allocator_stub.h" 5 #include "allocator_shim/allocator_stub.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "init_webrtc.h" 9 #include "init_webrtc.h"
10 #include "talk/media/webrtc/webrtcmediaengine.h" 10 #include "talk/media/webrtc/webrtcmediaengine.h"
11 #include "third_party/webrtc/modules/audio_processing/include/audio_processing.h "
11 #include "webrtc/base/basictypes.h" 12 #include "webrtc/base/basictypes.h"
12 #include "webrtc/base/logging.h" 13 #include "webrtc/base/logging.h"
13 14
14 #if !defined(LIBPEERCONNECTION_IMPLEMENTATION) || defined(LIBPEERCONNECTION_LIB) 15 #if !defined(LIBPEERCONNECTION_IMPLEMENTATION) || defined(LIBPEERCONNECTION_LIB)
15 #error "Only compile the allocator proxy with the shared_library implementation" 16 #error "Only compile the allocator proxy with the shared_library implementation"
16 #endif 17 #endif
17 18
18 #if defined(OS_WIN) 19 #if defined(OS_WIN)
19 #define ALLOC_EXPORT __declspec(dllexport) 20 #define ALLOC_EXPORT __declspec(dllexport)
20 #else 21 #else
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 FieldTrialFindFullName field_trial_find, 92 FieldTrialFindFullName field_trial_find,
92 RtcHistogramFactoryGetCounts factory_get_counts, 93 RtcHistogramFactoryGetCounts factory_get_counts,
93 RtcHistogramFactoryGetEnumeration factory_get_enumeration, 94 RtcHistogramFactoryGetEnumeration factory_get_enumeration,
94 RtcHistogramAdd histogram_add, 95 RtcHistogramAdd histogram_add,
95 logging::LogMessageHandlerFunction log_handler, 96 logging::LogMessageHandlerFunction log_handler,
96 webrtc::GetCategoryEnabledPtr trace_get_category_enabled, 97 webrtc::GetCategoryEnabledPtr trace_get_category_enabled,
97 webrtc::AddTraceEventPtr trace_add_trace_event, 98 webrtc::AddTraceEventPtr trace_add_trace_event,
98 CreateWebRtcMediaEngineFunction* create_media_engine, 99 CreateWebRtcMediaEngineFunction* create_media_engine,
99 DestroyWebRtcMediaEngineFunction* destroy_media_engine, 100 DestroyWebRtcMediaEngineFunction* destroy_media_engine,
100 InitDiagnosticLoggingDelegateFunctionFunction* 101 InitDiagnosticLoggingDelegateFunctionFunction*
101 init_diagnostic_logging) { 102 init_diagnostic_logging,
103 CreateWebRtcAudioProcessingFunction*
104 create_audio_processing) {
102 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) 105 #if !defined(OS_MACOSX) && !defined(OS_ANDROID)
103 g_alloc = alloc; 106 g_alloc = alloc;
104 g_dealloc = dealloc; 107 g_dealloc = dealloc;
105 #endif 108 #endif
106 109
107 g_field_trial_find_ = field_trial_find; 110 g_field_trial_find_ = field_trial_find;
108 g_factory_get_counts = factory_get_counts; 111 g_factory_get_counts = factory_get_counts;
109 g_factory_get_enumeration = factory_get_enumeration; 112 g_factory_get_enumeration = factory_get_enumeration;
110 g_histogram_add = histogram_add; 113 g_histogram_add = histogram_add;
111 114
112 *create_media_engine = &CreateWebRtcMediaEngine; 115 *create_media_engine = &CreateWebRtcMediaEngine;
113 *destroy_media_engine = &DestroyWebRtcMediaEngine; 116 *destroy_media_engine = &DestroyWebRtcMediaEngine;
114 *init_diagnostic_logging = &rtc::InitDiagnosticLoggingDelegateFunction; 117 *init_diagnostic_logging = &rtc::InitDiagnosticLoggingDelegateFunction;
118 *create_audio_processing = &webrtc::AudioProcessing::Create;
115 119
116 if (CommandLine::Init(0, NULL)) { 120 if (CommandLine::Init(0, NULL)) {
117 #if !defined(OS_WIN) 121 #if !defined(OS_WIN)
118 // This is not needed on Windows since CommandLine::Init has already 122 // This is not needed on Windows since CommandLine::Init has already
119 // done the equivalent thing via the GetCommandLine() API. 123 // done the equivalent thing via the GetCommandLine() API.
120 CommandLine::ForCurrentProcess()->AppendArguments(command_line, true); 124 CommandLine::ForCurrentProcess()->AppendArguments(command_line, true);
121 #endif 125 #endif
122 logging::LoggingSettings settings; 126 logging::LoggingSettings settings;
123 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; 127 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
124 logging::InitLogging(settings); 128 logging::InitLogging(settings);
125 129
126 // Override the log message handler to forward logs to chrome's handler. 130 // Override the log message handler to forward logs to chrome's handler.
127 logging::SetLogMessageHandler(log_handler); 131 logging::SetLogMessageHandler(log_handler);
128 webrtc::SetupEventTracer(trace_get_category_enabled, 132 webrtc::SetupEventTracer(trace_get_category_enabled,
129 trace_add_trace_event); 133 trace_add_trace_event);
130 } 134 }
131 135
132 return true; 136 return true;
133 } 137 }
134 } // extern "C" 138 } // extern "C"
OLDNEW
« no previous file with comments | « third_party/libjingle/overrides/init_webrtc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698