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