OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 const uint32_t min_intra_size = 300; | 476 const uint32_t min_intra_size = 300; |
477 return (target_pct < min_intra_size) ? min_intra_size : target_pct; | 477 return (target_pct < min_intra_size) ? min_intra_size : target_pct; |
478 } | 478 } |
479 | 479 |
480 int VP9EncoderImpl::Encode(const VideoFrame& input_image, | 480 int VP9EncoderImpl::Encode(const VideoFrame& input_image, |
481 const CodecSpecificInfo* codec_specific_info, | 481 const CodecSpecificInfo* codec_specific_info, |
482 const std::vector<FrameType>* frame_types) { | 482 const std::vector<FrameType>* frame_types) { |
483 if (!inited_) { | 483 if (!inited_) { |
484 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; | 484 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; |
485 } | 485 } |
486 if (input_image.IsZeroSize()) { | |
487 return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; | |
488 } | |
489 if (encoded_complete_callback_ == NULL) { | 486 if (encoded_complete_callback_ == NULL) { |
490 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; | 487 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; |
491 } | 488 } |
492 FrameType frame_type = kVideoFrameDelta; | 489 FrameType frame_type = kVideoFrameDelta; |
493 // We only support one stream at the moment. | 490 // We only support one stream at the moment. |
494 if (frame_types && frame_types->size() > 0) { | 491 if (frame_types && frame_types->size() > 0) { |
495 frame_type = (*frame_types)[0]; | 492 frame_type = (*frame_types)[0]; |
496 } | 493 } |
497 RTC_DCHECK_EQ(input_image.width(), static_cast<int>(raw_->d_w)); | 494 RTC_DCHECK_EQ(input_image.width(), static_cast<int>(raw_->d_w)); |
498 RTC_DCHECK_EQ(input_image.height(), static_cast<int>(raw_->d_h)); | 495 RTC_DCHECK_EQ(input_image.height(), static_cast<int>(raw_->d_h)); |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 frame_buffer_pool_.ClearPool(); | 989 frame_buffer_pool_.ClearPool(); |
993 inited_ = false; | 990 inited_ = false; |
994 return WEBRTC_VIDEO_CODEC_OK; | 991 return WEBRTC_VIDEO_CODEC_OK; |
995 } | 992 } |
996 | 993 |
997 const char* VP9DecoderImpl::ImplementationName() const { | 994 const char* VP9DecoderImpl::ImplementationName() const { |
998 return "libvpx"; | 995 return "libvpx"; |
999 } | 996 } |
1000 | 997 |
1001 } // namespace webrtc | 998 } // namespace webrtc |
OLD | NEW |