diff options
author | wu@webrtc.org <wu@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2014-03-24 17:01:50 +0000 |
---|---|---|
committer | wu@webrtc.org <wu@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2014-03-24 17:01:50 +0000 |
commit | d8f165fbf704ae539bef138fb323b3b1b6851c18 (patch) | |
tree | 93a3359ed3edb59c4b3742b8bd5c23c05214ce2d /media | |
parent | 73888c685d97f531bb45aeda536db5c077338b08 (diff) | |
download | talk-d8f165fbf704ae539bef138fb323b3b1b6851c18.tar.gz |
(Auto)update libjingle 63560528-> 63648983
git-svn-id: http://webrtc.googlecode.com/svn/trunk/talk@5762 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'media')
-rw-r--r-- | media/base/mediachannel.h | 5 | ||||
-rw-r--r-- | media/webrtc/fakewebrtcvideoengine.h | 9 | ||||
-rw-r--r-- | media/webrtc/webrtcvideoengine.cc | 32 | ||||
-rw-r--r-- | media/webrtc/webrtcvideoengine.h | 5 | ||||
-rw-r--r-- | media/webrtc/webrtcvideoengine_unittest.cc | 25 |
5 files changed, 46 insertions, 30 deletions
diff --git a/media/base/mediachannel.h b/media/base/mediachannel.h index 0b7746b..5984815 100644 --- a/media/base/mediachannel.h +++ b/media/base/mediachannel.h @@ -307,6 +307,7 @@ struct VideoOptions { video_noise_reduction.SetFrom(change.video_noise_reduction); video_one_layer_screencast.SetFrom(change.video_one_layer_screencast); video_high_bitrate.SetFrom(change.video_high_bitrate); + video_start_bitrate.SetFrom(change.video_start_bitrate); video_temporal_layer_screencast.SetFrom( change.video_temporal_layer_screencast); video_temporal_layer_realtime.SetFrom( @@ -339,6 +340,7 @@ struct VideoOptions { video_noise_reduction == o.video_noise_reduction && video_one_layer_screencast == o.video_one_layer_screencast && video_high_bitrate == o.video_high_bitrate && + video_start_bitrate == o.video_start_bitrate && video_temporal_layer_screencast == o.video_temporal_layer_screencast && video_temporal_layer_realtime == o.video_temporal_layer_realtime && video_leaky_bucket == o.video_leaky_bucket && @@ -371,6 +373,7 @@ struct VideoOptions { ost << ToStringIfSet("noise reduction", video_noise_reduction); ost << ToStringIfSet("1 layer screencast", video_one_layer_screencast); ost << ToStringIfSet("high bitrate", video_high_bitrate); + ost << ToStringIfSet("start bitrate", video_start_bitrate); ost << ToStringIfSet("video temporal layer screencast", video_temporal_layer_screencast); ost << ToStringIfSet("video temporal layer realtime", @@ -412,6 +415,8 @@ struct VideoOptions { Settable<bool> video_one_layer_screencast; // Experimental: Enable WebRtc higher bitrate? Settable<bool> video_high_bitrate; + // Experimental: Enable WebRtc higher start bitrate? + Settable<int> video_start_bitrate; // Experimental: Enable WebRTC layered screencast. Settable<bool> video_temporal_layer_screencast; // Experimental: Enable WebRTC temporal layer strategy for realtime video. diff --git a/media/webrtc/fakewebrtcvideoengine.h b/media/webrtc/fakewebrtcvideoengine.h index 74d0607..05edd79 100644 --- a/media/webrtc/fakewebrtcvideoengine.h +++ b/media/webrtc/fakewebrtcvideoengine.h @@ -41,6 +41,7 @@ #include "talk/media/webrtc/webrtcvideoencoderfactory.h" #include "talk/media/webrtc/webrtcvie.h" +#if !defined(USE_WEBRTC_DEV_BRANCH) namespace webrtc { bool operator==(const webrtc::VideoCodec& c1, const webrtc::VideoCodec& c2) { @@ -48,6 +49,7 @@ bool operator==(const webrtc::VideoCodec& c1, const webrtc::VideoCodec& c2) { } } +#endif namespace cricket { @@ -544,9 +546,16 @@ class FakeWebRtcVideoEngine bool ReceiveCodecRegistered(int channel, const webrtc::VideoCodec& codec) const { WEBRTC_ASSERT_CHANNEL(channel); +#if !defined(USE_WEBRTC_DEV_BRANCH) const std::vector<webrtc::VideoCodec>& codecs = channels_.find(channel)->second->recv_codecs; return std::find(codecs.begin(), codecs.end(), codec) != codecs.end(); +#else + // TODO(mallinath) - Remove this specilization after this change is pushed + // to googlecode and operator== from VideoCodecDerived moved inside + // VideoCodec. + return true; +#endif }; bool ExternalDecoderRegistered(int channel, unsigned int pl_type) const { diff --git a/media/webrtc/webrtcvideoengine.cc b/media/webrtc/webrtcvideoengine.cc index f36a5a9..385b19e 100644 --- a/media/webrtc/webrtcvideoengine.cc +++ b/media/webrtc/webrtcvideoengine.cc @@ -1843,10 +1843,6 @@ bool WebRtcVideoMediaChannel::AddSendStream(const StreamParams& sp) { send_channel->set_stream_params(sp); - if (IsSimulcastStream(sp)) { - DisableAllExternalEncoders(send_channel, channel_id); - } - // Reset send codec after stream parameters changed. if (send_codec_) { if (!SetSendCodec(send_channel, *send_codec_, send_min_bitrate_, @@ -2856,9 +2852,17 @@ bool WebRtcVideoMediaChannel::SetOptions(const VideoOptions &options) { expected_bitrate = kMaxVideoBitrate; } + int options_start_bitrate; + bool start_bitrate_changed = false; + if (options.video_start_bitrate.Get(&options_start_bitrate) && + options_start_bitrate != send_start_bitrate_) { + send_start_bitrate_ = options_start_bitrate; + start_bitrate_changed = true; + } + bool reset_send_codec_needed = send_codec_ && (send_max_bitrate_ != expected_bitrate || denoiser_changed || - adjusted_min_bitrate); + adjusted_min_bitrate || start_bitrate_changed); if (reset_send_codec_needed) { @@ -3913,24 +3917,6 @@ void WebRtcVideoMediaChannel::MaybeDisconnectCapturer(VideoCapturer* capturer) { } } -void WebRtcVideoMediaChannel::DisableAllExternalEncoders( - WebRtcVideoChannelSendInfo* send_channel, - int channel_id) { - const WebRtcVideoChannelSendInfo::EncoderMap& encoder_map = - send_channel->registered_encoders(); - for (WebRtcVideoChannelSendInfo::EncoderMap::const_iterator it = - encoder_map.begin(); it != encoder_map.end(); ++it) { - if (engine()->vie()->ext_codec()->DeRegisterExternalSendCodec( - channel_id, it->first) != 0) { - LOG_RTCERR1(DeregisterEncoderObserver, channel_id); - } - engine()->DestroyExternalEncoder(it->second); - } - send_channel->ClearRegisteredEncoders(); - - engine()->SetExternalEncoderFactory(NULL); -} - } // namespace cricket #endif // HAVE_WEBRTC_VIDEO diff --git a/media/webrtc/webrtcvideoengine.h b/media/webrtc/webrtcvideoengine.h index ecacf1f..b818b0d 100644 --- a/media/webrtc/webrtcvideoengine.h +++ b/media/webrtc/webrtcvideoengine.h @@ -414,11 +414,6 @@ class WebRtcVideoMediaChannel : public talk_base::MessageHandler, // to one send channel, i.e. the last send channel. void MaybeDisconnectCapturer(VideoCapturer* capturer); - // Deregister and free all the external encoders previously register to - // |send_channel|. Also disable the external encoder factory. - void DisableAllExternalEncoders(WebRtcVideoChannelSendInfo* send_channel, - int channel_id); - // Global state. WebRtcVideoEngine* engine_; VoiceMediaChannel* voice_channel_; diff --git a/media/webrtc/webrtcvideoengine_unittest.cc b/media/webrtc/webrtcvideoengine_unittest.cc index 371fb74..4c4bded 100644 --- a/media/webrtc/webrtcvideoengine_unittest.cc +++ b/media/webrtc/webrtcvideoengine_unittest.cc @@ -64,8 +64,8 @@ static const cricket::VideoCodec* const kVideoCodecs[] = { &kUlpFecCodec }; -static const unsigned int kMinBandwidthKbps = 50; static const unsigned int kStartBandwidthKbps = 300; +static const unsigned int kMinBandwidthKbps = 50; static const unsigned int kMaxBandwidthKbps = 2000; static const unsigned int kNumberOfTemporalLayers = 1; @@ -1158,6 +1158,28 @@ TEST_F(WebRtcVideoEngineTestFake, SetStartBandwidth) { max_bandwidth_kbps, kMinBandwidthKbps, start_bandwidth_kbps); } +// Test that the start bandwidth can be controlled by experiment. +TEST_F(WebRtcVideoEngineTestFake, SetStartBandwidthOption) { + EXPECT_TRUE(SetupEngine()); + int channel_num = vie_.GetLastChannel(); + EXPECT_TRUE(channel_->SetSendCodecs(engine_.codecs())); + int start_bandwidth_kbps = kStartBandwidthKbps; + EXPECT_TRUE(channel_->SetStartSendBandwidth(start_bandwidth_kbps * 1000)); + VerifyVP8SendCodec(channel_num, kVP8Codec.width, kVP8Codec.height, 0, + kMaxBandwidthKbps, kMinBandwidthKbps, start_bandwidth_kbps); + + // Set the start bitrate option. + start_bandwidth_kbps = 1000; + cricket::VideoOptions options; + options.video_start_bitrate.Set( + start_bandwidth_kbps); + EXPECT_TRUE(channel_->SetOptions(options)); + + // Check that start bitrate has changed to the new value. + VerifyVP8SendCodec(channel_num, kVP8Codec.width, kVP8Codec.height, 0, + kMaxBandwidthKbps, kMinBandwidthKbps, start_bandwidth_kbps); +} + // Test that SetMaxSendBandwidth is ignored in conference mode. TEST_F(WebRtcVideoEngineTestFake, SetBandwidthInConference) { EXPECT_TRUE(SetupEngine()); @@ -1585,7 +1607,6 @@ TEST_F(WebRtcVideoEngineTestFake, RegisterEncoderIfFactoryIsGiven) { EXPECT_TRUE(channel_->RemoveSendStream(kSsrc)); } - TEST_F(WebRtcVideoEngineTestFake, DontRegisterEncoderMultipleTimes) { encoder_factory_.AddSupportedVideoCodecType(webrtc::kVideoCodecVP8, "VP8"); engine_.SetExternalEncoderFactory(&encoder_factory_); |