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