| 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 #include "init_webrtc.h" | 5 #include "init_webrtc.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/logging.h" | |
| 10 #include "base/native_library.h" | 9 #include "base/native_library.h" |
| 11 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 12 #include "talk/base/basictypes.h" | 11 #include "talk/base/basictypes.h" |
| 13 | 12 |
| 14 #if defined(LIBPEERCONNECTION_LIB) | 13 #if defined(LIBPEERCONNECTION_LIB) |
| 15 | 14 |
| 16 // libpeerconnection is being compiled as a static lib. In this case | 15 // libpeerconnection is being compiled as a static lib. In this case |
| 17 // we don't need to do any initializing but to keep things simple we | 16 // we don't need to do any initializing but to keep things simple we |
| 18 // provide an empty intialization routine so that this #ifdef doesn't | 17 // provide an empty intialization routine so that this #ifdef doesn't |
| 19 // have to be in other places. | 18 // have to be in other places. |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // Initialize the proxy by supplying it with a pointer to our | 70 // Initialize the proxy by supplying it with a pointer to our |
| 72 // allocator/deallocator routines. | 71 // allocator/deallocator routines. |
| 73 // On mac we use malloc zones, which are global, so we provide NULLs for | 72 // On mac we use malloc zones, which are global, so we provide NULLs for |
| 74 // the alloc/dealloc functions. | 73 // the alloc/dealloc functions. |
| 75 // PS: This function is actually implemented in allocator_proxy.cc with the | 74 // PS: This function is actually implemented in allocator_proxy.cc with the |
| 76 // new/delete overrides. | 75 // new/delete overrides. |
| 77 return initialize_module(*CommandLine::ForCurrentProcess(), | 76 return initialize_module(*CommandLine::ForCurrentProcess(), |
| 78 #if !defined(OS_MACOSX) | 77 #if !defined(OS_MACOSX) |
| 79 &Allocate, &Dellocate, | 78 &Allocate, &Dellocate, |
| 80 #endif | 79 #endif |
| 80 logging::GetLogMessageHandler(), |
| 81 &g_create_webrtc_media_engine, &g_destroy_webrtc_media_engine); | 81 &g_create_webrtc_media_engine, &g_destroy_webrtc_media_engine); |
| 82 } | 82 } |
| 83 | 83 |
| 84 cricket::MediaEngineInterface* CreateWebRtcMediaEngine( | 84 cricket::MediaEngineInterface* CreateWebRtcMediaEngine( |
| 85 webrtc::AudioDeviceModule* adm, | 85 webrtc::AudioDeviceModule* adm, |
| 86 webrtc::AudioDeviceModule* adm_sc, | 86 webrtc::AudioDeviceModule* adm_sc, |
| 87 cricket::WebRtcVideoEncoderFactory* encoder_factory, | 87 cricket::WebRtcVideoEncoderFactory* encoder_factory, |
| 88 cricket::WebRtcVideoDecoderFactory* decoder_factory) { | 88 cricket::WebRtcVideoDecoderFactory* decoder_factory) { |
| 89 // For convenience of tests etc, we call InitializeWebRtcModule here. | 89 // For convenience of tests etc, we call InitializeWebRtcModule here. |
| 90 // For Chrome however, InitializeWebRtcModule must be called | 90 // For Chrome however, InitializeWebRtcModule must be called |
| 91 // explicitly before the sandbox is initialized. In that case, this call is | 91 // explicitly before the sandbox is initialized. In that case, this call is |
| 92 // effectively a noop. | 92 // effectively a noop. |
| 93 InitializeWebRtcModule(); | 93 InitializeWebRtcModule(); |
| 94 return g_create_webrtc_media_engine(adm, adm_sc, encoder_factory, | 94 return g_create_webrtc_media_engine(adm, adm_sc, encoder_factory, |
| 95 decoder_factory); | 95 decoder_factory); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void DestroyWebRtcMediaEngine(cricket::MediaEngineInterface* media_engine) { | 98 void DestroyWebRtcMediaEngine(cricket::MediaEngineInterface* media_engine) { |
| 99 g_destroy_webrtc_media_engine(media_engine); | 99 g_destroy_webrtc_media_engine(media_engine); |
| 100 } | 100 } |
| 101 | 101 |
| 102 #endif // LIBPEERCONNECTION_LIB | 102 #endif // LIBPEERCONNECTION_LIB |
| OLD | NEW |