OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 if (error) | 884 if (error) |
885 return WEBRTC_VIDEO_CODEC_ERROR; | 885 return WEBRTC_VIDEO_CODEC_ERROR; |
886 timestamp_ += duration; | 886 timestamp_ += duration; |
887 return GetEncodedPartitions(input_image, only_predict_from_key_frame); | 887 return GetEncodedPartitions(input_image, only_predict_from_key_frame); |
888 } | 888 } |
889 | 889 |
890 // TODO(pbos): Make sure this works for properly for >1 encoders. | 890 // TODO(pbos): Make sure this works for properly for >1 encoders. |
891 int VP8EncoderImpl::UpdateCodecFrameSize(const VideoFrame& input_image) { | 891 int VP8EncoderImpl::UpdateCodecFrameSize(const VideoFrame& input_image) { |
892 codec_.width = input_image.width(); | 892 codec_.width = input_image.width(); |
893 codec_.height = input_image.height(); | 893 codec_.height = input_image.height(); |
| 894 if (codec_.numberOfSimulcastStreams <= 1) { |
| 895 // For now scaling is only used for single-layer streams. |
| 896 codec_.simulcastStream[0].width = input_image.width(); |
| 897 codec_.simulcastStream[0].height = input_image.height(); |
| 898 } |
894 // Update the cpu_speed setting for resolution change. | 899 // Update the cpu_speed setting for resolution change. |
895 vpx_codec_control(&(encoders_[0]), | 900 vpx_codec_control(&(encoders_[0]), |
896 VP8E_SET_CPUUSED, | 901 VP8E_SET_CPUUSED, |
897 SetCpuSpeed(codec_.width, codec_.height)); | 902 SetCpuSpeed(codec_.width, codec_.height)); |
898 raw_images_[0].w = codec_.width; | 903 raw_images_[0].w = codec_.width; |
899 raw_images_[0].h = codec_.height; | 904 raw_images_[0].h = codec_.height; |
900 raw_images_[0].d_w = codec_.width; | 905 raw_images_[0].d_w = codec_.width; |
901 raw_images_[0].d_h = codec_.height; | 906 raw_images_[0].d_h = codec_.height; |
902 vpx_img_set_rect(&raw_images_[0], 0, 0, codec_.width, codec_.height); | 907 vpx_img_set_rect(&raw_images_[0], 0, 0, codec_.width, codec_.height); |
903 | 908 |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1388 return -1; | 1393 return -1; |
1389 } | 1394 } |
1390 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) | 1395 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) |
1391 != VPX_CODEC_OK) { | 1396 != VPX_CODEC_OK) { |
1392 return -1; | 1397 return -1; |
1393 } | 1398 } |
1394 return 0; | 1399 return 0; |
1395 } | 1400 } |
1396 | 1401 |
1397 } // namespace webrtc | 1402 } // namespace webrtc |
OLD | NEW |