Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: third_party/libjingle/overrides/init_webrtc.h

Issue 663413002: Reland 597923002: Fix the way how we create webrtc::AudioProcessing in Chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed two extra empty line caused by rebasing Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/libjingle/libjingle.gyp ('k') | third_party/libjingle/overrides/init_webrtc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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;
26 namespace metrics { 28 namespace metrics {
27 class Histogram; 29 class Histogram;
28 } // namespace metrics 30 } // namespace metrics
29 } // namespace webrtc 31 } // namespace webrtc
30 32
31 typedef std::string (*FieldTrialFindFullName)(const std::string& trial_name); 33 typedef std::string (*FieldTrialFindFullName)(const std::string& trial_name);
32 34
33 typedef webrtc::metrics::Histogram* (*RtcHistogramFactoryGetCounts)( 35 typedef webrtc::metrics::Histogram* (*RtcHistogramFactoryGetCounts)(
34 const std::string& name, int min, int max, int bucket_count); 36 const std::string& name, int min, int max, int bucket_count);
35 typedef webrtc::metrics::Histogram* (*RtcHistogramFactoryGetEnumeration)( 37 typedef webrtc::metrics::Histogram* (*RtcHistogramFactoryGetEnumeration)(
36 const std::string& name, int boundary); 38 const std::string& name, int boundary);
37 typedef void (*RtcHistogramAdd)( 39 typedef void (*RtcHistogramAdd)(
38 webrtc::metrics::Histogram* histogram_pointer, 40 webrtc::metrics::Histogram* histogram_pointer,
39 const std::string& name, 41 const std::string& name,
40 int sample); 42 int sample);
41 43
42 typedef cricket::MediaEngineInterface* (*CreateWebRtcMediaEngineFunction)( 44 typedef cricket::MediaEngineInterface* (*CreateWebRtcMediaEngineFunction)(
43 webrtc::AudioDeviceModule* adm, 45 webrtc::AudioDeviceModule* adm,
44 webrtc::AudioDeviceModule* adm_sc, 46 webrtc::AudioDeviceModule* adm_sc,
45 cricket::WebRtcVideoEncoderFactory* encoder_factory, 47 cricket::WebRtcVideoEncoderFactory* encoder_factory,
46 cricket::WebRtcVideoDecoderFactory* decoder_factory); 48 cricket::WebRtcVideoDecoderFactory* decoder_factory);
47 49
48 typedef void (*DestroyWebRtcMediaEngineFunction)( 50 typedef void (*DestroyWebRtcMediaEngineFunction)(
49 cricket::MediaEngineInterface* media_engine); 51 cricket::MediaEngineInterface* media_engine);
50 52
51 typedef void (*InitDiagnosticLoggingDelegateFunctionFunction)( 53 typedef void (*InitDiagnosticLoggingDelegateFunctionFunction)(
52 void (*DelegateFunction)(const std::string&)); 54 void (*DelegateFunction)(const std::string&));
53 55
56 typedef webrtc::AudioProcessing* (*CreateWebRtcAudioProcessingFunction)(
57 const webrtc::Config& config);
58
54 // A typedef for the main initialize function in libpeerconnection. 59 // A typedef for the main initialize function in libpeerconnection.
55 // This will initialize logging in the module with the proper arguments 60 // This will initialize logging in the module with the proper arguments
56 // as well as provide pointers back to a couple webrtc factory functions. 61 // as well as provide pointers back to a couple webrtc factory functions.
57 // The reason we get pointers to these functions this way is to avoid having 62 // The reason we get pointers to these functions this way is to avoid having
58 // to go through GetProcAddress et al and rely on specific name mangling. 63 // to go through GetProcAddress et al and rely on specific name mangling.
59 // TODO(tommi): The number of functions is growing. Use a struct. 64 // TODO(tommi): The number of functions is growing. Use a struct.
60 typedef bool (*InitializeModuleFunction)( 65 typedef bool (*InitializeModuleFunction)(
61 const base::CommandLine& command_line, 66 const base::CommandLine& command_line,
62 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) 67 #if !defined(OS_MACOSX) && !defined(OS_ANDROID)
63 AllocateFunction alloc, 68 AllocateFunction alloc,
64 DellocateFunction dealloc, 69 DellocateFunction dealloc,
65 #endif 70 #endif
66 FieldTrialFindFullName field_trial_find, 71 FieldTrialFindFullName field_trial_find,
67 RtcHistogramFactoryGetCounts factory_get_counts, 72 RtcHistogramFactoryGetCounts factory_get_counts,
68 RtcHistogramFactoryGetEnumeration factory_get_enumeration, 73 RtcHistogramFactoryGetEnumeration factory_get_enumeration,
69 RtcHistogramAdd histogram_add, 74 RtcHistogramAdd histogram_add,
70 logging::LogMessageHandlerFunction log_handler, 75 logging::LogMessageHandlerFunction log_handler,
71 webrtc::GetCategoryEnabledPtr trace_get_category_enabled, 76 webrtc::GetCategoryEnabledPtr trace_get_category_enabled,
72 webrtc::AddTraceEventPtr trace_add_trace_event, 77 webrtc::AddTraceEventPtr trace_add_trace_event,
73 CreateWebRtcMediaEngineFunction* create_media_engine, 78 CreateWebRtcMediaEngineFunction* create_media_engine,
74 DestroyWebRtcMediaEngineFunction* destroy_media_engine, 79 DestroyWebRtcMediaEngineFunction* destroy_media_engine,
75 InitDiagnosticLoggingDelegateFunctionFunction* init_diagnostic_logging); 80 InitDiagnosticLoggingDelegateFunctionFunction* init_diagnostic_logging,
81 CreateWebRtcAudioProcessingFunction* create_audio_processing);
76 82
77 #if !defined(LIBPEERCONNECTION_IMPLEMENTATION) 83 #if !defined(LIBPEERCONNECTION_IMPLEMENTATION)
78 // Load and initialize the shared WebRTC module (libpeerconnection). 84 // Load and initialize the shared WebRTC module (libpeerconnection).
79 // Call this explicitly to load and initialize the WebRTC module (e.g. before 85 // Call this explicitly to load and initialize the WebRTC module (e.g. before
80 // initializing the sandbox in Chrome). 86 // initializing the sandbox in Chrome).
81 // If not called explicitly, this function will still be called from the main 87 // If not called explicitly, this function will still be called from the main
82 // CreateWebRtcMediaEngine factory function the first time it is called. 88 // CreateWebRtcMediaEngine factory function the first time it is called.
83 bool InitializeWebRtcModule(); 89 bool InitializeWebRtcModule();
90
91 // Return a webrtc::AudioProcessing object.
92 webrtc::AudioProcessing* CreateWebRtcAudioProcessing(
93 const webrtc::Config& config);
94
84 #endif 95 #endif
85 96
86 #endif // THIRD_PARTY_LIBJINGLE_OVERRIDES_INIT_WEBRTC_H_ 97 #endif // THIRD_PARTY_LIBJINGLE_OVERRIDES_INIT_WEBRTC_H_
OLDNEW
« no previous file with comments | « third_party/libjingle/libjingle.gyp ('k') | third_party/libjingle/overrides/init_webrtc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698