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

Side by Side Diff: webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc

Issue 1970343002: Make sure WebRTC works without libvpx VP9 support. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: sort headers Created 4 years, 7 months 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) 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 29 matching lines...) Expand all
40 #else 40 #else
41 // For smaller resolutions, use lower speed setting (get some coding gain at 41 // For smaller resolutions, use lower speed setting (get some coding gain at
42 // the cost of increased encoding complexity). 42 // the cost of increased encoding complexity).
43 if (width * height <= 352 * 288) 43 if (width * height <= 352 * 288)
44 return 5; 44 return 5;
45 else 45 else
46 return 7; 46 return 7;
47 #endif 47 #endif
48 } 48 }
49 49
50 bool VP9Encoder::IsSupported() {
51 return true;
52 }
53
50 VP9Encoder* VP9Encoder::Create() { 54 VP9Encoder* VP9Encoder::Create() {
51 return new VP9EncoderImpl(); 55 return new VP9EncoderImpl();
52 } 56 }
53 57
54 void VP9EncoderImpl::EncoderOutputCodedPacketCallback(vpx_codec_cx_pkt* pkt, 58 void VP9EncoderImpl::EncoderOutputCodedPacketCallback(vpx_codec_cx_pkt* pkt,
55 void* user_data) { 59 void* user_data) {
56 VP9EncoderImpl* enc = static_cast<VP9EncoderImpl*>(user_data); 60 VP9EncoderImpl* enc = static_cast<VP9EncoderImpl*>(user_data);
57 enc->GetEncodedLayerFrame(pkt); 61 enc->GetEncodedLayerFrame(pkt);
58 } 62 }
59 63
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 int VP9EncoderImpl::RegisterEncodeCompleteCallback( 820 int VP9EncoderImpl::RegisterEncodeCompleteCallback(
817 EncodedImageCallback* callback) { 821 EncodedImageCallback* callback) {
818 encoded_complete_callback_ = callback; 822 encoded_complete_callback_ = callback;
819 return WEBRTC_VIDEO_CODEC_OK; 823 return WEBRTC_VIDEO_CODEC_OK;
820 } 824 }
821 825
822 const char* VP9EncoderImpl::ImplementationName() const { 826 const char* VP9EncoderImpl::ImplementationName() const {
823 return "libvpx"; 827 return "libvpx";
824 } 828 }
825 829
830 bool VP9Decoder::IsSupported() {
831 return true;
832 }
833
826 VP9Decoder* VP9Decoder::Create() { 834 VP9Decoder* VP9Decoder::Create() {
827 return new VP9DecoderImpl(); 835 return new VP9DecoderImpl();
828 } 836 }
829 837
830 VP9DecoderImpl::VP9DecoderImpl() 838 VP9DecoderImpl::VP9DecoderImpl()
831 : decode_complete_callback_(NULL), 839 : decode_complete_callback_(NULL),
832 inited_(false), 840 inited_(false),
833 decoder_(NULL), 841 decoder_(NULL),
834 key_frame_required_(true) { 842 key_frame_required_(true) {
835 memset(&codec_, 0, sizeof(codec_)); 843 memset(&codec_, 0, sizeof(codec_));
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 frame_buffer_pool_.ClearPool(); 991 frame_buffer_pool_.ClearPool();
984 inited_ = false; 992 inited_ = false;
985 return WEBRTC_VIDEO_CODEC_OK; 993 return WEBRTC_VIDEO_CODEC_OK;
986 } 994 }
987 995
988 const char* VP9DecoderImpl::ImplementationName() const { 996 const char* VP9DecoderImpl::ImplementationName() const {
989 return "libvpx"; 997 return "libvpx";
990 } 998 }
991 999
992 } // namespace webrtc 1000 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/codecs/vp9/vp9.gyp ('k') | webrtc/modules/video_coding/codecs/vp9/vp9_noop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698