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