Remove the video channel id completely.

BUG=webrtc:5079

Review URL: https://codereview.webrtc.org/1412143002

Cr-Commit-Position: refs/heads/master@{#10324}
This commit is contained in:
mflodman
2015-10-19 08:12:12 -07:00
committed by Commit bot
parent f56eca031c
commit 0dbf0090a9
8 changed files with 12 additions and 29 deletions

View File

@ -95,7 +95,6 @@ class Call : public webrtc::Call, public PacketReceiver {
const int num_cpu_cores_;
const rtc::scoped_ptr<ProcessThread> module_process_thread_;
const rtc::scoped_ptr<ChannelGroup> 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.

View File

@ -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)

View File

@ -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);

View File

@ -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<uint32_t, RtpState>& suspended_ssrcs)
@ -140,7 +139,7 @@ VideoSendStream::VideoSendStream(
const std::vector<uint32_t>& 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());

View File

@ -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<uint32_t, RtpState>& suspended_ssrcs);

View File

@ -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,

View File

@ -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_)

View File

@ -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<VideoProcessingModule> vpm_;