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 namespace metrics { | |
27 class Histogram; | |
28 } // namespace metrics | |
26 } // namespace webrtc | 29 } // namespace webrtc |
27 | 30 |
28 typedef std::string (*FieldTrialFindFullName)(const std::string& trial_name); | 31 typedef std::string (*FieldTrialFindFullName)(const std::string& trial_name); |
29 | 32 |
33 typedef webrtc::metrics::Histogram* (*RtcHistogramFactoryGetCounts)( | |
34 const std::string& name, int min, int max, int bucket_count); | |
35 typedef webrtc::metrics::Histogram* (*RtcHistogramFactoryGetEnumeration)( | |
36 const std::string& name, int boundary); | |
37 typedef void (*RtcHistogramAdd)( | |
38 webrtc::metrics::Histogram* histogram_pointer, | |
39 const std::string& name, | |
40 int sample); | |
41 | |
30 typedef cricket::MediaEngineInterface* (*CreateWebRtcMediaEngineFunction)( | 42 typedef cricket::MediaEngineInterface* (*CreateWebRtcMediaEngineFunction)( |
31 webrtc::AudioDeviceModule* adm, | 43 webrtc::AudioDeviceModule* adm, |
32 webrtc::AudioDeviceModule* adm_sc, | 44 webrtc::AudioDeviceModule* adm_sc, |
33 cricket::WebRtcVideoEncoderFactory* encoder_factory, | 45 cricket::WebRtcVideoEncoderFactory* encoder_factory, |
34 cricket::WebRtcVideoDecoderFactory* decoder_factory); | 46 cricket::WebRtcVideoDecoderFactory* decoder_factory); |
35 | 47 |
36 typedef void (*DestroyWebRtcMediaEngineFunction)( | 48 typedef void (*DestroyWebRtcMediaEngineFunction)( |
37 cricket::MediaEngineInterface* media_engine); | 49 cricket::MediaEngineInterface* media_engine); |
38 | 50 |
39 typedef void (*InitDiagnosticLoggingDelegateFunctionFunction)( | 51 typedef void (*InitDiagnosticLoggingDelegateFunctionFunction)( |
40 void (*DelegateFunction)(const std::string&)); | 52 void (*DelegateFunction)(const std::string&)); |
41 | 53 |
42 // A typedef for the main initialize function in libpeerconnection. | 54 // A typedef for the main initialize function in libpeerconnection. |
43 // This will initialize logging in the module with the proper arguments | 55 // This will initialize logging in the module with the proper arguments |
44 // as well as provide pointers back to a couple webrtc factory functions. | 56 // as well as provide pointers back to a couple webrtc factory functions. |
45 // The reason we get pointers to these functions this way is to avoid having | 57 // The reason we get pointers to these functions this way is to avoid having |
46 // to go through GetProcAddress et al and rely on specific name mangling. | 58 // to go through GetProcAddress et al and rely on specific name mangling. |
47 typedef bool (*InitializeModuleFunction)( | 59 typedef bool (*InitializeModuleFunction)( |
tommi (sloooow) - chröme
2014/10/20 09:54:32
Can you add a TODO here for me to use a struct for
asapersson2
2014/10/21 09:57:30
Done.
| |
48 const base::CommandLine& command_line, | 60 const base::CommandLine& command_line, |
49 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) | 61 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
50 AllocateFunction alloc, | 62 AllocateFunction alloc, |
51 DellocateFunction dealloc, | 63 DellocateFunction dealloc, |
52 #endif | 64 #endif |
53 FieldTrialFindFullName field_trial_find, | 65 FieldTrialFindFullName field_trial_find, |
66 RtcHistogramFactoryGetCounts factory_get_counts, | |
67 RtcHistogramFactoryGetEnumeration factory_get_enumeration, | |
68 RtcHistogramAdd histogram_add, | |
54 logging::LogMessageHandlerFunction log_handler, | 69 logging::LogMessageHandlerFunction log_handler, |
55 webrtc::GetCategoryEnabledPtr trace_get_category_enabled, | 70 webrtc::GetCategoryEnabledPtr trace_get_category_enabled, |
56 webrtc::AddTraceEventPtr trace_add_trace_event, | 71 webrtc::AddTraceEventPtr trace_add_trace_event, |
57 CreateWebRtcMediaEngineFunction* create_media_engine, | 72 CreateWebRtcMediaEngineFunction* create_media_engine, |
58 DestroyWebRtcMediaEngineFunction* destroy_media_engine, | 73 DestroyWebRtcMediaEngineFunction* destroy_media_engine, |
59 InitDiagnosticLoggingDelegateFunctionFunction* init_diagnostic_logging); | 74 InitDiagnosticLoggingDelegateFunctionFunction* init_diagnostic_logging); |
60 | 75 |
61 #if !defined(LIBPEERCONNECTION_IMPLEMENTATION) | 76 #if !defined(LIBPEERCONNECTION_IMPLEMENTATION) |
62 // Load and initialize the shared WebRTC module (libpeerconnection). | 77 // Load and initialize the shared WebRTC module (libpeerconnection). |
63 // Call this explicitly to load and initialize the WebRTC module (e.g. before | 78 // Call this explicitly to load and initialize the WebRTC module (e.g. before |
64 // initializing the sandbox in Chrome). | 79 // initializing the sandbox in Chrome). |
65 // If not called explicitly, this function will still be called from the main | 80 // If not called explicitly, this function will still be called from the main |
66 // CreateWebRtcMediaEngine factory function the first time it is called. | 81 // CreateWebRtcMediaEngine factory function the first time it is called. |
67 bool InitializeWebRtcModule(); | 82 bool InitializeWebRtcModule(); |
68 #endif | 83 #endif |
69 | 84 |
70 #endif // THIRD_PARTY_LIBJINGLE_OVERRIDES_INIT_WEBRTC_H_ | 85 #endif // THIRD_PARTY_LIBJINGLE_OVERRIDES_INIT_WEBRTC_H_ |
OLD | NEW |