Chromium Code Reviews| 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 308 } | 308 } |
| 309 | 309 |
| 310 strncpy(video_codec.plName, | 310 strncpy(video_codec.plName, |
| 311 config_.encoder_settings.payload_name.c_str(), | 311 config_.encoder_settings.payload_name.c_str(), |
| 312 kPayloadNameSize - 1); | 312 kPayloadNameSize - 1); |
| 313 video_codec.plName[kPayloadNameSize - 1] = '\0'; | 313 video_codec.plName[kPayloadNameSize - 1] = '\0'; |
| 314 video_codec.plType = config_.encoder_settings.payload_type; | 314 video_codec.plType = config_.encoder_settings.payload_type; |
| 315 video_codec.numberOfSimulcastStreams = | 315 video_codec.numberOfSimulcastStreams = |
| 316 static_cast<unsigned char>(streams.size()); | 316 static_cast<unsigned char>(streams.size()); |
| 317 video_codec.minBitrate = streams[0].min_bitrate_bps / 1000; | 317 video_codec.minBitrate = streams[0].min_bitrate_bps / 1000; |
| 318 RTC_DCHECK_LE(streams.size(), static_cast<size_t>(kMaxSimulcastStreams)); | 318 RTC_DCHECK_LE(streams.size(), static_cast<size_t>(kMaxSimulcastStreams)); |
|
mflodman
2015/10/06 11:27:27
Add a similar check for config.spatial_layers.size
ivica
2015/10/07 11:59:50
Done.
| |
| 319 if (video_codec.codecType == kVideoCodecVP9) { | |
| 320 for (size_t i = 0; i < config.spatial_layers.size(); ++i) | |
| 321 video_codec.spatialLayers[i] = config.spatial_layers[i]; | |
| 322 } | |
| 319 for (size_t i = 0; i < streams.size(); ++i) { | 323 for (size_t i = 0; i < streams.size(); ++i) { |
| 320 SimulcastStream* sim_stream = &video_codec.simulcastStream[i]; | 324 SimulcastStream* sim_stream = &video_codec.simulcastStream[i]; |
| 321 RTC_DCHECK_GT(streams[i].width, 0u); | 325 RTC_DCHECK_GT(streams[i].width, 0u); |
| 322 RTC_DCHECK_GT(streams[i].height, 0u); | 326 RTC_DCHECK_GT(streams[i].height, 0u); |
| 323 RTC_DCHECK_GT(streams[i].max_framerate, 0); | 327 RTC_DCHECK_GT(streams[i].max_framerate, 0); |
| 324 // Different framerates not supported per stream at the moment. | 328 // Different framerates not supported per stream at the moment. |
| 325 RTC_DCHECK_EQ(streams[i].max_framerate, streams[0].max_framerate); | 329 RTC_DCHECK_EQ(streams[i].max_framerate, streams[0].max_framerate); |
| 326 RTC_DCHECK_GE(streams[i].min_bitrate_bps, 0); | 330 RTC_DCHECK_GE(streams[i].min_bitrate_bps, 0); |
| 327 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); |
| 328 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... | |
| 502 vie_channel_->IsSendingFecEnabled()); | 506 vie_channel_->IsSendingFecEnabled()); |
| 503 | 507 |
| 504 // Restart the media flow | 508 // Restart the media flow |
| 505 vie_encoder_->Restart(); | 509 vie_encoder_->Restart(); |
| 506 | 510 |
| 507 return true; | 511 return true; |
| 508 } | 512 } |
| 509 | 513 |
| 510 } // namespace internal | 514 } // namespace internal |
| 511 } // namespace webrtc | 515 } // namespace webrtc |
| OLD | NEW |