diff options
author | andresp@webrtc.org <andresp@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-05-13 10:50:50 +0000 |
---|---|---|
committer | andresp@webrtc.org <andresp@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-05-13 10:50:50 +0000 |
commit | ac6d919eec548c708588f29923f617a17283c7e2 (patch) | |
tree | 4151562ee8c0cf56d99e72b71d46730c32d01114 | |
parent | 7d6e2a00356b107f745ff84b738a6f0a94b9b9a2 (diff) | |
download | webrtc-ac6d919eec548c708588f29923f617a17283c7e2.tar.gz |
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/webrtc@4007 4adac7df-926f-26a2-2b94-8c16560cd09d
-rw-r--r-- | video_engine/encoder_state_feedback_unittest.cc | 15 | ||||
-rw-r--r-- | video_engine/include/vie_base.h | 2 | ||||
-rw-r--r-- | video_engine/vie_base_impl.cc | 3 | ||||
-rw-r--r-- | video_engine/vie_base_impl.h | 3 | ||||
-rw-r--r-- | video_engine/vie_capturer.cc | 7 | ||||
-rw-r--r-- | video_engine/vie_capturer.h | 4 | ||||
-rw-r--r-- | video_engine/vie_channel.cc | 1 | ||||
-rw-r--r-- | video_engine/vie_channel.h | 10 | ||||
-rw-r--r-- | video_engine/vie_channel_group.cc | 3 | ||||
-rw-r--r-- | video_engine/vie_channel_group.h | 4 | ||||
-rw-r--r-- | video_engine/vie_channel_manager.cc | 12 | ||||
-rw-r--r-- | video_engine/vie_channel_manager.h | 5 | ||||
-rw-r--r-- | video_engine/vie_encoder.cc | 1 | ||||
-rw-r--r-- | video_engine/vie_encoder.h | 2 | ||||
-rw-r--r-- | video_engine/vie_impl.cc | 12 | ||||
-rw-r--r-- | video_engine/vie_impl.h | 53 | ||||
-rw-r--r-- | video_engine/vie_input_manager.cc | 12 | ||||
-rw-r--r-- | video_engine/vie_input_manager.h | 4 | ||||
-rw-r--r-- | video_engine/vie_shared_data.cc | 7 | ||||
-rw-r--r-- | video_engine/vie_shared_data.h | 3 |
20 files changed, 107 insertions, 56 deletions
diff --git a/video_engine/encoder_state_feedback_unittest.cc b/video_engine/encoder_state_feedback_unittest.cc index 736ebcd9..4009d836 100644 --- a/video_engine/encoder_state_feedback_unittest.cc +++ b/video_engine/encoder_state_feedback_unittest.cc @@ -10,15 +10,16 @@ // 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 <gtest/gtest.h> -#include "modules/rtp_rtcp/interface/rtp_rtcp_defines.h" -#include "modules/utility/interface/process_thread.h" -#include "system_wrappers/interface/scoped_ptr.h" -#include "video_engine/vie_encoder.h" +#include "webrtc/common.h" +#include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h" +#include "webrtc/modules/utility/interface/process_thread.h" +#include "webrtc/system_wrappers/interface/scoped_ptr.h" +#include "webrtc/video_engine/vie_encoder.h" namespace webrtc { @@ -36,7 +37,7 @@ class TestProcessThread : public ProcessThread { class MockVieEncoder : public ViEEncoder { public: explicit MockVieEncoder(TestProcessThread* process_thread) - : ViEEncoder(1, 1, 1, *process_thread, NULL) {} + : ViEEncoder(1, 1, 1, config_, *process_thread, NULL) {} ~MockVieEncoder() {} MOCK_METHOD1(OnReceivedIntraFrameRequest, @@ -47,6 +48,8 @@ class MockVieEncoder : public ViEEncoder { void(uint32_t ssrc, uint64_t picture_id)); MOCK_METHOD2(OnLocalSsrcChanged, void(uint32_t old_ssrc, uint32_t new_ssrc)); + + const Config config_; }; class VieKeyRequestTest : public ::testing::Test { diff --git a/video_engine/include/vie_base.h b/video_engine/include/vie_base.h index 8bbf1d58..ea0ab741 100644 --- a/video_engine/include/vie_base.h +++ b/video_engine/include/vie_base.h @@ -23,12 +23,14 @@ namespace webrtc { +class Config; class VoiceEngine; class WEBRTC_DLLEXPORT VideoEngine { public: // Creates a VideoEngine object, which can then be used to acquire subāAPIs. static VideoEngine* Create(); + static VideoEngine* Create(const Config& config); // Deletes a VideoEngine instance. static bool Delete(VideoEngine*& video_engine); diff --git a/video_engine/vie_base_impl.cc b/video_engine/vie_base_impl.cc index 617ab407..7beb919f 100644 --- a/video_engine/vie_base_impl.cc +++ b/video_engine/vie_base_impl.cc @@ -59,7 +59,8 @@ int ViEBaseImpl::Release() { return ref_count; } -ViEBaseImpl::ViEBaseImpl() { +ViEBaseImpl::ViEBaseImpl(const Config& config) + : shared_data_(config) { WEBRTC_TRACE(kTraceMemory, kTraceVideo, shared_data_.instance_id(), "ViEBaseImpl::ViEBaseImpl() Ctor"); } diff --git a/video_engine/vie_base_impl.h b/video_engine/vie_base_impl.h index a9eec444..4c576999 100644 --- a/video_engine/vie_base_impl.h +++ b/video_engine/vie_base_impl.h @@ -18,6 +18,7 @@ namespace webrtc { +class Config; class Module; class VoiceEngine; @@ -47,7 +48,7 @@ class ViEBaseImpl virtual int LastError(); protected: - ViEBaseImpl(); + ViEBaseImpl(const Config& config); virtual ~ViEBaseImpl(); ViESharedData* shared_data() { return &shared_data_; } diff --git a/video_engine/vie_capturer.cc b/video_engine/vie_capturer.cc index 1a283d7c..e72d5d86 100644 --- a/video_engine/vie_capturer.cc +++ b/video_engine/vie_capturer.cc @@ -32,6 +32,7 @@ const int kMaxDeliverWaitTime = 500; ViECapturer::ViECapturer(int capture_id, int engine_id, + const Config& config, ProcessThread& module_process_thread) : ViEFrameProviderBase(capture_id, engine_id), capture_cs_(CriticalSectionWrapper::CreateCriticalSection()), @@ -128,9 +129,10 @@ ViECapturer::~ViECapturer() { ViECapturer* ViECapturer::CreateViECapture( int capture_id, int engine_id, + const Config& config, VideoCaptureModule* capture_module, ProcessThread& module_process_thread) { - ViECapturer* capture = new ViECapturer(capture_id, engine_id, + ViECapturer* capture = new ViECapturer(capture_id, engine_id, config, module_process_thread); if (!capture || capture->Init(capture_module) != 0) { delete capture; @@ -154,10 +156,11 @@ int32_t ViECapturer::Init(VideoCaptureModule* capture_module) { ViECapturer* ViECapturer::CreateViECapture( int capture_id, int engine_id, + const Config& config, const char* device_unique_idUTF8, const uint32_t device_unique_idUTF8Length, ProcessThread& module_process_thread) { - ViECapturer* capture = new ViECapturer(capture_id, engine_id, + ViECapturer* capture = new ViECapturer(capture_id, engine_id, config, module_process_thread); if (!capture || capture->Init(device_unique_idUTF8, device_unique_idUTF8Length) != 0) { diff --git a/video_engine/vie_capturer.h b/video_engine/vie_capturer.h index df0e126d..01a67092 100644 --- a/video_engine/vie_capturer.h +++ b/video_engine/vie_capturer.h @@ -27,6 +27,7 @@ namespace webrtc { +class Config; class CriticalSectionWrapper; class EventWrapper; class ProcessThread; @@ -45,12 +46,14 @@ class ViECapturer public: static ViECapturer* CreateViECapture(int capture_id, int engine_id, + const Config& config, VideoCaptureModule* capture_module, ProcessThread& module_process_thread); static ViECapturer* CreateViECapture( int capture_id, int engine_id, + const Config& config, const char* device_unique_idUTF8, uint32_t device_unique_idUTF8Length, ProcessThread& module_process_thread); @@ -108,6 +111,7 @@ class ViECapturer protected: ViECapturer(int capture_id, int engine_id, + const Config& config, ProcessThread& module_process_thread); int32_t Init(VideoCaptureModule* capture_module); diff --git a/video_engine/vie_channel.cc b/video_engine/vie_channel.cc index 67960701..d4f1957e 100644 --- a/video_engine/vie_channel.cc +++ b/video_engine/vie_channel.cc @@ -55,6 +55,7 @@ class ChannelStatsObserver : public CallStatsObserver { ViEChannel::ViEChannel(int32_t channel_id, int32_t engine_id, uint32_t number_of_cores, + const Config& config, ProcessThread& module_process_thread, RtcpIntraFrameObserver* intra_frame_observer, RtcpBandwidthObserver* bandwidth_observer, diff --git a/video_engine/vie_channel.h b/video_engine/vie_channel.h index 620d64e2..540385f7 100644 --- a/video_engine/vie_channel.h +++ b/video_engine/vie_channel.h @@ -32,21 +32,22 @@ namespace webrtc { class CallStatsObserver; class ChannelStatsObserver; +class Config; class CriticalSectionWrapper; class Encryption; class PacedSender; class ProcessThread; -class RtpRtcp; class RtcpRttObserver; +class RtpRtcp; class ThreadWrapper; -class VideoCodingModule; -class VideoDecoder; -class VideoRenderCallback; class ViEDecoderObserver; class ViEEffectFilter; class ViENetworkObserver; class ViERTCPObserver; class ViERTPObserver; +class VideoCodingModule; +class VideoDecoder; +class VideoRenderCallback; class VoEVideoSync; class ViEChannel @@ -64,6 +65,7 @@ class ViEChannel ViEChannel(int32_t channel_id, int32_t engine_id, uint32_t number_of_cores, + const Config& config, ProcessThread& module_process_thread, RtcpIntraFrameObserver* intra_frame_observer, RtcpBandwidthObserver* bandwidth_observer, diff --git a/video_engine/vie_channel_group.cc b/video_engine/vie_channel_group.cc index c7169b67..1a78659f 100644 --- a/video_engine/vie_channel_group.cc +++ b/video_engine/vie_channel_group.cc @@ -24,7 +24,8 @@ namespace webrtc { ChannelGroup::ChannelGroup(ProcessThread* process_thread, const OverUseDetectorOptions& options, - RemoteBitrateEstimator::EstimationMode mode) + RemoteBitrateEstimator::EstimationMode mode, + const Config& config) : remb_(new VieRemb()), bitrate_controller_(BitrateController::CreateBitrateController()), call_stats_(new CallStats()), diff --git a/video_engine/vie_channel_group.h b/video_engine/vie_channel_group.h index 418cda40..6a313680 100644 --- a/video_engine/vie_channel_group.h +++ b/video_engine/vie_channel_group.h @@ -20,6 +20,7 @@ namespace webrtc { class BitrateController; class CallStats; +class Config; class EncoderStateFeedback; struct OverUseDetectorOptions; class ProcessThread; @@ -33,7 +34,8 @@ class ChannelGroup { public: ChannelGroup(ProcessThread* process_thread, const OverUseDetectorOptions& options, - RemoteBitrateEstimator::EstimationMode mode); + RemoteBitrateEstimator::EstimationMode mode, + const Config& config); ~ChannelGroup(); void AddChannel(int channel_id); diff --git a/video_engine/vie_channel_manager.cc b/video_engine/vie_channel_manager.cc index 73bc87eb..874b16f8 100644 --- a/video_engine/vie_channel_manager.cc +++ b/video_engine/vie_channel_manager.cc @@ -29,7 +29,8 @@ namespace webrtc { ViEChannelManager::ViEChannelManager( int engine_id, int number_of_cores, - const OverUseDetectorOptions& options) + const OverUseDetectorOptions& options, + const Config& config) : channel_id_critsect_(CriticalSectionWrapper::CreateCriticalSection()), engine_id_(engine_id), number_of_cores_(number_of_cores), @@ -39,7 +40,8 @@ ViEChannelManager::ViEChannelManager( voice_engine_(NULL), module_process_thread_(NULL), over_use_detector_options_(options), - bwe_mode_(RemoteBitrateEstimator::kSingleStreamEstimation) { + bwe_mode_(RemoteBitrateEstimator::kSingleStreamEstimation), + config_(config) { WEBRTC_TRACE(kTraceMemory, kTraceVideo, ViEId(engine_id), "ViEChannelManager::ViEChannelManager(engine_id: %d)", engine_id); @@ -93,10 +95,12 @@ int ViEChannelManager::CreateChannel(int* channel_id) { // Create a new channel group and add this channel. ChannelGroup* group = new ChannelGroup(module_process_thread_, over_use_detector_options_, - bwe_mode_); + bwe_mode_, + config_); BitrateController* bitrate_controller = group->GetBitrateController(); ViEEncoder* vie_encoder = new ViEEncoder(engine_id_, new_channel_id, number_of_cores_, + config_, *module_process_thread_, bitrate_controller); @@ -165,6 +169,7 @@ int ViEChannelManager::CreateChannel(int* channel_id, if (sender) { // We need to create a new ViEEncoder. vie_encoder = new ViEEncoder(engine_id_, new_channel_id, number_of_cores_, + config_, *module_process_thread_, bitrate_controller); if (!(vie_encoder->Init() && @@ -423,6 +428,7 @@ bool ViEChannelManager::CreateChannelObject( ViEChannel* vie_channel = new ViEChannel(channel_id, engine_id_, number_of_cores_, + config_, *module_process_thread_, intra_frame_observer, bandwidth_observer, diff --git a/video_engine/vie_channel_manager.h b/video_engine/vie_channel_manager.h index 326f6811..a093b85b 100644 --- a/video_engine/vie_channel_manager.h +++ b/video_engine/vie_channel_manager.h @@ -25,6 +25,7 @@ namespace webrtc { +class Config; class CriticalSectionWrapper; class MapWrapper; class ProcessThread; @@ -44,7 +45,8 @@ class ViEChannelManager: private ViEManagerBase { public: ViEChannelManager(int engine_id, int number_of_cores, - const OverUseDetectorOptions& options); + const OverUseDetectorOptions& options, + const Config& config); ~ViEChannelManager(); void SetModuleProcessThread(ProcessThread* module_process_thread); @@ -137,6 +139,7 @@ class ViEChannelManager: private ViEManagerBase { ProcessThread* module_process_thread_; const OverUseDetectorOptions& over_use_detector_options_; RemoteBitrateEstimator::EstimationMode bwe_mode_; + const Config& config_; }; class ViEChannelManagerScoped: private ViEManagerScopedBase { diff --git a/video_engine/vie_encoder.cc b/video_engine/vie_encoder.cc index f75ca122..e0be2523 100644 --- a/video_engine/vie_encoder.cc +++ b/video_engine/vie_encoder.cc @@ -101,6 +101,7 @@ class ViEPacedSenderCallback : public PacedSender::Callback { ViEEncoder::ViEEncoder(int32_t engine_id, int32_t channel_id, uint32_t number_of_cores, + const Config& config, ProcessThread& module_process_thread, BitrateController* bitrate_controller) : engine_id_(engine_id), diff --git a/video_engine/vie_encoder.h b/video_engine/vie_encoder.h index f9dd0bd8..43a38f65 100644 --- a/video_engine/vie_encoder.h +++ b/video_engine/vie_encoder.h @@ -28,6 +28,7 @@ namespace webrtc { class CriticalSectionWrapper; +class Config; class PacedSender; class ProcessThread; class QMVideoSettingsCallback; @@ -51,6 +52,7 @@ class ViEEncoder ViEEncoder(int32_t engine_id, int32_t channel_id, uint32_t number_of_cores, + const Config& config, ProcessThread& module_process_thread, BitrateController* bitrate_controller); ~ViEEncoder(); diff --git a/video_engine/vie_impl.cc b/video_engine/vie_impl.cc index 8a4067cd..349a996f 100644 --- a/video_engine/vie_impl.cc +++ b/video_engine/vie_impl.cc @@ -8,8 +8,10 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "video_engine/vie_impl.h" -#include "system_wrappers/interface/trace.h" +#include "webrtc/video_engine/vie_impl.h" + +#include "webrtc/common.h" +#include "webrtc/system_wrappers/interface/trace.h" #ifdef WEBRTC_ANDROID #include "webrtc/modules/video_capture/include/video_capture_factory.h" @@ -21,7 +23,11 @@ namespace webrtc { enum { kModuleId = 0 }; 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) { diff --git a/video_engine/vie_impl.h b/video_engine/vie_impl.h index ad6e3065..28889123 100644 --- a/video_engine/vie_impl.h +++ b/video_engine/vie_impl.h @@ -11,35 +11,37 @@ #ifndef WEBRTC_VIDEO_ENGINE_VIE_IMPL_H_ #define WEBRTC_VIDEO_ENGINE_VIE_IMPL_H_ -#include "engine_configurations.h" // NOLINT -#include "video_engine/vie_defines.h" +#include "webrtc/common.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 -#include "video_engine/vie_capture_impl.h" +#include "webrtc/video_engine/vie_capture_impl.h" #endif #ifdef WEBRTC_VIDEO_ENGINE_CODEC_API -#include "video_engine/vie_codec_impl.h" +#include "webrtc/video_engine/vie_codec_impl.h" #endif #ifdef WEBRTC_VIDEO_ENGINE_ENCRYPTION_API -#include "video_engine/vie_encryption_impl.h" +#include "webrtc/video_engine/vie_encryption_impl.h" #endif #ifdef WEBRTC_VIDEO_ENGINE_FILE_API -#include "video_engine/vie_file_impl.h" +#include "webrtc/video_engine/vie_file_impl.h" #endif #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 -#include "video_engine/vie_network_impl.h" +#include "webrtc/video_engine/vie_network_impl.h" #ifdef WEBRTC_VIDEO_ENGINE_RENDER_API -#include "video_engine/vie_render_impl.h" +#include "webrtc/video_engine/vie_render_impl.h" #endif #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 #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 namespace webrtc { @@ -74,35 +76,40 @@ class VideoEngineImpl public VideoEngine { // NOLINT public: - VideoEngineImpl() - : + VideoEngineImpl(const Config* config, bool owns_config) + : ViEBaseImpl(*config), #ifdef WEBRTC_VIDEO_ENGINE_CODEC_API - ViECodecImpl(ViEBaseImpl::shared_data()) + ViECodecImpl(ViEBaseImpl::shared_data()), #endif #ifdef WEBRTC_VIDEO_ENGINE_CAPTURE_API - , ViECaptureImpl(ViEBaseImpl::shared_data()) + ViECaptureImpl(ViEBaseImpl::shared_data()), #endif #ifdef WEBRTC_VIDEO_ENGINE_ENCRYPTION_API - , ViEEncryptionImpl(ViEBaseImpl::shared_data()) + ViEEncryptionImpl(ViEBaseImpl::shared_data()), #endif #ifdef WEBRTC_VIDEO_ENGINE_FILE_API - , ViEFileImpl(ViEBaseImpl::shared_data()) + ViEFileImpl(ViEBaseImpl::shared_data()), #endif #ifdef WEBRTC_VIDEO_ENGINE_IMAGE_PROCESS_API - , ViEImageProcessImpl(ViEBaseImpl::shared_data()) + ViEImageProcessImpl(ViEBaseImpl::shared_data()), #endif - , ViENetworkImpl(ViEBaseImpl::shared_data()) + ViENetworkImpl(ViEBaseImpl::shared_data()), #ifdef WEBRTC_VIDEO_ENGINE_RENDER_API - , ViERenderImpl(ViEBaseImpl::shared_data()) + ViERenderImpl(ViEBaseImpl::shared_data()), #endif #ifdef WEBRTC_VIDEO_ENGINE_RTP_RTCP_API - , ViERTP_RTCPImpl(ViEBaseImpl::shared_data()) + ViERTP_RTCPImpl(ViEBaseImpl::shared_data()), #endif #ifdef WEBRTC_VIDEO_ENGINE_EXTERNAL_CODEC_API - , ViEExternalCodecImpl(ViEBaseImpl::shared_data()) + ViEExternalCodecImpl(ViEBaseImpl::shared_data()), #endif + own_config_(owns_config ? config : NULL) {} virtual ~VideoEngineImpl() {} + + private: + // Placeholder for the case where this owns the config. + scoped_ptr<const Config> own_config_; }; } // namespace webrtc diff --git a/video_engine/vie_input_manager.cc b/video_engine/vie_input_manager.cc index f7755574..964c4df8 100644 --- a/video_engine/vie_input_manager.cc +++ b/video_engine/vie_input_manager.cc @@ -26,8 +26,9 @@ namespace webrtc { -ViEInputManager::ViEInputManager(const int engine_id) - : engine_id_(engine_id), +ViEInputManager::ViEInputManager(const int engine_id, const Config& config) + : config_(config), + engine_id_(engine_id), map_cs_(CriticalSectionWrapper::CreateCriticalSection()), device_info_cs_(CriticalSectionWrapper::CreateCriticalSection()), vie_frame_provider_map_(), @@ -260,7 +261,7 @@ int ViEInputManager::CreateCaptureDevice( return kViECaptureDeviceMaxNoDevicesAllocated; } 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_); if (!vie_capture) { ReturnCaptureId(newcapture_id); @@ -299,7 +300,8 @@ int ViEInputManager::CreateCaptureDevice(VideoCaptureModule* capture_module, } 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) { ReturnCaptureId(newcapture_id); WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_), @@ -369,7 +371,7 @@ int ViEInputManager::CreateExternalCaptureDevice( } 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) { ReturnCaptureId(newcapture_id); WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(engine_id_), diff --git a/video_engine/vie_input_manager.h b/video_engine/vie_input_manager.h index d8921311..e76c646a 100644 --- a/video_engine/vie_input_manager.h +++ b/video_engine/vie_input_manager.h @@ -22,6 +22,7 @@ namespace webrtc { +class Config; class CriticalSectionWrapper; class ProcessThread; class RWLockWrapper; @@ -33,7 +34,7 @@ class VoiceEngine; class ViEInputManager : private ViEManagerBase { friend class ViEInputManagerScoped; public: - explicit ViEInputManager(int engine_id); + ViEInputManager(int engine_id, const Config& config); ~ViEInputManager(); void SetModuleProcessThread(ProcessThread* module_process_thread); @@ -109,6 +110,7 @@ class ViEInputManager : private ViEManagerBase { // Gets the ViEFilePlayer for this file_id. ViEFilePlayer* ViEFilePlayerPtr(int file_id) const; + const Config& config_; int engine_id_; scoped_ptr<CriticalSectionWrapper> map_cs_; scoped_ptr<CriticalSectionWrapper> device_info_cs_; diff --git a/video_engine/vie_shared_data.cc b/video_engine/vie_shared_data.cc index 574aa9a4..4e6ebcc0 100644 --- a/video_engine/vie_shared_data.cc +++ b/video_engine/vie_shared_data.cc @@ -22,14 +22,15 @@ namespace webrtc { // Active instance counter int ViESharedData::instance_counter_ = 0; -ViESharedData::ViESharedData() +ViESharedData::ViESharedData(const Config& config) : instance_id_(++instance_counter_), initialized_(false), number_cores_(CpuInfo::DetectNumberOfCores()), over_use_detector_options_(), channel_manager_(*new ViEChannelManager(instance_id_, number_cores_, - over_use_detector_options_)), - input_manager_(*new ViEInputManager(instance_id_)), + over_use_detector_options_, + config)), + input_manager_(*new ViEInputManager(instance_id_, config)), render_manager_(*new ViERenderManager(instance_id_)), module_process_thread_(ProcessThread::CreateProcessThread()), last_error_(0) { diff --git a/video_engine/vie_shared_data.h b/video_engine/vie_shared_data.h index 886cf67f..4b288868 100644 --- a/video_engine/vie_shared_data.h +++ b/video_engine/vie_shared_data.h @@ -18,6 +18,7 @@ namespace webrtc { +class Config; class ProcessThread; class ViEChannelManager; class ViEInputManager; @@ -25,7 +26,7 @@ class ViERenderManager; class ViESharedData { public: - ViESharedData(); + ViESharedData(const Config& config); ~ViESharedData(); bool Initialized() const; |