OLD | NEW |
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
" | |
12 #include "webrtc/base/basictypes.h" | 11 #include "webrtc/base/basictypes.h" |
13 #include "webrtc/base/logging.h" | 12 #include "webrtc/base/logging.h" |
14 | 13 |
15 #if !defined(LIBPEERCONNECTION_IMPLEMENTATION) || defined(LIBPEERCONNECTION_LIB) | 14 #if !defined(LIBPEERCONNECTION_IMPLEMENTATION) || defined(LIBPEERCONNECTION_LIB) |
16 #error "Only compile the allocator proxy with the shared_library implementation" | 15 #error "Only compile the allocator proxy with the shared_library implementation" |
17 #endif | 16 #endif |
18 | 17 |
19 #if defined(OS_WIN) | 18 #if defined(OS_WIN) |
20 #define ALLOC_EXPORT __declspec(dllexport) | 19 #define ALLOC_EXPORT __declspec(dllexport) |
21 #else | 20 #else |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 FieldTrialFindFullName field_trial_find, | 91 FieldTrialFindFullName field_trial_find, |
93 RtcHistogramFactoryGetCounts factory_get_counts, | 92 RtcHistogramFactoryGetCounts factory_get_counts, |
94 RtcHistogramFactoryGetEnumeration factory_get_enumeration, | 93 RtcHistogramFactoryGetEnumeration factory_get_enumeration, |
95 RtcHistogramAdd histogram_add, | 94 RtcHistogramAdd histogram_add, |
96 logging::LogMessageHandlerFunction log_handler, | 95 logging::LogMessageHandlerFunction log_handler, |
97 webrtc::GetCategoryEnabledPtr trace_get_category_enabled, | 96 webrtc::GetCategoryEnabledPtr trace_get_category_enabled, |
98 webrtc::AddTraceEventPtr trace_add_trace_event, | 97 webrtc::AddTraceEventPtr trace_add_trace_event, |
99 CreateWebRtcMediaEngineFunction* create_media_engine, | 98 CreateWebRtcMediaEngineFunction* create_media_engine, |
100 DestroyWebRtcMediaEngineFunction* destroy_media_engine, | 99 DestroyWebRtcMediaEngineFunction* destroy_media_engine, |
101 InitDiagnosticLoggingDelegateFunctionFunction* | 100 InitDiagnosticLoggingDelegateFunctionFunction* |
102 init_diagnostic_logging, | 101 init_diagnostic_logging) { |
103 CreateWebRtcAudioProcessingFunction* | |
104 create_audio_processing) { | |
105 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) | 102 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
106 g_alloc = alloc; | 103 g_alloc = alloc; |
107 g_dealloc = dealloc; | 104 g_dealloc = dealloc; |
108 #endif | 105 #endif |
109 | 106 |
110 g_field_trial_find_ = field_trial_find; | 107 g_field_trial_find_ = field_trial_find; |
111 g_factory_get_counts = factory_get_counts; | 108 g_factory_get_counts = factory_get_counts; |
112 g_factory_get_enumeration = factory_get_enumeration; | 109 g_factory_get_enumeration = factory_get_enumeration; |
113 g_histogram_add = histogram_add; | 110 g_histogram_add = histogram_add; |
114 | 111 |
115 *create_media_engine = &CreateWebRtcMediaEngine; | 112 *create_media_engine = &CreateWebRtcMediaEngine; |
116 *destroy_media_engine = &DestroyWebRtcMediaEngine; | 113 *destroy_media_engine = &DestroyWebRtcMediaEngine; |
117 *init_diagnostic_logging = &rtc::InitDiagnosticLoggingDelegateFunction; | 114 *init_diagnostic_logging = &rtc::InitDiagnosticLoggingDelegateFunction; |
118 *create_audio_processing = &webrtc::AudioProcessing::Create; | |
119 | 115 |
120 if (CommandLine::Init(0, NULL)) { | 116 if (CommandLine::Init(0, NULL)) { |
121 #if !defined(OS_WIN) | 117 #if !defined(OS_WIN) |
122 // This is not needed on Windows since CommandLine::Init has already | 118 // This is not needed on Windows since CommandLine::Init has already |
123 // done the equivalent thing via the GetCommandLine() API. | 119 // done the equivalent thing via the GetCommandLine() API. |
124 CommandLine::ForCurrentProcess()->AppendArguments(command_line, true); | 120 CommandLine::ForCurrentProcess()->AppendArguments(command_line, true); |
125 #endif | 121 #endif |
126 logging::LoggingSettings settings; | 122 logging::LoggingSettings settings; |
127 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 123 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
128 logging::InitLogging(settings); | 124 logging::InitLogging(settings); |
129 | 125 |
130 // Override the log message handler to forward logs to chrome's handler. | 126 // Override the log message handler to forward logs to chrome's handler. |
131 logging::SetLogMessageHandler(log_handler); | 127 logging::SetLogMessageHandler(log_handler); |
132 webrtc::SetupEventTracer(trace_get_category_enabled, | 128 webrtc::SetupEventTracer(trace_get_category_enabled, |
133 trace_add_trace_event); | 129 trace_add_trace_event); |
134 } | 130 } |
135 | 131 |
136 return true; | 132 return true; |
137 } | 133 } |
138 } // extern "C" | 134 } // extern "C" |
OLD | NEW |