Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: webrtc/media/engine/webrtcvideoengine2.cc

Issue 2795043004: Use simulcast for screenshare only in conference mode (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after
1865 encoder_config.content_type = 1865 encoder_config.content_type =
1866 webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo; 1866 webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo;
1867 } 1867 }
1868 1868
1869 // By default, the stream count for the codec configuration should match the 1869 // By default, the stream count for the codec configuration should match the
1870 // number of negotiated ssrcs. But if the codec is blacklisted for simulcast 1870 // number of negotiated ssrcs. But if the codec is blacklisted for simulcast
1871 // or a screencast (and not in simulcast screenshare experiment), only 1871 // or a screencast (and not in simulcast screenshare experiment), only
1872 // configure a single stream. 1872 // configure a single stream.
1873 encoder_config.number_of_streams = parameters_.config.rtp.ssrcs.size(); 1873 encoder_config.number_of_streams = parameters_.config.rtp.ssrcs.size();
1874 if (IsCodecBlacklistedForSimulcast(codec.name) || 1874 if (IsCodecBlacklistedForSimulcast(codec.name) ||
1875 (is_screencast && !UseSimulcastScreenshare())) { 1875 (is_screencast &&
1876 (!UseSimulcastScreenshare() || !parameters_.conference_mode))) {
1876 encoder_config.number_of_streams = 1; 1877 encoder_config.number_of_streams = 1;
1877 } 1878 }
1878 1879
1879 int stream_max_bitrate = parameters_.max_bitrate_bps; 1880 int stream_max_bitrate = parameters_.max_bitrate_bps;
1880 if (rtp_parameters_.encodings[0].max_bitrate_bps) { 1881 if (rtp_parameters_.encodings[0].max_bitrate_bps) {
1881 stream_max_bitrate = 1882 stream_max_bitrate =
1882 MinPositive(*(rtp_parameters_.encodings[0].max_bitrate_bps), 1883 MinPositive(*(rtp_parameters_.encodings[0].max_bitrate_bps),
1883 parameters_.max_bitrate_bps); 1884 parameters_.max_bitrate_bps);
1884 } 1885 }
1885 1886
1886 int codec_max_bitrate_kbps; 1887 int codec_max_bitrate_kbps;
1887 if (codec.GetParam(kCodecParamMaxBitrate, &codec_max_bitrate_kbps)) { 1888 if (codec.GetParam(kCodecParamMaxBitrate, &codec_max_bitrate_kbps)) {
1888 stream_max_bitrate = codec_max_bitrate_kbps * 1000; 1889 stream_max_bitrate = codec_max_bitrate_kbps * 1000;
1889 } 1890 }
1890 encoder_config.max_bitrate_bps = stream_max_bitrate; 1891 encoder_config.max_bitrate_bps = stream_max_bitrate;
1891 1892
1892 int max_qp = kDefaultQpMax; 1893 int max_qp = kDefaultQpMax;
1893 codec.GetParam(kCodecParamMaxQuantization, &max_qp); 1894 codec.GetParam(kCodecParamMaxQuantization, &max_qp);
1894 encoder_config.video_stream_factory = 1895 encoder_config.video_stream_factory =
1895 new rtc::RefCountedObject<EncoderStreamFactory>( 1896 new rtc::RefCountedObject<EncoderStreamFactory>(
1896 codec.name, max_qp, kDefaultVideoMaxFramerate, is_screencast, 1897 codec.name, max_qp, kDefaultVideoMaxFramerate, is_screencast,
1897 parameters_.conference_mode); 1898 parameters_.conference_mode);
1898 return encoder_config; 1899 return encoder_config;
1899 } 1900 }
1900 1901
1901 void WebRtcVideoChannel2::WebRtcVideoSendStream::ReconfigureEncoder() { 1902 void WebRtcVideoChannel2::WebRtcVideoSendStream::ReconfigureEncoder() {
1902 RTC_DCHECK_RUN_ON(&thread_checker_); 1903 RTC_DCHECK_RUN_ON(&thread_checker_);
1903 if (!stream_) { 1904 if (!stream_) {
1904 // The webrtc::VideoSendStream |stream_|has not yet been created but other 1905 // The webrtc::VideoSendStream |stream_| has not yet been created but other
1905 // parameters has changed. 1906 // parameters has changed.
1906 return; 1907 return;
1907 } 1908 }
1908 1909
1909 RTC_DCHECK_GT(parameters_.encoder_config.number_of_streams, 0); 1910 RTC_DCHECK_GT(parameters_.encoder_config.number_of_streams, 0);
1910 1911
1911 RTC_CHECK(parameters_.codec_settings); 1912 RTC_CHECK(parameters_.codec_settings);
1912 VideoCodecSettings codec_settings = *parameters_.codec_settings; 1913 VideoCodecSettings codec_settings = *parameters_.codec_settings;
1913 1914
1914 webrtc::VideoEncoderConfig encoder_config = 1915 webrtc::VideoEncoderConfig encoder_config =
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
2542 rtx_mapping[video_codecs[i].codec.id] != 2543 rtx_mapping[video_codecs[i].codec.id] !=
2543 ulpfec_config.red_payload_type) { 2544 ulpfec_config.red_payload_type) {
2544 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; 2545 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id];
2545 } 2546 }
2546 } 2547 }
2547 2548
2548 return video_codecs; 2549 return video_codecs;
2549 } 2550 }
2550 2551
2551 } // namespace cricket 2552 } // namespace cricket
OLDNEW
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698