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 #ifndef THIRD_PARTY_LIBJINGLE_OVERRIDES_INIT_WEBRTC_H_ | 5 #ifndef THIRD_PARTY_LIBJINGLE_OVERRIDES_INIT_WEBRTC_H_ |
6 #define THIRD_PARTY_LIBJINGLE_OVERRIDES_INIT_WEBRTC_H_ | 6 #define THIRD_PARTY_LIBJINGLE_OVERRIDES_INIT_WEBRTC_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "allocator_shim/allocator_stub.h" | 10 #include "allocator_shim/allocator_stub.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "third_party/webrtc/system_wrappers/interface/event_tracer.h" | 12 #include "third_party/webrtc/system_wrappers/interface/event_tracer.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class CommandLine; | 15 class CommandLine; |
16 } | 16 } |
17 | 17 |
18 namespace cricket { | 18 namespace cricket { |
19 class MediaEngineInterface; | 19 class MediaEngineInterface; |
20 class WebRtcVideoDecoderFactory; | 20 class WebRtcVideoDecoderFactory; |
21 class WebRtcVideoEncoderFactory; | 21 class WebRtcVideoEncoderFactory; |
22 } // namespace cricket | 22 } // namespace cricket |
23 | 23 |
24 namespace webrtc { | 24 namespace webrtc { |
25 class AudioDeviceModule; | 25 class AudioDeviceModule; |
26 class AudioProcessing; | |
27 class Config; | |
28 } // namespace webrtc | 26 } // namespace webrtc |
29 | 27 |
30 typedef std::string (*FieldTrialFindFullName)(const std::string& trial_name); | 28 typedef std::string (*FieldTrialFindFullName)(const std::string& trial_name); |
31 | 29 |
32 typedef cricket::MediaEngineInterface* (*CreateWebRtcMediaEngineFunction)( | 30 typedef cricket::MediaEngineInterface* (*CreateWebRtcMediaEngineFunction)( |
33 webrtc::AudioDeviceModule* adm, | 31 webrtc::AudioDeviceModule* adm, |
34 webrtc::AudioDeviceModule* adm_sc, | 32 webrtc::AudioDeviceModule* adm_sc, |
35 cricket::WebRtcVideoEncoderFactory* encoder_factory, | 33 cricket::WebRtcVideoEncoderFactory* encoder_factory, |
36 cricket::WebRtcVideoDecoderFactory* decoder_factory); | 34 cricket::WebRtcVideoDecoderFactory* decoder_factory); |
37 | 35 |
38 typedef void (*DestroyWebRtcMediaEngineFunction)( | 36 typedef void (*DestroyWebRtcMediaEngineFunction)( |
39 cricket::MediaEngineInterface* media_engine); | 37 cricket::MediaEngineInterface* media_engine); |
40 | 38 |
41 typedef void (*InitDiagnosticLoggingDelegateFunctionFunction)( | 39 typedef void (*InitDiagnosticLoggingDelegateFunctionFunction)( |
42 void (*DelegateFunction)(const std::string&)); | 40 void (*DelegateFunction)(const std::string&)); |
43 | 41 |
44 typedef webrtc::AudioProcessing* (*CreateWebRtcAudioProcessingFunction)( | |
45 const webrtc::Config& config); | |
46 | |
47 // A typedef for the main initialize function in libpeerconnection. | 42 // A typedef for the main initialize function in libpeerconnection. |
48 // This will initialize logging in the module with the proper arguments | 43 // This will initialize logging in the module with the proper arguments |
49 // as well as provide pointers back to a couple webrtc factory functions. | 44 // as well as provide pointers back to a couple webrtc factory functions. |
50 // The reason we get pointers to these functions this way is to avoid having | 45 // The reason we get pointers to these functions this way is to avoid having |
51 // to go through GetProcAddress et al and rely on specific name mangling. | 46 // to go through GetProcAddress et al and rely on specific name mangling. |
52 typedef bool (*InitializeModuleFunction)( | 47 typedef bool (*InitializeModuleFunction)( |
53 const base::CommandLine& command_line, | 48 const base::CommandLine& command_line, |
54 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) | 49 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
55 AllocateFunction alloc, | 50 AllocateFunction alloc, |
56 DellocateFunction dealloc, | 51 DellocateFunction dealloc, |
57 #endif | 52 #endif |
58 FieldTrialFindFullName field_trial_find, | 53 FieldTrialFindFullName field_trial_find, |
59 logging::LogMessageHandlerFunction log_handler, | 54 logging::LogMessageHandlerFunction log_handler, |
60 webrtc::GetCategoryEnabledPtr trace_get_category_enabled, | 55 webrtc::GetCategoryEnabledPtr trace_get_category_enabled, |
61 webrtc::AddTraceEventPtr trace_add_trace_event, | 56 webrtc::AddTraceEventPtr trace_add_trace_event, |
62 CreateWebRtcMediaEngineFunction* create_media_engine, | 57 CreateWebRtcMediaEngineFunction* create_media_engine, |
63 DestroyWebRtcMediaEngineFunction* destroy_media_engine, | 58 DestroyWebRtcMediaEngineFunction* destroy_media_engine, |
64 InitDiagnosticLoggingDelegateFunctionFunction* init_diagnostic_logging, | 59 InitDiagnosticLoggingDelegateFunctionFunction* init_diagnostic_logging); |
65 CreateWebRtcAudioProcessingFunction* create_audio_processing); | |
66 | 60 |
67 #if !defined(LIBPEERCONNECTION_IMPLEMENTATION) | 61 #if !defined(LIBPEERCONNECTION_IMPLEMENTATION) |
68 // Load and initialize the shared WebRTC module (libpeerconnection). | 62 // Load and initialize the shared WebRTC module (libpeerconnection). |
69 // Call this explicitly to load and initialize the WebRTC module (e.g. before | 63 // Call this explicitly to load and initialize the WebRTC module (e.g. before |
70 // initializing the sandbox in Chrome). | 64 // initializing the sandbox in Chrome). |
71 // If not called explicitly, this function will still be called from the main | 65 // If not called explicitly, this function will still be called from the main |
72 // CreateWebRtcMediaEngine factory function the first time it is called. | 66 // CreateWebRtcMediaEngine factory function the first time it is called. |
73 bool InitializeWebRtcModule(); | 67 bool InitializeWebRtcModule(); |
74 | |
75 // Return a webrtc::AudioProcessing object. | |
76 webrtc::AudioProcessing* CreateWebRtcAudioProcessing( | |
77 const webrtc::Config& config); | |
78 | |
79 #endif | 68 #endif |
80 | 69 |
81 #endif // THIRD_PARTY_LIBJINGLE_OVERRIDES_INIT_WEBRTC_H_ | 70 #endif // THIRD_PARTY_LIBJINGLE_OVERRIDES_INIT_WEBRTC_H_ |
OLD | NEW |