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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 video_codec.codecSpecific.VP8 = *reinterpret_cast<const VideoCodecVP8*>( | 338 video_codec.codecSpecific.VP8 = *reinterpret_cast<const VideoCodecVP8*>( |
339 config.encoder_specific_settings); | 339 config.encoder_specific_settings); |
340 } | 340 } |
341 video_codec.codecSpecific.VP8.numberOfTemporalLayers = | 341 video_codec.codecSpecific.VP8.numberOfTemporalLayers = |
342 static_cast<unsigned char>( | 342 static_cast<unsigned char>( |
343 streams.back().temporal_layer_thresholds_bps.size() + 1); | 343 streams.back().temporal_layer_thresholds_bps.size() + 1); |
344 } else if (video_codec.codecType == kVideoCodecVP9) { | 344 } else if (video_codec.codecType == kVideoCodecVP9) { |
345 if (config.encoder_specific_settings != nullptr) { | 345 if (config.encoder_specific_settings != nullptr) { |
346 video_codec.codecSpecific.VP9 = *reinterpret_cast<const VideoCodecVP9*>( | 346 video_codec.codecSpecific.VP9 = *reinterpret_cast<const VideoCodecVP9*>( |
347 config.encoder_specific_settings); | 347 config.encoder_specific_settings); |
| 348 if (video_codec.mode == kScreensharing) { |
| 349 video_codec.codecSpecific.VP9.flexibleMode = true; |
| 350 // For now VP9 screensharing use 1 temporal and 2 spatial layers. |
| 351 RTC_DCHECK_EQ(video_codec.codecSpecific.VP9.numberOfTemporalLayers, 1); |
| 352 RTC_DCHECK_EQ(video_codec.codecSpecific.VP9.numberOfSpatialLayers, 2); |
| 353 } |
348 } | 354 } |
349 video_codec.codecSpecific.VP9.numberOfTemporalLayers = | 355 video_codec.codecSpecific.VP9.numberOfTemporalLayers = |
350 static_cast<unsigned char>( | 356 static_cast<unsigned char>( |
351 streams.back().temporal_layer_thresholds_bps.size() + 1); | 357 streams.back().temporal_layer_thresholds_bps.size() + 1); |
352 } else if (video_codec.codecType == kVideoCodecH264) { | 358 } else if (video_codec.codecType == kVideoCodecH264) { |
353 if (config.encoder_specific_settings != nullptr) { | 359 if (config.encoder_specific_settings != nullptr) { |
354 video_codec.codecSpecific.H264 = *reinterpret_cast<const VideoCodecH264*>( | 360 video_codec.codecSpecific.H264 = *reinterpret_cast<const VideoCodecH264*>( |
355 config.encoder_specific_settings); | 361 config.encoder_specific_settings); |
356 } | 362 } |
357 } else { | 363 } else { |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 vie_channel_->IsSendingFecEnabled()); | 572 vie_channel_->IsSendingFecEnabled()); |
567 | 573 |
568 // Restart the media flow | 574 // Restart the media flow |
569 vie_encoder_->Restart(); | 575 vie_encoder_->Restart(); |
570 | 576 |
571 return true; | 577 return true; |
572 } | 578 } |
573 | 579 |
574 } // namespace internal | 580 } // namespace internal |
575 } // namespace webrtc | 581 } // namespace webrtc |
OLD | NEW |