This source file includes following definitions.
- InitializeModule
#include "allocator_shim/allocator_stub.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "init_webrtc.h"
#include "talk/base/basictypes.h"
#include "talk/media/webrtc/webrtcmediaengine.h"
#include "third_party/libjingle/overrides/talk/base/logging.h"
#if !defined(LIBPEERCONNECTION_IMPLEMENTATION) || defined(LIBPEERCONNECTION_LIB)
#error "Only compile the allocator proxy with the shared_library implementation"
#endif
#if defined(OS_WIN)
#define ALLOC_EXPORT __declspec(dllexport)
#else
#define ALLOC_EXPORT __attribute__((visibility("default")))
#endif
#if !defined(OS_MACOSX) && !defined(OS_ANDROID)
AllocateFunction g_alloc = NULL;
DellocateFunction g_dealloc = NULL;
#endif
cricket::MediaEngineInterface* CreateWebRtcMediaEngine(
webrtc::AudioDeviceModule* adm,
webrtc::AudioDeviceModule* adm_sc,
cricket::WebRtcVideoEncoderFactory* encoder_factory,
cricket::WebRtcVideoDecoderFactory* decoder_factory);
void DestroyWebRtcMediaEngine(cricket::MediaEngineInterface* media_engine);
extern "C" {
ALLOC_EXPORT
bool InitializeModule(const CommandLine& command_line,
#if !defined(OS_MACOSX) && !defined(OS_ANDROID)
AllocateFunction alloc,
DellocateFunction dealloc,
#endif
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) {
#if !defined(OS_MACOSX) && !defined(OS_ANDROID)
g_alloc = alloc;
g_dealloc = dealloc;
#endif
*create_media_engine = &CreateWebRtcMediaEngine;
*destroy_media_engine = &DestroyWebRtcMediaEngine;
*init_diagnostic_logging = &talk_base::InitDiagnosticLoggingDelegateFunction;
if (CommandLine::Init(0, NULL)) {
#if !defined(OS_WIN)
CommandLine::ForCurrentProcess()->AppendArguments(command_line, true);
#endif
logging::LoggingSettings settings;
settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
logging::InitLogging(settings);
logging::SetLogMessageHandler(log_handler);
webrtc::SetupEventTracer(trace_get_category_enabled,
trace_add_trace_event);
}
return true;
}
}