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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
56 bool missing_frames, | 56 bool missing_frames, |
57 const RTPFragmentationHeader* fragmentation, | 57 const RTPFragmentationHeader* fragmentation, |
58 const CodecSpecificInfo* codec_specific_info = NULL, | 58 const CodecSpecificInfo* codec_specific_info = NULL, |
59 int64_t render_time_ms = -1) = 0; | 59 int64_t render_time_ms = -1) = 0; |
60 | 60 |
61 virtual int32_t RegisterDecodeCompleteCallback( | 61 virtual int32_t RegisterDecodeCompleteCallback( |
62 DecodedImageCallback* callback) = 0; | 62 DecodedImageCallback* callback) = 0; |
63 | 63 |
64 virtual int32_t Release() = 0; | 64 virtual int32_t Release() = 0; |
65 virtual int32_t Reset() = 0; | 65 virtual int32_t Reset() = 0; |
66 | |
67 // Returns true if the currently active decoder only have one output buffer. | |
perkj_webrtc
2015/11/05 11:56:37
has
| |
68 // That means that frames must be decoded near the render times stamp since | |
69 // multiple frames can not be decoded ahead of time. | |
70 virtual bool HasOnlyOneOutputBuffer() const { | |
pbos-webrtc
2015/11/05 17:47:30
I would like us to decode the extra output buffer
| |
71 return false; | |
72 } | |
66 }; | 73 }; |
67 | 74 |
68 // Class used to wrap external VideoDecoders to provide a fallback option on | 75 // Class used to wrap external VideoDecoders to provide a fallback option on |
69 // software decoding when a hardware decoder fails to decode a stream due to | 76 // software decoding when a hardware decoder fails to decode a stream due to |
70 // hardware restrictions, such as max resolution. | 77 // hardware restrictions, such as max resolution. |
71 class VideoDecoderSoftwareFallbackWrapper : public webrtc::VideoDecoder { | 78 class VideoDecoderSoftwareFallbackWrapper : public webrtc::VideoDecoder { |
72 public: | 79 public: |
73 VideoDecoderSoftwareFallbackWrapper(VideoCodecType codec_type, | 80 VideoDecoderSoftwareFallbackWrapper(VideoCodecType codec_type, |
74 VideoDecoder* decoder); | 81 VideoDecoder* decoder); |
75 | 82 |
76 int32_t InitDecode(const VideoCodec* codec_settings, | 83 int32_t InitDecode(const VideoCodec* codec_settings, |
77 int32_t number_of_cores) override; | 84 int32_t number_of_cores) override; |
78 | 85 |
79 int32_t Decode(const EncodedImage& input_image, | 86 int32_t Decode(const EncodedImage& input_image, |
80 bool missing_frames, | 87 bool missing_frames, |
81 const RTPFragmentationHeader* fragmentation, | 88 const RTPFragmentationHeader* fragmentation, |
82 const CodecSpecificInfo* codec_specific_info, | 89 const CodecSpecificInfo* codec_specific_info, |
83 int64_t render_time_ms) override; | 90 int64_t render_time_ms) override; |
84 | 91 |
85 int32_t RegisterDecodeCompleteCallback( | 92 int32_t RegisterDecodeCompleteCallback( |
86 DecodedImageCallback* callback) override; | 93 DecodedImageCallback* callback) override; |
87 | 94 |
88 int32_t Release() override; | 95 int32_t Release() override; |
89 int32_t Reset() override; | 96 int32_t Reset() override; |
97 bool HasOnlyOneOutputBuffer() const override; | |
90 | 98 |
91 private: | 99 private: |
92 bool InitFallbackDecoder(); | 100 bool InitFallbackDecoder(); |
93 | 101 |
94 const DecoderType decoder_type_; | 102 const DecoderType decoder_type_; |
95 VideoDecoder* const decoder_; | 103 VideoDecoder* const decoder_; |
96 | 104 |
97 VideoCodec codec_settings_; | 105 VideoCodec codec_settings_; |
98 int32_t number_of_cores_; | 106 int32_t number_of_cores_; |
99 rtc::scoped_ptr<VideoDecoder> fallback_decoder_; | 107 rtc::scoped_ptr<VideoDecoder> fallback_decoder_; |
100 DecodedImageCallback* callback_; | 108 DecodedImageCallback* callback_; |
101 }; | 109 }; |
102 | 110 |
103 } // namespace webrtc | 111 } // namespace webrtc |
104 | 112 |
105 #endif // WEBRTC_VIDEO_DECODER_H_ | 113 #endif // WEBRTC_VIDEO_DECODER_H_ |
OLD | NEW |