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 29 matching lines...) Expand all Loading... |
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 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 int VP9EncoderImpl::RegisterEncodeCompleteCallback( | 817 int VP9EncoderImpl::RegisterEncodeCompleteCallback( |
814 EncodedImageCallback* callback) { | 818 EncodedImageCallback* callback) { |
815 encoded_complete_callback_ = callback; | 819 encoded_complete_callback_ = callback; |
816 return WEBRTC_VIDEO_CODEC_OK; | 820 return WEBRTC_VIDEO_CODEC_OK; |
817 } | 821 } |
818 | 822 |
819 const char* VP9EncoderImpl::ImplementationName() const { | 823 const char* VP9EncoderImpl::ImplementationName() const { |
820 return "libvpx"; | 824 return "libvpx"; |
821 } | 825 } |
822 | 826 |
| 827 bool VP9Decoder::IsSupported() { |
| 828 return true; |
| 829 } |
| 830 |
823 VP9Decoder* VP9Decoder::Create() { | 831 VP9Decoder* VP9Decoder::Create() { |
824 return new VP9DecoderImpl(); | 832 return new VP9DecoderImpl(); |
825 } | 833 } |
826 | 834 |
827 VP9DecoderImpl::VP9DecoderImpl() | 835 VP9DecoderImpl::VP9DecoderImpl() |
828 : decode_complete_callback_(NULL), | 836 : decode_complete_callback_(NULL), |
829 inited_(false), | 837 inited_(false), |
830 decoder_(NULL), | 838 decoder_(NULL), |
831 key_frame_required_(true) { | 839 key_frame_required_(true) { |
832 memset(&codec_, 0, sizeof(codec_)); | 840 memset(&codec_, 0, sizeof(codec_)); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
980 frame_buffer_pool_.ClearPool(); | 988 frame_buffer_pool_.ClearPool(); |
981 inited_ = false; | 989 inited_ = false; |
982 return WEBRTC_VIDEO_CODEC_OK; | 990 return WEBRTC_VIDEO_CODEC_OK; |
983 } | 991 } |
984 | 992 |
985 const char* VP9DecoderImpl::ImplementationName() const { | 993 const char* VP9DecoderImpl::ImplementationName() const { |
986 return "libvpx"; | 994 return "libvpx"; |
987 } | 995 } |
988 | 996 |
989 } // namespace webrtc | 997 } // namespace webrtc |
OLD | NEW |