| 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 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 } | 653 } |
| 654 | 654 |
| 655 int VP8EncoderImpl::Encode(const VideoFrame& frame, | 655 int VP8EncoderImpl::Encode(const VideoFrame& frame, |
| 656 const CodecSpecificInfo* codec_specific_info, | 656 const CodecSpecificInfo* codec_specific_info, |
| 657 const std::vector<FrameType>* frame_types) { | 657 const std::vector<FrameType>* frame_types) { |
| 658 RTC_DCHECK_EQ(frame.width(), codec_.width); | 658 RTC_DCHECK_EQ(frame.width(), codec_.width); |
| 659 RTC_DCHECK_EQ(frame.height(), codec_.height); | 659 RTC_DCHECK_EQ(frame.height(), codec_.height); |
| 660 | 660 |
| 661 if (!inited_) | 661 if (!inited_) |
| 662 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; | 662 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; |
| 663 if (frame.IsZeroSize()) |
| 664 return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; |
| 663 if (encoded_complete_callback_ == NULL) | 665 if (encoded_complete_callback_ == NULL) |
| 664 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; | 666 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; |
| 665 | 667 |
| 666 rtc::scoped_refptr<VideoFrameBuffer> input_image = frame.video_frame_buffer(); | 668 rtc::scoped_refptr<VideoFrameBuffer> input_image = frame.video_frame_buffer(); |
| 667 // Since we are extracting raw pointers from |input_image| to | 669 // Since we are extracting raw pointers from |input_image| to |
| 668 // |raw_images_[0]|, the resolution of these frames must match. Note that | 670 // |raw_images_[0]|, the resolution of these frames must match. Note that |
| 669 // |input_image| might be scaled from |frame|. In that case, the resolution of | 671 // |input_image| might be scaled from |frame|. In that case, the resolution of |
| 670 // |raw_images_[0]| should have been updated in UpdateCodecFrameSize. | 672 // |raw_images_[0]| should have been updated in UpdateCodecFrameSize. |
| 671 RTC_DCHECK_EQ(input_image->width(), raw_images_[0].d_w); | 673 RTC_DCHECK_EQ(input_image->width(), raw_images_[0].d_w); |
| 672 RTC_DCHECK_EQ(input_image->height(), raw_images_[0].d_h); | 674 RTC_DCHECK_EQ(input_image->height(), raw_images_[0].d_h); |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1277 return -1; | 1279 return -1; |
| 1278 } | 1280 } |
| 1279 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) != | 1281 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) != |
| 1280 VPX_CODEC_OK) { | 1282 VPX_CODEC_OK) { |
| 1281 return -1; | 1283 return -1; |
| 1282 } | 1284 } |
| 1283 return 0; | 1285 return 0; |
| 1284 } | 1286 } |
| 1285 | 1287 |
| 1286 } // namespace webrtc | 1288 } // namespace webrtc |
| OLD | NEW |