1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_LIBJINGLE_OVERRIDES_INIT_WEBRTC_H_
#define THIRD_PARTY_LIBJINGLE_OVERRIDES_INIT_WEBRTC_H_
#include <string>
#include "allocator_shim/allocator_stub.h"
#include "base/logging.h"
#include "third_party/webrtc/system_wrappers/interface/event_tracer.h"
namespace base {
class CommandLine;
}
namespace cricket {
class MediaEngineInterface;
class WebRtcVideoDecoderFactory;
class WebRtcVideoEncoderFactory;
} // namespace cricket
namespace webrtc {
class AudioDeviceModule;
class AudioProcessing;
class Config;
namespace metrics {
class Histogram;
} // namespace metrics
} // namespace webrtc
typedef std::string (*FieldTrialFindFullName)(const std::string& trial_name);
typedef webrtc::metrics::Histogram* (*RtcHistogramFactoryGetCounts)(
const std::string& name, int min, int max, int bucket_count);
typedef webrtc::metrics::Histogram* (*RtcHistogramFactoryGetEnumeration)(
const std::string& name, int boundary);
typedef void (*RtcHistogramAdd)(
webrtc::metrics::Histogram* histogram_pointer,
const std::string& name,
int sample);
typedef cricket::MediaEngineInterface* (*CreateWebRtcMediaEngineFunction)(
webrtc::AudioDeviceModule* adm,
webrtc::AudioDeviceModule* adm_sc,
cricket::WebRtcVideoEncoderFactory* encoder_factory,
cricket::WebRtcVideoDecoderFactory* decoder_factory);
typedef void (*DestroyWebRtcMediaEngineFunction)(
cricket::MediaEngineInterface* media_engine);
typedef void (*InitDiagnosticLoggingDelegateFunctionFunction)(
void (*DelegateFunction)(const std::string&));
typedef webrtc::AudioProcessing* (*CreateWebRtcAudioProcessingFunction)(
const webrtc::Config& config);
// A typedef for the main initialize function in libpeerconnection.
// This will initialize logging in the module with the proper arguments
// as well as provide pointers back to a couple webrtc factory functions.
// The reason we get pointers to these functions this way is to avoid having
// to go through GetProcAddress et al and rely on specific name mangling.
// TODO(tommi): The number of functions is growing. Use a struct.
typedef bool (*InitializeModuleFunction)(
const base::CommandLine& command_line,
#if !defined(OS_MACOSX) && !defined(OS_ANDROID)
AllocateFunction alloc,
DellocateFunction dealloc,
#endif
FieldTrialFindFullName field_trial_find,
RtcHistogramFactoryGetCounts factory_get_counts,
RtcHistogramFactoryGetEnumeration factory_get_enumeration,
RtcHistogramAdd histogram_add,
logging::LogMessageHandlerFunction log_handler,
webrtc::GetCategoryEnabledPtr trace_get_category_enabled,
webrtc::AddTraceEventPtr trace_add_trace_event,
CreateWebRtcMediaEngineFunction* create_media_engine,
DestroyWebRtcMediaEngineFunction* destroy_media_engine,
InitDiagnosticLoggingDelegateFunctionFunction* init_diagnostic_logging,
CreateWebRtcAudioProcessingFunction* create_audio_processing);
#if !defined(LIBPEERCONNECTION_IMPLEMENTATION)
// Load and initialize the shared WebRTC module (libpeerconnection).
// Call this explicitly to load and initialize the WebRTC module (e.g. before
// initializing the sandbox in Chrome).
// If not called explicitly, this function will still be called from the main
// CreateWebRtcMediaEngine factory function the first time it is called.
bool InitializeWebRtcModule();
// Return a webrtc::AudioProcessing object.
webrtc::AudioProcessing* CreateWebRtcAudioProcessing(
const webrtc::Config& config);
#endif
#endif // THIRD_PARTY_LIBJINGLE_OVERRIDES_INIT_WEBRTC_H_
|