Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Side by Side Diff: webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc

Issue 2541863002: Delete VideoFrame default constructor, and IsZeroSize method. (Closed)
Patch Set: Delete DCHECK using IsZeroSize. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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;
665 if (encoded_complete_callback_ == NULL) 663 if (encoded_complete_callback_ == NULL)
666 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; 664 return WEBRTC_VIDEO_CODEC_UNINITIALIZED;
667 665
668 rtc::scoped_refptr<VideoFrameBuffer> input_image = frame.video_frame_buffer(); 666 rtc::scoped_refptr<VideoFrameBuffer> input_image = frame.video_frame_buffer();
669 // Since we are extracting raw pointers from |input_image| to 667 // Since we are extracting raw pointers from |input_image| to
670 // |raw_images_[0]|, the resolution of these frames must match. Note that 668 // |raw_images_[0]|, the resolution of these frames must match. Note that
671 // |input_image| might be scaled from |frame|. In that case, the resolution of 669 // |input_image| might be scaled from |frame|. In that case, the resolution of
672 // |raw_images_[0]| should have been updated in UpdateCodecFrameSize. 670 // |raw_images_[0]| should have been updated in UpdateCodecFrameSize.
673 RTC_DCHECK_EQ(input_image->width(), raw_images_[0].d_w); 671 RTC_DCHECK_EQ(input_image->width(), raw_images_[0].d_w);
674 RTC_DCHECK_EQ(input_image->height(), raw_images_[0].d_h); 672 RTC_DCHECK_EQ(input_image->height(), raw_images_[0].d_h);
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
1276 return -1; 1274 return -1;
1277 } 1275 }
1278 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) != 1276 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) !=
1279 VPX_CODEC_OK) { 1277 VPX_CODEC_OK) {
1280 return -1; 1278 return -1;
1281 } 1279 }
1282 return 0; 1280 return 0;
1283 } 1281 }
1284 1282
1285 } // namespace webrtc 1283 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698