OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 RTC_DCHECK(config.spatial_layers.empty() || | 170 RTC_DCHECK(config.spatial_layers.empty() || |
171 config.spatial_layers.size() == | 171 config.spatial_layers.size() == |
172 video_codec.VP9()->numberOfSpatialLayers); | 172 video_codec.VP9()->numberOfSpatialLayers); |
173 RTC_DCHECK_LE(video_codec.VP9()->numberOfSpatialLayers, | 173 RTC_DCHECK_LE(video_codec.VP9()->numberOfSpatialLayers, |
174 kMaxSimulcastStreams); | 174 kMaxSimulcastStreams); |
175 for (size_t i = 0; i < config.spatial_layers.size(); ++i) | 175 for (size_t i = 0; i < config.spatial_layers.size(); ++i) |
176 video_codec.spatialLayers[i] = config.spatial_layers[i]; | 176 video_codec.spatialLayers[i] = config.spatial_layers[i]; |
177 } | 177 } |
178 for (size_t i = 0; i < streams.size(); ++i) { | 178 for (size_t i = 0; i < streams.size(); ++i) { |
179 SimulcastStream* sim_stream = &video_codec.simulcastStream[i]; | 179 SimulcastStream* sim_stream = &video_codec.simulcastStream[i]; |
180 RTC_DCHECK_GT(streams[i].width, 0u); | 180 RTC_DCHECK_GT(streams[i].width, 0); |
181 RTC_DCHECK_GT(streams[i].height, 0u); | 181 RTC_DCHECK_GT(streams[i].height, 0); |
182 RTC_DCHECK_GT(streams[i].max_framerate, 0); | 182 RTC_DCHECK_GT(streams[i].max_framerate, 0); |
183 // Different framerates not supported per stream at the moment. | 183 // Different framerates not supported per stream at the moment. |
184 RTC_DCHECK_EQ(streams[i].max_framerate, streams[0].max_framerate); | 184 RTC_DCHECK_EQ(streams[i].max_framerate, streams[0].max_framerate); |
185 RTC_DCHECK_GE(streams[i].min_bitrate_bps, 0); | 185 RTC_DCHECK_GE(streams[i].min_bitrate_bps, 0); |
186 RTC_DCHECK_GE(streams[i].target_bitrate_bps, streams[i].min_bitrate_bps); | 186 RTC_DCHECK_GE(streams[i].target_bitrate_bps, streams[i].min_bitrate_bps); |
187 RTC_DCHECK_GE(streams[i].max_bitrate_bps, streams[i].target_bitrate_bps); | 187 RTC_DCHECK_GE(streams[i].max_bitrate_bps, streams[i].target_bitrate_bps); |
188 RTC_DCHECK_GE(streams[i].max_qp, 0); | 188 RTC_DCHECK_GE(streams[i].max_qp, 0); |
189 | 189 |
190 sim_stream->width = static_cast<uint16_t>(streams[i].width); | 190 sim_stream->width = static_cast<uint16_t>(streams[i].width); |
191 sim_stream->height = static_cast<uint16_t>(streams[i].height); | 191 sim_stream->height = static_cast<uint16_t>(streams[i].height); |
(...skipping 24 matching lines...) Expand all Loading... |
216 } | 216 } |
217 if (video_codec.maxBitrate < kEncoderMinBitrateKbps) | 217 if (video_codec.maxBitrate < kEncoderMinBitrateKbps) |
218 video_codec.maxBitrate = kEncoderMinBitrateKbps; | 218 video_codec.maxBitrate = kEncoderMinBitrateKbps; |
219 | 219 |
220 RTC_DCHECK_GT(streams[0].max_framerate, 0); | 220 RTC_DCHECK_GT(streams[0].max_framerate, 0); |
221 video_codec.maxFramerate = streams[0].max_framerate; | 221 video_codec.maxFramerate = streams[0].max_framerate; |
222 return video_codec; | 222 return video_codec; |
223 } | 223 } |
224 | 224 |
225 } // namespace webrtc | 225 } // namespace webrtc |
OLD | NEW |