diff --git a/talk/app/webrtc/mediaconstraintsinterface.cc b/talk/app/webrtc/mediaconstraintsinterface.cc index c38369581..0ecadd691 100644 --- a/talk/app/webrtc/mediaconstraintsinterface.cc +++ b/talk/app/webrtc/mediaconstraintsinterface.cc @@ -97,6 +97,8 @@ const char MediaConstraintsInterface::kImprovedWifiBwe[] = "googImprovedWifiBwe"; const char MediaConstraintsInterface::kScreencastMinBitrate[] = "googScreencastMinBitrate"; +const char MediaConstraintsInterface::kSkipEncodingUnusedStreams[] = + "googSkipEncodingUnusedStreams"; // TODO(ronghuawu): Remove once cpu overuse detection is stable. const char MediaConstraintsInterface::kCpuOveruseDetection[] = "googCpuOveruseDetection"; diff --git a/talk/app/webrtc/mediaconstraintsinterface.h b/talk/app/webrtc/mediaconstraintsinterface.h index 1304d88d4..2ac251623 100644 --- a/talk/app/webrtc/mediaconstraintsinterface.h +++ b/talk/app/webrtc/mediaconstraintsinterface.h @@ -117,6 +117,8 @@ class MediaConstraintsInterface { // googSuspendBelowMinBitrate static const char kImprovedWifiBwe[]; // googImprovedWifiBwe static const char kScreencastMinBitrate[]; // googScreencastMinBitrate + static const char kSkipEncodingUnusedStreams[]; + // googSkipEncodingUnusedStreams static const char kCpuOveruseDetection[]; // googCpuOveruseDetection static const char kCpuUnderuseThreshold[]; // googCpuUnderuseThreshold static const char kCpuOveruseThreshold[]; // googCpuOveruseThreshold diff --git a/talk/app/webrtc/webrtcsession.cc b/talk/app/webrtc/webrtcsession.cc index 6f745fc42..ddc887629 100644 --- a/talk/app/webrtc/webrtcsession.cc +++ b/talk/app/webrtc/webrtcsession.cc @@ -548,6 +548,14 @@ bool WebRtcSession::Initialize( video_options_.suspend_below_min_bitrate.Set(value); } + if (FindConstraint( + constraints, + MediaConstraintsInterface::kSkipEncodingUnusedStreams, + &value, + NULL)) { + video_options_.skip_encoding_unused_streams.Set(value); + } + SetOptionFromOptionalConstraint(constraints, MediaConstraintsInterface::kScreencastMinBitrate, &video_options_.screencast_min_bitrate); diff --git a/talk/media/base/mediachannel.h b/talk/media/base/mediachannel.h index ac62d5e2d..60cdebda3 100644 --- a/talk/media/base/mediachannel.h +++ b/talk/media/base/mediachannel.h @@ -312,6 +312,8 @@ struct VideoOptions { video_start_bitrate.SetFrom(change.video_start_bitrate); video_temporal_layer_screencast.SetFrom( change.video_temporal_layer_screencast); + video_temporal_layer_realtime.SetFrom( + change.video_temporal_layer_realtime); video_leaky_bucket.SetFrom(change.video_leaky_bucket); video_highest_bitrate.SetFrom(change.video_highest_bitrate); cpu_overuse_detection.SetFrom(change.cpu_overuse_detection); @@ -334,6 +336,7 @@ struct VideoOptions { suspend_below_min_bitrate.SetFrom(change.suspend_below_min_bitrate); unsignalled_recv_stream_limit.SetFrom(change.unsignalled_recv_stream_limit); use_simulcast_adapter.SetFrom(change.use_simulcast_adapter); + skip_encoding_unused_streams.SetFrom(change.skip_encoding_unused_streams); screencast_min_bitrate.SetFrom(change.screencast_min_bitrate); use_improved_wifi_bandwidth_estimator.SetFrom( change.use_improved_wifi_bandwidth_estimator); @@ -351,6 +354,7 @@ struct VideoOptions { 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 && video_highest_bitrate == o.video_highest_bitrate && cpu_overuse_detection == o.cpu_overuse_detection && @@ -373,6 +377,7 @@ struct VideoOptions { suspend_below_min_bitrate == o.suspend_below_min_bitrate && unsignalled_recv_stream_limit == o.unsignalled_recv_stream_limit && use_simulcast_adapter == o.use_simulcast_adapter && + skip_encoding_unused_streams == o.skip_encoding_unused_streams && screencast_min_bitrate == o.screencast_min_bitrate && use_improved_wifi_bandwidth_estimator == o.use_improved_wifi_bandwidth_estimator && @@ -393,6 +398,8 @@ struct VideoOptions { ost << ToStringIfSet("start bitrate", video_start_bitrate); ost << ToStringIfSet("video temporal layer screencast", video_temporal_layer_screencast); + ost << ToStringIfSet("video temporal layer realtime", + video_temporal_layer_realtime); ost << ToStringIfSet("leaky bucket", video_leaky_bucket); ost << ToStringIfSet("highest video bitrate", video_highest_bitrate); ost << ToStringIfSet("cpu overuse detection", cpu_overuse_detection); @@ -416,6 +423,8 @@ struct VideoOptions { ost << ToStringIfSet("num channels for early receive", unsignalled_recv_stream_limit); ost << ToStringIfSet("use simulcast adapter", use_simulcast_adapter); + ost << ToStringIfSet("skip encoding unused streams", + skip_encoding_unused_streams); ost << ToStringIfSet("screencast min bitrate", screencast_min_bitrate); ost << ToStringIfSet("improved wifi bwe", use_improved_wifi_bandwidth_estimator); @@ -444,6 +453,8 @@ struct VideoOptions { Settable video_start_bitrate; // Experimental: Enable WebRTC layered screencast. Settable video_temporal_layer_screencast; + // Experimental: Enable WebRTC temporal layer strategy for realtime video. + Settable video_temporal_layer_realtime; // Enable WebRTC leaky bucket when sending media packets. Settable video_leaky_bucket; // Set highest bitrate mode for video. @@ -491,6 +502,9 @@ struct VideoOptions { Settable unsignalled_recv_stream_limit; // Enable use of simulcast adapter. Settable use_simulcast_adapter; + // Enables the encoder to skip encoding stream not actually sent due to too + // low available bit rate. + Settable skip_encoding_unused_streams; // Force screencast to use a minimum bitrate Settable screencast_min_bitrate; // Enable improved bandwidth estiamtor on wifi.