OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 303 |
304 strncpy(video_codec.plName, | 304 strncpy(video_codec.plName, |
305 config_.encoder_settings.payload_name.c_str(), | 305 config_.encoder_settings.payload_name.c_str(), |
306 kPayloadNameSize - 1); | 306 kPayloadNameSize - 1); |
307 video_codec.plName[kPayloadNameSize - 1] = '\0'; | 307 video_codec.plName[kPayloadNameSize - 1] = '\0'; |
308 video_codec.plType = config_.encoder_settings.payload_type; | 308 video_codec.plType = config_.encoder_settings.payload_type; |
309 video_codec.numberOfSimulcastStreams = | 309 video_codec.numberOfSimulcastStreams = |
310 static_cast<unsigned char>(streams.size()); | 310 static_cast<unsigned char>(streams.size()); |
311 video_codec.minBitrate = streams[0].min_bitrate_bps / 1000; | 311 video_codec.minBitrate = streams[0].min_bitrate_bps / 1000; |
312 RTC_DCHECK_LE(streams.size(), static_cast<size_t>(kMaxSimulcastStreams)); | 312 RTC_DCHECK_LE(streams.size(), static_cast<size_t>(kMaxSimulcastStreams)); |
| 313 if (video_codec.codecType == kVideoCodecVP9) { |
| 314 // If the vector is empty, bitrates will be configured automatically. |
| 315 RTC_DCHECK(config.spatial_layers.empty() || |
| 316 config.spatial_layers.size() == |
| 317 video_codec.codecSpecific.VP9.numberOfSpatialLayers); |
| 318 RTC_DCHECK_LE(video_codec.codecSpecific.VP9.numberOfSpatialLayers, |
| 319 kMaxSimulcastStreams); |
| 320 for (size_t i = 0; i < config.spatial_layers.size(); ++i) |
| 321 video_codec.spatialLayers[i] = config.spatial_layers[i]; |
| 322 } |
313 for (size_t i = 0; i < streams.size(); ++i) { | 323 for (size_t i = 0; i < streams.size(); ++i) { |
314 SimulcastStream* sim_stream = &video_codec.simulcastStream[i]; | 324 SimulcastStream* sim_stream = &video_codec.simulcastStream[i]; |
315 RTC_DCHECK_GT(streams[i].width, 0u); | 325 RTC_DCHECK_GT(streams[i].width, 0u); |
316 RTC_DCHECK_GT(streams[i].height, 0u); | 326 RTC_DCHECK_GT(streams[i].height, 0u); |
317 RTC_DCHECK_GT(streams[i].max_framerate, 0); | 327 RTC_DCHECK_GT(streams[i].max_framerate, 0); |
318 // Different framerates not supported per stream at the moment. | 328 // Different framerates not supported per stream at the moment. |
319 RTC_DCHECK_EQ(streams[i].max_framerate, streams[0].max_framerate); | 329 RTC_DCHECK_EQ(streams[i].max_framerate, streams[0].max_framerate); |
320 RTC_DCHECK_GE(streams[i].min_bitrate_bps, 0); | 330 RTC_DCHECK_GE(streams[i].min_bitrate_bps, 0); |
321 RTC_DCHECK_GE(streams[i].target_bitrate_bps, streams[i].min_bitrate_bps); | 331 RTC_DCHECK_GE(streams[i].target_bitrate_bps, streams[i].min_bitrate_bps); |
322 RTC_DCHECK_GE(streams[i].max_bitrate_bps, streams[i].target_bitrate_bps); | 332 RTC_DCHECK_GE(streams[i].max_bitrate_bps, streams[i].target_bitrate_bps); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 vie_channel_->IsSendingFecEnabled()); | 506 vie_channel_->IsSendingFecEnabled()); |
497 | 507 |
498 // Restart the media flow | 508 // Restart the media flow |
499 vie_encoder_->Restart(); | 509 vie_encoder_->Restart(); |
500 | 510 |
501 return true; | 511 return true; |
502 } | 512 } |
503 | 513 |
504 } // namespace internal | 514 } // namespace internal |
505 } // namespace webrtc | 515 } // namespace webrtc |
OLD | NEW |