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 1846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1857 } | 1857 } |
1858 | 1858 |
1859 // By default, the stream count for the codec configuration should match the | 1859 // By default, the stream count for the codec configuration should match the |
1860 // number of negotiated ssrcs. But if the codec is blacklisted for simulcast | 1860 // number of negotiated ssrcs. But if the codec is blacklisted for simulcast |
1861 // or a screencast, only configure a single stream. | 1861 // or a screencast, only configure a single stream. |
1862 encoder_config.number_of_streams = parameters_.config.rtp.ssrcs.size(); | 1862 encoder_config.number_of_streams = parameters_.config.rtp.ssrcs.size(); |
1863 if (IsCodecBlacklistedForSimulcast(codec.name) || is_screencast) { | 1863 if (IsCodecBlacklistedForSimulcast(codec.name) || is_screencast) { |
1864 encoder_config.number_of_streams = 1; | 1864 encoder_config.number_of_streams = 1; |
1865 } | 1865 } |
1866 | 1866 |
1867 int stream_max_bitrate = | 1867 int stream_max_bitrate = parameters_.max_bitrate_bps; |
1868 MinPositive(rtp_parameters_.encodings[0].max_bitrate_bps, | 1868 if (rtp_parameters_.encodings[0].max_bitrate_bps) { |
1869 parameters_.max_bitrate_bps); | 1869 stream_max_bitrate = |
| 1870 MinPositive(*(rtp_parameters_.encodings[0].max_bitrate_bps), |
| 1871 parameters_.max_bitrate_bps); |
| 1872 } |
1870 | 1873 |
1871 int codec_max_bitrate_kbps; | 1874 int codec_max_bitrate_kbps; |
1872 if (codec.GetParam(kCodecParamMaxBitrate, &codec_max_bitrate_kbps)) { | 1875 if (codec.GetParam(kCodecParamMaxBitrate, &codec_max_bitrate_kbps)) { |
1873 stream_max_bitrate = codec_max_bitrate_kbps * 1000; | 1876 stream_max_bitrate = codec_max_bitrate_kbps * 1000; |
1874 } | 1877 } |
1875 encoder_config.max_bitrate_bps = stream_max_bitrate; | 1878 encoder_config.max_bitrate_bps = stream_max_bitrate; |
1876 | 1879 |
1877 int max_qp = kDefaultQpMax; | 1880 int max_qp = kDefaultQpMax; |
1878 codec.GetParam(kCodecParamMaxQuantization, &max_qp); | 1881 codec.GetParam(kCodecParamMaxQuantization, &max_qp); |
1879 encoder_config.video_stream_factory = | 1882 encoder_config.video_stream_factory = |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2516 rtx_mapping[video_codecs[i].codec.id] != | 2519 rtx_mapping[video_codecs[i].codec.id] != |
2517 ulpfec_config.red_payload_type) { | 2520 ulpfec_config.red_payload_type) { |
2518 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2521 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
2519 } | 2522 } |
2520 } | 2523 } |
2521 | 2524 |
2522 return video_codecs; | 2525 return video_codecs; |
2523 } | 2526 } |
2524 | 2527 |
2525 } // namespace cricket | 2528 } // namespace cricket |
OLD | NEW |