diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc index c2b1ec7950..9a036c9ede 100644 --- a/webrtc/call/call.cc +++ b/webrtc/call/call.cc @@ -95,7 +95,6 @@ class Call : public webrtc::Call, public PacketReceiver { const int num_cpu_cores_; const rtc::scoped_ptr module_process_thread_; const rtc::scoped_ptr channel_group_; - volatile int next_channel_id_; Call::Config config_; rtc::ThreadChecker configuration_thread_checker_; @@ -140,7 +139,6 @@ Call::Call(const Call::Config& config) : num_cpu_cores_(CpuInfo::DetectNumberOfCores()), module_process_thread_(ProcessThread::Create("ModuleProcessThread")), channel_group_(new ChannelGroup(module_process_thread_.get())), - next_channel_id_(0), config_(config), network_enabled_(true), receive_crit_(RWLockWrapper::CreateRWLock()), @@ -274,9 +272,8 @@ webrtc::VideoSendStream* Call::CreateVideoSendStream( // TODO(mflodman): Base the start bitrate on a current bandwidth estimate, if // the call has already started. VideoSendStream* send_stream = new VideoSendStream(num_cpu_cores_, - module_process_thread_.get(), channel_group_.get(), - rtc::AtomicOps::Increment(&next_channel_id_), config, encoder_config, - suspended_video_send_ssrcs_); + module_process_thread_.get(), channel_group_.get(), config, + encoder_config, suspended_video_send_ssrcs_); // This needs to be taken before send_crit_ as both locks need to be held // while changing network state. @@ -335,9 +332,8 @@ webrtc::VideoReceiveStream* Call::CreateVideoReceiveStream( TRACE_EVENT0("webrtc", "Call::CreateVideoReceiveStream"); RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); VideoReceiveStream* receive_stream = new VideoReceiveStream( - num_cpu_cores_, channel_group_.get(), - rtc::AtomicOps::Increment(&next_channel_id_), config, - config_.voice_engine, module_process_thread_.get()); + num_cpu_cores_, channel_group_.get(), config, config_.voice_engine, + module_process_thread_.get()); // This needs to be taken before receive_crit_ as both locks need to be held // while changing network state. diff --git a/webrtc/video/video_receive_stream.cc b/webrtc/video/video_receive_stream.cc index 036f623663..9aa7da1456 100644 --- a/webrtc/video/video_receive_stream.cc +++ b/webrtc/video/video_receive_stream.cc @@ -140,7 +140,6 @@ VideoCodec CreateDecoderVideoCodec(const VideoReceiveStream::Decoder& decoder) { VideoReceiveStream::VideoReceiveStream(int num_cpu_cores, ChannelGroup* channel_group, - int channel_id, const VideoReceiveStream::Config& config, webrtc::VoiceEngine* voice_engine, ProcessThread* process_thread) diff --git a/webrtc/video/video_receive_stream.h b/webrtc/video/video_receive_stream.h index 6d00942df4..011788d6b8 100644 --- a/webrtc/video/video_receive_stream.h +++ b/webrtc/video/video_receive_stream.h @@ -39,7 +39,6 @@ class VideoReceiveStream : public webrtc::VideoReceiveStream, public: VideoReceiveStream(int num_cpu_cores, ChannelGroup* channel_group, - int channel_id, const VideoReceiveStream::Config& config, webrtc::VoiceEngine* voice_engine, ProcessThread* process_thread); diff --git a/webrtc/video/video_send_stream.cc b/webrtc/video/video_send_stream.cc index b53fd9f914..b7b0150e8e 100644 --- a/webrtc/video/video_send_stream.cc +++ b/webrtc/video/video_send_stream.cc @@ -112,7 +112,6 @@ VideoSendStream::VideoSendStream( int num_cpu_cores, ProcessThread* module_process_thread, ChannelGroup* channel_group, - int channel_id, const VideoSendStream::Config& config, const VideoEncoderConfig& encoder_config, const std::map& suspended_ssrcs) @@ -140,7 +139,7 @@ VideoSendStream::VideoSendStream( const std::vector& ssrcs = config.rtp.ssrcs; vie_encoder_.reset(new ViEEncoder( - channel_id, num_cpu_cores, module_process_thread_, &stats_proxy_, + num_cpu_cores, module_process_thread_, &stats_proxy_, config.pre_encode_callback, channel_group_->pacer(), channel_group_->bitrate_allocator())); RTC_CHECK(vie_encoder_->Init()); diff --git a/webrtc/video/video_send_stream.h b/webrtc/video/video_send_stream.h index 874d00ff05..68473b1f1d 100644 --- a/webrtc/video/video_send_stream.h +++ b/webrtc/video/video_send_stream.h @@ -40,7 +40,6 @@ class VideoSendStream : public webrtc::VideoSendStream, VideoSendStream(int num_cpu_cores, ProcessThread* module_process_thread, ChannelGroup* channel_group, - int channel_id, const VideoSendStream::Config& config, const VideoEncoderConfig& encoder_config, const std::map& suspended_ssrcs); diff --git a/webrtc/video_engine/encoder_state_feedback_unittest.cc b/webrtc/video_engine/encoder_state_feedback_unittest.cc index b61fc56b4c..9787acc144 100644 --- a/webrtc/video_engine/encoder_state_feedback_unittest.cc +++ b/webrtc/video_engine/encoder_state_feedback_unittest.cc @@ -32,7 +32,7 @@ namespace webrtc { class MockVieEncoder : public ViEEncoder { public: explicit MockVieEncoder(ProcessThread* process_thread, PacedSender* pacer) - : ViEEncoder(1, 1, process_thread, nullptr, nullptr, pacer, nullptr) {} + : ViEEncoder(1, process_thread, nullptr, nullptr, pacer, nullptr) {} ~MockVieEncoder() {} MOCK_METHOD1(OnReceivedIntraFrameRequest, diff --git a/webrtc/video_engine/vie_encoder.cc b/webrtc/video_engine/vie_encoder.cc index 4d41e0e1ae..340a78ef33 100644 --- a/webrtc/video_engine/vie_encoder.cc +++ b/webrtc/video_engine/vie_encoder.cc @@ -102,15 +102,13 @@ class ViEBitrateObserver : public BitrateObserver { ViEEncoder* owner_; }; -ViEEncoder::ViEEncoder(int32_t channel_id, - uint32_t number_of_cores, +ViEEncoder::ViEEncoder(uint32_t number_of_cores, ProcessThread* module_process_thread, SendStatisticsProxy* stats_proxy, I420FrameCallback* pre_encode_callback, PacedSender* pacer, BitrateAllocator* bitrate_allocator) - : channel_id_(channel_id), - number_of_cores_(number_of_cores), + : number_of_cores_(number_of_cores), vpm_(VideoProcessingModule::Create()), qm_callback_(new QMVideoSettingsCallback(vpm_.get())), vcm_(VideoCodingModule::Create(Clock::GetRealTimeClock(), @@ -176,10 +174,6 @@ void ViEEncoder::StopThreadsAndRemoveSharedMembers() { ViEEncoder::~ViEEncoder() { } -int ViEEncoder::Owner() const { - return channel_id_; -} - void ViEEncoder::SetNetworkTransmissionState(bool is_transmitting) { { CriticalSectionScoped cs(data_cs_.get()); @@ -689,8 +683,9 @@ void ViEEncoder::OnNetworkChanged(uint32_t bitrate_bps, if (video_suspended_ == video_is_suspended) return; video_suspended_ = video_is_suspended; - LOG(LS_INFO) << "Video suspended " << video_is_suspended - << " for channel " << channel_id_; + + LOG(LS_INFO) << "Video suspend state changed " << video_is_suspended + << " for ssrc " << ssrc_streams_.begin()->first; } // Video suspend-state changed, inform codec observer. if (stats_proxy_) diff --git a/webrtc/video_engine/vie_encoder.h b/webrtc/video_engine/vie_encoder.h index ec4a82a634..6b4449f149 100644 --- a/webrtc/video_engine/vie_encoder.h +++ b/webrtc/video_engine/vie_encoder.h @@ -49,8 +49,7 @@ class ViEEncoder : public RtcpIntraFrameObserver, public: friend class ViEBitrateObserver; - ViEEncoder(int32_t channel_id, - uint32_t number_of_cores, + ViEEncoder(uint32_t number_of_cores, ProcessThread* module_process_thread, SendStatisticsProxy* stats_proxy, I420FrameCallback* pre_encode_callback, @@ -145,8 +144,6 @@ class ViEEncoder : public RtcpIntraFrameObserver, void RegisterPostEncodeImageCallback( EncodedImageCallback* post_encode_callback); - int channel_id() const { return channel_id_; } - int GetPaddingNeededBps() const; protected: @@ -160,7 +157,6 @@ class ViEEncoder : public RtcpIntraFrameObserver, void TraceFrameDropStart() EXCLUSIVE_LOCKS_REQUIRED(data_cs_); void TraceFrameDropEnd() EXCLUSIVE_LOCKS_REQUIRED(data_cs_); - const int channel_id_; const uint32_t number_of_cores_; const rtc::scoped_ptr vpm_;