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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 | 317 |
318 strncpy(video_codec.plName, | 318 strncpy(video_codec.plName, |
319 config_.encoder_settings.payload_name.c_str(), | 319 config_.encoder_settings.payload_name.c_str(), |
320 kPayloadNameSize - 1); | 320 kPayloadNameSize - 1); |
321 video_codec.plName[kPayloadNameSize - 1] = '\0'; | 321 video_codec.plName[kPayloadNameSize - 1] = '\0'; |
322 video_codec.plType = config_.encoder_settings.payload_type; | 322 video_codec.plType = config_.encoder_settings.payload_type; |
323 video_codec.numberOfSimulcastStreams = | 323 video_codec.numberOfSimulcastStreams = |
324 static_cast<unsigned char>(streams.size()); | 324 static_cast<unsigned char>(streams.size()); |
325 video_codec.minBitrate = streams[0].min_bitrate_bps / 1000; | 325 video_codec.minBitrate = streams[0].min_bitrate_bps / 1000; |
326 RTC_DCHECK_LE(streams.size(), static_cast<size_t>(kMaxSimulcastStreams)); | 326 RTC_DCHECK_LE(streams.size(), static_cast<size_t>(kMaxSimulcastStreams)); |
| 327 if (video_codec.codecType == kVideoCodecVP9) { |
| 328 for (size_t i = 0; i < config.spatial_layers.size(); ++i) |
| 329 video_codec.spatialLayers[i] = config.spatial_layers[i]; |
| 330 } |
327 for (size_t i = 0; i < streams.size(); ++i) { | 331 for (size_t i = 0; i < streams.size(); ++i) { |
328 SimulcastStream* sim_stream = &video_codec.simulcastStream[i]; | 332 SimulcastStream* sim_stream = &video_codec.simulcastStream[i]; |
329 RTC_DCHECK_GT(streams[i].width, 0u); | 333 RTC_DCHECK_GT(streams[i].width, 0u); |
330 RTC_DCHECK_GT(streams[i].height, 0u); | 334 RTC_DCHECK_GT(streams[i].height, 0u); |
331 RTC_DCHECK_GT(streams[i].max_framerate, 0); | 335 RTC_DCHECK_GT(streams[i].max_framerate, 0); |
332 // Different framerates not supported per stream at the moment. | 336 // Different framerates not supported per stream at the moment. |
333 RTC_DCHECK_EQ(streams[i].max_framerate, streams[0].max_framerate); | 337 RTC_DCHECK_EQ(streams[i].max_framerate, streams[0].max_framerate); |
334 RTC_DCHECK_GE(streams[i].min_bitrate_bps, 0); | 338 RTC_DCHECK_GE(streams[i].min_bitrate_bps, 0); |
335 RTC_DCHECK_GE(streams[i].target_bitrate_bps, streams[i].min_bitrate_bps); | 339 RTC_DCHECK_GE(streams[i].target_bitrate_bps, streams[i].min_bitrate_bps); |
336 RTC_DCHECK_GE(streams[i].max_bitrate_bps, streams[i].target_bitrate_bps); | 340 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... |
510 vie_channel_->IsSendingFecEnabled()); | 514 vie_channel_->IsSendingFecEnabled()); |
511 | 515 |
512 // Restart the media flow | 516 // Restart the media flow |
513 vie_encoder_->Restart(); | 517 vie_encoder_->Restart(); |
514 | 518 |
515 return true; | 519 return true; |
516 } | 520 } |
517 | 521 |
518 } // namespace internal | 522 } // namespace internal |
519 } // namespace webrtc | 523 } // namespace webrtc |
OLD | NEW |