Wiring down config from video engine until video coding and remote bitrate estimator modules instantiation.

R=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1450008

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4007 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
andresp@webrtc.org 2013-05-13 10:50:50 +00:00
parent 7a5615bc84
commit 7707d060bb
20 changed files with 107 additions and 56 deletions

View File

@ -10,15 +10,16 @@
// This file includes unit tests for EncoderStateFeedback. // This file includes unit tests for EncoderStateFeedback.
#include "video_engine/encoder_state_feedback.h" #include "webrtc/video_engine/encoder_state_feedback.h"
#include <gmock/gmock.h> #include <gmock/gmock.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "modules/rtp_rtcp/interface/rtp_rtcp_defines.h" #include "webrtc/common.h"
#include "modules/utility/interface/process_thread.h" #include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h"
#include "system_wrappers/interface/scoped_ptr.h" #include "webrtc/modules/utility/interface/process_thread.h"
#include "video_engine/vie_encoder.h" #include "webrtc/system_wrappers/interface/scoped_ptr.h"
#include "webrtc/video_engine/vie_encoder.h"
namespace webrtc { namespace webrtc {
@ -36,7 +37,7 @@ class TestProcessThread : public ProcessThread {
class MockVieEncoder : public ViEEncoder { class MockVieEncoder : public ViEEncoder {
public: public:
explicit MockVieEncoder(TestProcessThread* process_thread) explicit MockVieEncoder(TestProcessThread* process_thread)
: ViEEncoder(1, 1, 1, *process_thread, NULL) {} : ViEEncoder(1, 1, 1, config_, *process_thread, NULL) {}
~MockVieEncoder() {} ~MockVieEncoder() {}
MOCK_METHOD1(OnReceivedIntraFrameRequest, MOCK_METHOD1(OnReceivedIntraFrameRequest,
@ -47,6 +48,8 @@ class MockVieEncoder : public ViEEncoder {
void(uint32_t ssrc, uint64_t picture_id)); void(uint32_t ssrc, uint64_t picture_id));
MOCK_METHOD2(OnLocalSsrcChanged, MOCK_METHOD2(OnLocalSsrcChanged,
void(uint32_t old_ssrc, uint32_t new_ssrc)); void(uint32_t old_ssrc, uint32_t new_ssrc));
const Config config_;
}; };
class VieKeyRequestTest : public ::testing::Test { class VieKeyRequestTest : public ::testing::Test {

View File

@ -23,12 +23,14 @@
namespace webrtc { namespace webrtc {
class Config;
class VoiceEngine; class VoiceEngine;
class WEBRTC_DLLEXPORT VideoEngine { class WEBRTC_DLLEXPORT VideoEngine {
public: public:
// Creates a VideoEngine object, which can then be used to acquire subAPIs. // Creates a VideoEngine object, which can then be used to acquire subAPIs.
static VideoEngine* Create(); static VideoEngine* Create();
static VideoEngine* Create(const Config& config);
// Deletes a VideoEngine instance. // Deletes a VideoEngine instance.
static bool Delete(VideoEngine*& video_engine); static bool Delete(VideoEngine*& video_engine);

View File

@ -59,7 +59,8 @@ int ViEBaseImpl::Release() {
return ref_count; return ref_count;
} }
ViEBaseImpl::ViEBaseImpl() { ViEBaseImpl::ViEBaseImpl(const Config& config)
: shared_data_(config) {
WEBRTC_TRACE(kTraceMemory, kTraceVideo, shared_data_.instance_id(), WEBRTC_TRACE(kTraceMemory, kTraceVideo, shared_data_.instance_id(),
"ViEBaseImpl::ViEBaseImpl() Ctor"); "ViEBaseImpl::ViEBaseImpl() Ctor");
} }

View File

@ -18,6 +18,7 @@
namespace webrtc { namespace webrtc {
class Config;
class Module; class Module;
class VoiceEngine; class VoiceEngine;
@ -47,7 +48,7 @@ class ViEBaseImpl
virtual int LastError(); virtual int LastError();
protected: protected:
ViEBaseImpl(); ViEBaseImpl(const Config& config);
virtual ~ViEBaseImpl(); virtual ~ViEBaseImpl();
ViESharedData* shared_data() { return &shared_data_; } ViESharedData* shared_data() { return &shared_data_; }

View File

@ -32,6 +32,7 @@ const int kMaxDeliverWaitTime = 500;
ViECapturer::ViECapturer(int capture_id, ViECapturer::ViECapturer(int capture_id,
int engine_id, int engine_id,
const Config& config,
ProcessThread& module_process_thread) ProcessThread& module_process_thread)
: ViEFrameProviderBase(capture_id, engine_id), : ViEFrameProviderBase(capture_id, engine_id),
capture_cs_(CriticalSectionWrapper::CreateCriticalSection()), capture_cs_(CriticalSectionWrapper::CreateCriticalSection()),
@ -128,9 +129,10 @@ ViECapturer::~ViECapturer() {
ViECapturer* ViECapturer::CreateViECapture( ViECapturer* ViECapturer::CreateViECapture(
int capture_id, int capture_id,
int engine_id, int engine_id,
const Config& config,
VideoCaptureModule* capture_module, VideoCaptureModule* capture_module,
ProcessThread& module_process_thread) { ProcessThread& module_process_thread) {
ViECapturer* capture = new ViECapturer(capture_id, engine_id, ViECapturer* capture = new ViECapturer(capture_id, engine_id, config,
module_process_thread); module_process_thread);
if (!capture || capture->Init(capture_module) != 0) { if (!capture || capture->Init(capture_module) != 0) {
delete capture; delete capture;
@ -154,10 +156,11 @@ int32_t ViECapturer::Init(VideoCaptureModule* capture_module) {
ViECapturer* ViECapturer::CreateViECapture( ViECapturer* ViECapturer::CreateViECapture(
int capture_id, int capture_id,
int engine_id, int engine_id,
const Config& config,
const char* device_unique_idUTF8, const char* device_unique_idUTF8,
const uint32_t device_unique_idUTF8Length, const uint32_t device_unique_idUTF8Length,
ProcessThread& module_process_thread) { ProcessThread& module_process_thread) {
ViECapturer* capture = new ViECapturer(capture_id, engine_id, ViECapturer* capture = new ViECapturer(capture_id, engine_id, config,
module_process_thread); module_process_thread);
if (!capture || if (!capture ||
capture->Init(device_unique_idUTF8, device_unique_idUTF8Length) != 0) { capture->Init(device_unique_idUTF8, device_unique_idUTF8Length) != 0) {

View File

@ -27,6 +27,7 @@
namespace webrtc { namespace webrtc {
class Config;
class CriticalSectionWrapper; class CriticalSectionWrapper;
class EventWrapper; class EventWrapper;
class ProcessThread; class ProcessThread;
@ -45,12 +46,14 @@ class ViECapturer
public: public:
static ViECapturer* CreateViECapture(int capture_id, static ViECapturer* CreateViECapture(int capture_id,
int engine_id, int engine_id,
const Config& config,
VideoCaptureModule* capture_module, VideoCaptureModule* capture_module,
ProcessThread& module_process_thread); ProcessThread& module_process_thread);
static ViECapturer* CreateViECapture( static ViECapturer* CreateViECapture(
int capture_id, int capture_id,
int engine_id, int engine_id,
const Config& config,
const char* device_unique_idUTF8, const char* device_unique_idUTF8,
uint32_t device_unique_idUTF8Length, uint32_t device_unique_idUTF8Length,
ProcessThread& module_process_thread); ProcessThread& module_process_thread);
@ -108,6 +111,7 @@ class ViECapturer
protected: protected:
ViECapturer(int capture_id, ViECapturer(int capture_id,
int engine_id, int engine_id,
const Config& config,
ProcessThread& module_process_thread); ProcessThread& module_process_thread);
int32_t Init(VideoCaptureModule* capture_module); int32_t Init(VideoCaptureModule* capture_module);

View File

@ -55,6 +55,7 @@ class ChannelStatsObserver : public CallStatsObserver {
ViEChannel::ViEChannel(int32_t channel_id, ViEChannel::ViEChannel(int32_t channel_id,
int32_t engine_id, int32_t engine_id,
uint32_t number_of_cores, uint32_t number_of_cores,
const Config& config,
ProcessThread& module_process_thread, ProcessThread& module_process_thread,
RtcpIntraFrameObserver* intra_frame_observer, RtcpIntraFrameObserver* intra_frame_observer,
RtcpBandwidthObserver* bandwidth_observer, RtcpBandwidthObserver* bandwidth_observer,

View File

@ -32,21 +32,22 @@ namespace webrtc {
class CallStatsObserver; class CallStatsObserver;
class ChannelStatsObserver; class ChannelStatsObserver;
class Config;
class CriticalSectionWrapper; class CriticalSectionWrapper;
class Encryption; class Encryption;
class PacedSender; class PacedSender;
class ProcessThread; class ProcessThread;
class RtpRtcp;
class RtcpRttObserver; class RtcpRttObserver;
class RtpRtcp;
class ThreadWrapper; class ThreadWrapper;
class VideoCodingModule;
class VideoDecoder;
class VideoRenderCallback;
class ViEDecoderObserver; class ViEDecoderObserver;
class ViEEffectFilter; class ViEEffectFilter;
class ViENetworkObserver; class ViENetworkObserver;
class ViERTCPObserver; class ViERTCPObserver;
class ViERTPObserver; class ViERTPObserver;
class VideoCodingModule;
class VideoDecoder;
class VideoRenderCallback;
class VoEVideoSync; class VoEVideoSync;
class ViEChannel class ViEChannel
@ -64,6 +65,7 @@ class ViEChannel
ViEChannel(int32_t channel_id, ViEChannel(int32_t channel_id,
int32_t engine_id, int32_t engine_id,
uint32_t number_of_cores, uint32_t number_of_cores,
const Config& config,
ProcessThread& module_process_thread, ProcessThread& module_process_thread,
RtcpIntraFrameObserver* intra_frame_observer, RtcpIntraFrameObserver* intra_frame_observer,
RtcpBandwidthObserver* bandwidth_observer, RtcpBandwidthObserver* bandwidth_observer,

View File

@ -24,7 +24,8 @@ namespace webrtc {
ChannelGroup::ChannelGroup(ProcessThread* process_thread, ChannelGroup::ChannelGroup(ProcessThread* process_thread,
const OverUseDetectorOptions& options, const OverUseDetectorOptions& options,
RemoteBitrateEstimator::EstimationMode mode) RemoteBitrateEstimator::EstimationMode mode,
const Config& config)
: remb_(new VieRemb()), : remb_(new VieRemb()),
bitrate_controller_(BitrateController::CreateBitrateController()), bitrate_controller_(BitrateController::CreateBitrateController()),
call_stats_(new CallStats()), call_stats_(new CallStats()),

View File

@ -20,6 +20,7 @@ namespace webrtc {
class BitrateController; class BitrateController;
class CallStats; class CallStats;
class Config;
class EncoderStateFeedback; class EncoderStateFeedback;
struct OverUseDetectorOptions; struct OverUseDetectorOptions;
class ProcessThread; class ProcessThread;
@ -33,7 +34,8 @@ class ChannelGroup {
public: public:
ChannelGroup(ProcessThread* process_thread, ChannelGroup(ProcessThread* process_thread,
const OverUseDetectorOptions& options, const OverUseDetectorOptions& options,
RemoteBitrateEstimator::EstimationMode mode); RemoteBitrateEstimator::EstimationMode mode,
const Config& config);
~ChannelGroup(); ~ChannelGroup();
void AddChannel(int channel_id); void AddChannel(int channel_id);

View File

@ -29,7 +29,8 @@ namespace webrtc {
ViEChannelManager::ViEChannelManager( ViEChannelManager::ViEChannelManager(
int engine_id, int engine_id,
int number_of_cores, int number_of_cores,
const OverUseDetectorOptions& options) const OverUseDetectorOptions& options,
const Config& config)
: channel_id_critsect_(CriticalSectionWrapper::CreateCriticalSection()), : channel_id_critsect_(CriticalSectionWrapper::CreateCriticalSection()),
engine_id_(engine_id), engine_id_(engine_id),
number_of_cores_(number_of_cores), number_of_cores_(number_of_cores),
@ -39,7 +40,8 @@ ViEChannelManager::ViEChannelManager(
voice_engine_(NULL), voice_engine_(NULL),
module_process_thread_(NULL), module_process_thread_(NULL),
over_use_detector_options_(options), over_use_detector_options_(options),
bwe_mode_(RemoteBitrateEstimator::kSingleStreamEstimation) { bwe_mode_(RemoteBitrateEstimator::kSingleStreamEstimation),
config_(config) {
WEBRTC_TRACE(kTraceMemory, kTraceVideo, ViEId(engine_id), WEBRTC_TRACE(kTraceMemory, kTraceVideo, ViEId(engine_id),
"ViEChannelManager::ViEChannelManager(engine_id: %d)", "ViEChannelManager::ViEChannelManager(engine_id: %d)",
engine_id); engine_id);
@ -93,10 +95,12 @@ int ViEChannelManager::CreateChannel(int* channel_id) {
// Create a new channel group and add this channel. // Create a new channel group and add this channel.
ChannelGroup* group = new ChannelGroup(module_process_thread_, ChannelGroup* group = new ChannelGroup(module_process_thread_,
over_use_detector_options_, over_use_detector_options_,
bwe_mode_); bwe_mode_,
config_);
BitrateController* bitrate_controller = group->GetBitrateController(); BitrateController* bitrate_controller = group->GetBitrateController();
ViEEncoder* vie_encoder = new ViEEncoder(engine_id_, new_channel_id, ViEEncoder* vie_encoder = new ViEEncoder(engine_id_, new_channel_id,
number_of_cores_, number_of_cores_,
config_,
*module_process_thread_, *module_process_thread_,
bitrate_controller); bitrate_controller);
@ -165,6 +169,7 @@ int ViEChannelManager::CreateChannel(int* channel_id,
if (sender) { if (sender) {
// We need to create a new ViEEncoder. // We need to create a new ViEEncoder.
vie_encoder = new ViEEncoder(engine_id_, new_channel_id, number_of_cores_, vie_encoder = new ViEEncoder(engine_id_, new_channel_id, number_of_cores_,
config_,
*module_process_thread_, *module_process_thread_,
bitrate_controller); bitrate_controller);
if (!(vie_encoder->Init() && if (!(vie_encoder->Init() &&
@ -423,6 +428,7 @@ bool ViEChannelManager::CreateChannelObject(
ViEChannel* vie_channel = new ViEChannel(channel_id, engine_id_, ViEChannel* vie_channel = new ViEChannel(channel_id, engine_id_,
number_of_cores_, number_of_cores_,
config_,
*module_process_thread_, *module_process_thread_,
intra_frame_observer, intra_frame_observer,
bandwidth_observer, bandwidth_observer,

View File

@ -25,6 +25,7 @@
namespace webrtc { namespace webrtc {
class Config;
class CriticalSectionWrapper; class CriticalSectionWrapper;
class MapWrapper; class MapWrapper;
class ProcessThread; class ProcessThread;
@ -44,7 +45,8 @@ class ViEChannelManager: private ViEManagerBase {
public: public:
ViEChannelManager(int engine_id, ViEChannelManager(int engine_id,
int number_of_cores, int number_of_cores,
const OverUseDetectorOptions& options); const OverUseDetectorOptions& options,
const Config& config);
~ViEChannelManager(); ~ViEChannelManager();
void SetModuleProcessThread(ProcessThread* module_process_thread); void SetModuleProcessThread(ProcessThread* module_process_thread);
@ -137,6 +139,7 @@ class ViEChannelManager: private ViEManagerBase {
ProcessThread* module_process_thread_; ProcessThread* module_process_thread_;
const OverUseDetectorOptions& over_use_detector_options_; const OverUseDetectorOptions& over_use_detector_options_;
RemoteBitrateEstimator::EstimationMode bwe_mode_; RemoteBitrateEstimator::EstimationMode bwe_mode_;
const Config& config_;
}; };
class ViEChannelManagerScoped: private ViEManagerScopedBase { class ViEChannelManagerScoped: private ViEManagerScopedBase {

View File

@ -101,6 +101,7 @@ class ViEPacedSenderCallback : public PacedSender::Callback {
ViEEncoder::ViEEncoder(int32_t engine_id, ViEEncoder::ViEEncoder(int32_t engine_id,
int32_t channel_id, int32_t channel_id,
uint32_t number_of_cores, uint32_t number_of_cores,
const Config& config,
ProcessThread& module_process_thread, ProcessThread& module_process_thread,
BitrateController* bitrate_controller) BitrateController* bitrate_controller)
: engine_id_(engine_id), : engine_id_(engine_id),

View File

@ -28,6 +28,7 @@
namespace webrtc { namespace webrtc {
class CriticalSectionWrapper; class CriticalSectionWrapper;
class Config;
class PacedSender; class PacedSender;
class ProcessThread; class ProcessThread;
class QMVideoSettingsCallback; class QMVideoSettingsCallback;
@ -51,6 +52,7 @@ class ViEEncoder
ViEEncoder(int32_t engine_id, ViEEncoder(int32_t engine_id,
int32_t channel_id, int32_t channel_id,
uint32_t number_of_cores, uint32_t number_of_cores,
const Config& config,
ProcessThread& module_process_thread, ProcessThread& module_process_thread,
BitrateController* bitrate_controller); BitrateController* bitrate_controller);
~ViEEncoder(); ~ViEEncoder();

View File

@ -8,8 +8,10 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#include "video_engine/vie_impl.h" #include "webrtc/video_engine/vie_impl.h"
#include "system_wrappers/interface/trace.h"
#include "webrtc/common.h"
#include "webrtc/system_wrappers/interface/trace.h"
#ifdef WEBRTC_ANDROID #ifdef WEBRTC_ANDROID
#include "webrtc/modules/video_capture/include/video_capture_factory.h" #include "webrtc/modules/video_capture/include/video_capture_factory.h"
@ -21,7 +23,11 @@ namespace webrtc {
enum { kModuleId = 0 }; enum { kModuleId = 0 };
VideoEngine* VideoEngine::Create() { VideoEngine* VideoEngine::Create() {
return new VideoEngineImpl(); return new VideoEngineImpl(new Config(), true /* owns_config */);
}
VideoEngine* VideoEngine::Create(const Config& config) {
return new VideoEngineImpl(&config, false /* owns_config */);
} }
bool VideoEngine::Delete(VideoEngine*& video_engine) { bool VideoEngine::Delete(VideoEngine*& video_engine) {

View File

@ -11,35 +11,37 @@
#ifndef WEBRTC_VIDEO_ENGINE_VIE_IMPL_H_ #ifndef WEBRTC_VIDEO_ENGINE_VIE_IMPL_H_
#define WEBRTC_VIDEO_ENGINE_VIE_IMPL_H_ #define WEBRTC_VIDEO_ENGINE_VIE_IMPL_H_
#include "engine_configurations.h" // NOLINT #include "webrtc/common.h"
#include "video_engine/vie_defines.h" #include "webrtc/engine_configurations.h"
#include "webrtc/video_engine/vie_defines.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
#include "video_engine/vie_base_impl.h" #include "webrtc/video_engine/vie_base_impl.h"
#ifdef WEBRTC_VIDEO_ENGINE_CAPTURE_API #ifdef WEBRTC_VIDEO_ENGINE_CAPTURE_API
#include "video_engine/vie_capture_impl.h" #include "webrtc/video_engine/vie_capture_impl.h"
#endif #endif
#ifdef WEBRTC_VIDEO_ENGINE_CODEC_API #ifdef WEBRTC_VIDEO_ENGINE_CODEC_API
#include "video_engine/vie_codec_impl.h" #include "webrtc/video_engine/vie_codec_impl.h"
#endif #endif
#ifdef WEBRTC_VIDEO_ENGINE_ENCRYPTION_API #ifdef WEBRTC_VIDEO_ENGINE_ENCRYPTION_API
#include "video_engine/vie_encryption_impl.h" #include "webrtc/video_engine/vie_encryption_impl.h"
#endif #endif
#ifdef WEBRTC_VIDEO_ENGINE_FILE_API #ifdef WEBRTC_VIDEO_ENGINE_FILE_API
#include "video_engine/vie_file_impl.h" #include "webrtc/video_engine/vie_file_impl.h"
#endif #endif
#ifdef WEBRTC_VIDEO_ENGINE_IMAGE_PROCESS_API #ifdef WEBRTC_VIDEO_ENGINE_IMAGE_PROCESS_API
#include "video_engine/vie_image_process_impl.h" #include "webrtc/video_engine/vie_image_process_impl.h"
#endif #endif
#include "video_engine/vie_network_impl.h" #include "webrtc/video_engine/vie_network_impl.h"
#ifdef WEBRTC_VIDEO_ENGINE_RENDER_API #ifdef WEBRTC_VIDEO_ENGINE_RENDER_API
#include "video_engine/vie_render_impl.h" #include "webrtc/video_engine/vie_render_impl.h"
#endif #endif
#ifdef WEBRTC_VIDEO_ENGINE_RTP_RTCP_API #ifdef WEBRTC_VIDEO_ENGINE_RTP_RTCP_API
#include "video_engine/vie_rtp_rtcp_impl.h" #include "webrtc/video_engine/vie_rtp_rtcp_impl.h"
#endif #endif
#ifdef WEBRTC_VIDEO_ENGINE_EXTERNAL_CODEC_API #ifdef WEBRTC_VIDEO_ENGINE_EXTERNAL_CODEC_API
#include "video_engine/vie_external_codec_impl.h" #include "webrtc/video_engine/vie_external_codec_impl.h"
#endif #endif
namespace webrtc { namespace webrtc {
@ -74,35 +76,40 @@ class VideoEngineImpl
public VideoEngine public VideoEngine
{ // NOLINT { // NOLINT
public: public:
VideoEngineImpl() VideoEngineImpl(const Config* config, bool owns_config)
: : ViEBaseImpl(*config),
#ifdef WEBRTC_VIDEO_ENGINE_CODEC_API #ifdef WEBRTC_VIDEO_ENGINE_CODEC_API
ViECodecImpl(ViEBaseImpl::shared_data()) ViECodecImpl(ViEBaseImpl::shared_data()),
#endif #endif
#ifdef WEBRTC_VIDEO_ENGINE_CAPTURE_API #ifdef WEBRTC_VIDEO_ENGINE_CAPTURE_API
, ViECaptureImpl(ViEBaseImpl::shared_data()) ViECaptureImpl(ViEBaseImpl::shared_data()),
#endif #endif
#ifdef WEBRTC_VIDEO_ENGINE_ENCRYPTION_API #ifdef WEBRTC_VIDEO_ENGINE_ENCRYPTION_API
, ViEEncryptionImpl(ViEBaseImpl::shared_data()) ViEEncryptionImpl(ViEBaseImpl::shared_data()),
#endif #endif
#ifdef WEBRTC_VIDEO_ENGINE_FILE_API #ifdef WEBRTC_VIDEO_ENGINE_FILE_API
, ViEFileImpl(ViEBaseImpl::shared_data()) ViEFileImpl(ViEBaseImpl::shared_data()),
#endif #endif
#ifdef WEBRTC_VIDEO_ENGINE_IMAGE_PROCESS_API #ifdef WEBRTC_VIDEO_ENGINE_IMAGE_PROCESS_API
, ViEImageProcessImpl(ViEBaseImpl::shared_data()) ViEImageProcessImpl(ViEBaseImpl::shared_data()),
#endif #endif
, ViENetworkImpl(ViEBaseImpl::shared_data()) ViENetworkImpl(ViEBaseImpl::shared_data()),
#ifdef WEBRTC_VIDEO_ENGINE_RENDER_API #ifdef WEBRTC_VIDEO_ENGINE_RENDER_API
, ViERenderImpl(ViEBaseImpl::shared_data()) ViERenderImpl(ViEBaseImpl::shared_data()),
#endif #endif
#ifdef WEBRTC_VIDEO_ENGINE_RTP_RTCP_API #ifdef WEBRTC_VIDEO_ENGINE_RTP_RTCP_API
, ViERTP_RTCPImpl(ViEBaseImpl::shared_data()) ViERTP_RTCPImpl(ViEBaseImpl::shared_data()),
#endif #endif
#ifdef WEBRTC_VIDEO_ENGINE_EXTERNAL_CODEC_API #ifdef WEBRTC_VIDEO_ENGINE_EXTERNAL_CODEC_API
, ViEExternalCodecImpl(ViEBaseImpl::shared_data()) ViEExternalCodecImpl(ViEBaseImpl::shared_data()),
#endif #endif
own_config_(owns_config ? config : NULL)
{} {}
virtual ~VideoEngineImpl() {} virtual ~VideoEngineImpl() {}
private:
// Placeholder for the case where this owns the config.
scoped_ptr<const Config> own_config_;
}; };
} // namespace webrtc } // namespace webrtc

View File

@ -26,8 +26,9 @@
namespace webrtc { namespace webrtc {
ViEInputManager::ViEInputManager(const int engine_id) ViEInputManager::ViEInputManager(const int engine_id, const Config& config)
: engine_id_(engine_id), : config_(config),
engine_id_(engine_id),
map_cs_(CriticalSectionWrapper::CreateCriticalSection()), map_cs_(CriticalSectionWrapper::CreateCriticalSection()),
device_info_cs_(CriticalSectionWrapper::CreateCriticalSection()), device_info_cs_(CriticalSectionWrapper::CreateCriticalSection()),
vie_frame_provider_map_(), vie_frame_provider_map_(),
@ -260,7 +261,7 @@ int ViEInputManager::CreateCaptureDevice(
return kViECaptureDeviceMaxNoDevicesAllocated; return kViECaptureDeviceMaxNoDevicesAllocated;
} }
ViECapturer* vie_capture = ViECapturer::CreateViECapture( ViECapturer* vie_capture = ViECapturer::CreateViECapture(
newcapture_id, engine_id_, device_unique_idUTF8, newcapture_id, engine_id_, config_, device_unique_idUTF8,
device_unique_idUTF8Length, *module_process_thread_); device_unique_idUTF8Length, *module_process_thread_);
if (!vie_capture) { if (!vie_capture) {
ReturnCaptureId(newcapture_id); ReturnCaptureId(newcapture_id);
@ -299,7 +300,8 @@ int ViEInputManager::CreateCaptureDevice(VideoCaptureModule* capture_module,
} }
ViECapturer* vie_capture = ViECapturer::CreateViECapture( ViECapturer* vie_capture = ViECapturer::CreateViECapture(
newcapture_id, engine_id_, capture_module, *module_process_thread_); newcapture_id, engine_id_, config_,
capture_module, *module_process_thread_);
if (!vie_capture) { if (!vie_capture) {
ReturnCaptureId(newcapture_id); ReturnCaptureId(newcapture_id);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_), WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_),
@ -369,7 +371,7 @@ int ViEInputManager::CreateExternalCaptureDevice(
} }
ViECapturer* vie_capture = ViECapturer::CreateViECapture( ViECapturer* vie_capture = ViECapturer::CreateViECapture(
newcapture_id, engine_id_, NULL, 0, *module_process_thread_); newcapture_id, engine_id_, config_, NULL, 0, *module_process_thread_);
if (!vie_capture) { if (!vie_capture) {
ReturnCaptureId(newcapture_id); ReturnCaptureId(newcapture_id);
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_), WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_),

View File

@ -22,6 +22,7 @@
namespace webrtc { namespace webrtc {
class Config;
class CriticalSectionWrapper; class CriticalSectionWrapper;
class ProcessThread; class ProcessThread;
class RWLockWrapper; class RWLockWrapper;
@ -33,7 +34,7 @@ class VoiceEngine;
class ViEInputManager : private ViEManagerBase { class ViEInputManager : private ViEManagerBase {
friend class ViEInputManagerScoped; friend class ViEInputManagerScoped;
public: public:
explicit ViEInputManager(int engine_id); ViEInputManager(int engine_id, const Config& config);
~ViEInputManager(); ~ViEInputManager();
void SetModuleProcessThread(ProcessThread* module_process_thread); void SetModuleProcessThread(ProcessThread* module_process_thread);
@ -109,6 +110,7 @@ class ViEInputManager : private ViEManagerBase {
// Gets the ViEFilePlayer for this file_id. // Gets the ViEFilePlayer for this file_id.
ViEFilePlayer* ViEFilePlayerPtr(int file_id) const; ViEFilePlayer* ViEFilePlayerPtr(int file_id) const;
const Config& config_;
int engine_id_; int engine_id_;
scoped_ptr<CriticalSectionWrapper> map_cs_; scoped_ptr<CriticalSectionWrapper> map_cs_;
scoped_ptr<CriticalSectionWrapper> device_info_cs_; scoped_ptr<CriticalSectionWrapper> device_info_cs_;

View File

@ -22,14 +22,15 @@ namespace webrtc {
// Active instance counter // Active instance counter
int ViESharedData::instance_counter_ = 0; int ViESharedData::instance_counter_ = 0;
ViESharedData::ViESharedData() ViESharedData::ViESharedData(const Config& config)
: instance_id_(++instance_counter_), : instance_id_(++instance_counter_),
initialized_(false), initialized_(false),
number_cores_(CpuInfo::DetectNumberOfCores()), number_cores_(CpuInfo::DetectNumberOfCores()),
over_use_detector_options_(), over_use_detector_options_(),
channel_manager_(*new ViEChannelManager(instance_id_, number_cores_, channel_manager_(*new ViEChannelManager(instance_id_, number_cores_,
over_use_detector_options_)), over_use_detector_options_,
input_manager_(*new ViEInputManager(instance_id_)), config)),
input_manager_(*new ViEInputManager(instance_id_, config)),
render_manager_(*new ViERenderManager(instance_id_)), render_manager_(*new ViERenderManager(instance_id_)),
module_process_thread_(ProcessThread::CreateProcessThread()), module_process_thread_(ProcessThread::CreateProcessThread()),
last_error_(0) { last_error_(0) {

View File

@ -18,6 +18,7 @@
namespace webrtc { namespace webrtc {
class Config;
class ProcessThread; class ProcessThread;
class ViEChannelManager; class ViEChannelManager;
class ViEInputManager; class ViEInputManager;
@ -25,7 +26,7 @@ class ViERenderManager;
class ViESharedData { class ViESharedData {
public: public:
ViESharedData(); ViESharedData(const Config& config);
~ViESharedData(); ~ViESharedData();
bool Initialized() const; bool Initialized() const;