OLD | NEW |
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 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1876 encoder_config.content_type = | 1876 encoder_config.content_type = |
1877 webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo; | 1877 webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo; |
1878 } | 1878 } |
1879 | 1879 |
1880 // By default, the stream count for the codec configuration should match the | 1880 // By default, the stream count for the codec configuration should match the |
1881 // number of negotiated ssrcs. But if the codec is blacklisted for simulcast | 1881 // number of negotiated ssrcs. But if the codec is blacklisted for simulcast |
1882 // or a screencast (and not in simulcast screenshare experiment), only | 1882 // or a screencast (and not in simulcast screenshare experiment), only |
1883 // configure a single stream. | 1883 // configure a single stream. |
1884 encoder_config.number_of_streams = parameters_.config.rtp.ssrcs.size(); | 1884 encoder_config.number_of_streams = parameters_.config.rtp.ssrcs.size(); |
1885 if (IsCodecBlacklistedForSimulcast(codec.name) || | 1885 if (IsCodecBlacklistedForSimulcast(codec.name) || |
1886 (is_screencast && !UseSimulcastScreenshare())) { | 1886 (is_screencast && |
| 1887 (!UseSimulcastScreenshare() || !parameters_.conference_mode))) { |
1887 encoder_config.number_of_streams = 1; | 1888 encoder_config.number_of_streams = 1; |
1888 } | 1889 } |
1889 | 1890 |
1890 int stream_max_bitrate = parameters_.max_bitrate_bps; | 1891 int stream_max_bitrate = parameters_.max_bitrate_bps; |
1891 if (rtp_parameters_.encodings[0].max_bitrate_bps) { | 1892 if (rtp_parameters_.encodings[0].max_bitrate_bps) { |
1892 stream_max_bitrate = | 1893 stream_max_bitrate = |
1893 MinPositive(*(rtp_parameters_.encodings[0].max_bitrate_bps), | 1894 MinPositive(*(rtp_parameters_.encodings[0].max_bitrate_bps), |
1894 parameters_.max_bitrate_bps); | 1895 parameters_.max_bitrate_bps); |
1895 } | 1896 } |
1896 | 1897 |
1897 int codec_max_bitrate_kbps; | 1898 int codec_max_bitrate_kbps; |
1898 if (codec.GetParam(kCodecParamMaxBitrate, &codec_max_bitrate_kbps)) { | 1899 if (codec.GetParam(kCodecParamMaxBitrate, &codec_max_bitrate_kbps)) { |
1899 stream_max_bitrate = codec_max_bitrate_kbps * 1000; | 1900 stream_max_bitrate = codec_max_bitrate_kbps * 1000; |
1900 } | 1901 } |
1901 encoder_config.max_bitrate_bps = stream_max_bitrate; | 1902 encoder_config.max_bitrate_bps = stream_max_bitrate; |
1902 | 1903 |
1903 int max_qp = kDefaultQpMax; | 1904 int max_qp = kDefaultQpMax; |
1904 codec.GetParam(kCodecParamMaxQuantization, &max_qp); | 1905 codec.GetParam(kCodecParamMaxQuantization, &max_qp); |
1905 encoder_config.video_stream_factory = | 1906 encoder_config.video_stream_factory = |
1906 new rtc::RefCountedObject<EncoderStreamFactory>( | 1907 new rtc::RefCountedObject<EncoderStreamFactory>( |
1907 codec.name, max_qp, kDefaultVideoMaxFramerate, is_screencast, | 1908 codec.name, max_qp, kDefaultVideoMaxFramerate, is_screencast, |
1908 parameters_.conference_mode); | 1909 parameters_.conference_mode); |
1909 return encoder_config; | 1910 return encoder_config; |
1910 } | 1911 } |
1911 | 1912 |
1912 void WebRtcVideoChannel2::WebRtcVideoSendStream::ReconfigureEncoder() { | 1913 void WebRtcVideoChannel2::WebRtcVideoSendStream::ReconfigureEncoder() { |
1913 RTC_DCHECK_RUN_ON(&thread_checker_); | 1914 RTC_DCHECK_RUN_ON(&thread_checker_); |
1914 if (!stream_) { | 1915 if (!stream_) { |
1915 // The webrtc::VideoSendStream |stream_|has not yet been created but other | 1916 // The webrtc::VideoSendStream |stream_| has not yet been created but other |
1916 // parameters has changed. | 1917 // parameters has changed. |
1917 return; | 1918 return; |
1918 } | 1919 } |
1919 | 1920 |
1920 RTC_DCHECK_GT(parameters_.encoder_config.number_of_streams, 0); | 1921 RTC_DCHECK_GT(parameters_.encoder_config.number_of_streams, 0); |
1921 | 1922 |
1922 RTC_CHECK(parameters_.codec_settings); | 1923 RTC_CHECK(parameters_.codec_settings); |
1923 VideoCodecSettings codec_settings = *parameters_.codec_settings; | 1924 VideoCodecSettings codec_settings = *parameters_.codec_settings; |
1924 | 1925 |
1925 webrtc::VideoEncoderConfig encoder_config = | 1926 webrtc::VideoEncoderConfig encoder_config = |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2559 rtx_mapping[video_codecs[i].codec.id] != | 2560 rtx_mapping[video_codecs[i].codec.id] != |
2560 ulpfec_config.red_payload_type) { | 2561 ulpfec_config.red_payload_type) { |
2561 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2562 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
2562 } | 2563 } |
2563 } | 2564 } |
2564 | 2565 |
2565 return video_codecs; | 2566 return video_codecs; |
2566 } | 2567 } |
2567 | 2568 |
2568 } // namespace cricket | 2569 } // namespace cricket |
OLD | NEW |