Chromium Code Reviews| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 bool missing_frames, | 66 bool missing_frames, |
| 67 const RTPFragmentationHeader* fragmentation, | 67 const RTPFragmentationHeader* fragmentation, |
| 68 const CodecSpecificInfo* codec_specific_info = NULL, | 68 const CodecSpecificInfo* codec_specific_info = NULL, |
| 69 int64_t render_time_ms = -1) = 0; | 69 int64_t render_time_ms = -1) = 0; |
| 70 | 70 |
| 71 virtual int32_t RegisterDecodeCompleteCallback( | 71 virtual int32_t RegisterDecodeCompleteCallback( |
| 72 DecodedImageCallback* callback) = 0; | 72 DecodedImageCallback* callback) = 0; |
| 73 | 73 |
| 74 virtual int32_t Release() = 0; | 74 virtual int32_t Release() = 0; |
| 75 virtual int32_t Reset() = 0; | 75 virtual int32_t Reset() = 0; |
| 76 | |
| 77 // Returns true if the decoder prefer to decode frames late. | |
| 78 // That is, it can not decode infinite number of frames before the decoded | |
| 79 // frame is consumed. | |
| 80 virtual bool PreferDecodeLate() const { | |
| 81 return true; | |
|
stefan-webrtc
2015/12/07 09:02:19
Shouldn't the default be false? Or do you want to
perkj_webrtc
2015/12/07 12:06:34
I would prefer to not change the current behavior.
| |
| 82 } | |
| 76 }; | 83 }; |
| 77 | 84 |
| 78 // Class used to wrap external VideoDecoders to provide a fallback option on | 85 // Class used to wrap external VideoDecoders to provide a fallback option on |
| 79 // software decoding when a hardware decoder fails to decode a stream due to | 86 // software decoding when a hardware decoder fails to decode a stream due to |
| 80 // hardware restrictions, such as max resolution. | 87 // hardware restrictions, such as max resolution. |
| 81 class VideoDecoderSoftwareFallbackWrapper : public webrtc::VideoDecoder { | 88 class VideoDecoderSoftwareFallbackWrapper : public webrtc::VideoDecoder { |
| 82 public: | 89 public: |
| 83 VideoDecoderSoftwareFallbackWrapper(VideoCodecType codec_type, | 90 VideoDecoderSoftwareFallbackWrapper(VideoCodecType codec_type, |
| 84 VideoDecoder* decoder); | 91 VideoDecoder* decoder); |
| 85 | 92 |
| 86 int32_t InitDecode(const VideoCodec* codec_settings, | 93 int32_t InitDecode(const VideoCodec* codec_settings, |
| 87 int32_t number_of_cores) override; | 94 int32_t number_of_cores) override; |
| 88 | 95 |
| 89 int32_t Decode(const EncodedImage& input_image, | 96 int32_t Decode(const EncodedImage& input_image, |
| 90 bool missing_frames, | 97 bool missing_frames, |
| 91 const RTPFragmentationHeader* fragmentation, | 98 const RTPFragmentationHeader* fragmentation, |
| 92 const CodecSpecificInfo* codec_specific_info, | 99 const CodecSpecificInfo* codec_specific_info, |
| 93 int64_t render_time_ms) override; | 100 int64_t render_time_ms) override; |
| 94 | 101 |
| 95 int32_t RegisterDecodeCompleteCallback( | 102 int32_t RegisterDecodeCompleteCallback( |
| 96 DecodedImageCallback* callback) override; | 103 DecodedImageCallback* callback) override; |
| 97 | 104 |
| 98 int32_t Release() override; | 105 int32_t Release() override; |
| 99 int32_t Reset() override; | 106 int32_t Reset() override; |
| 107 bool PreferDecodeLate() const override; | |
| 100 | 108 |
| 101 private: | 109 private: |
| 102 bool InitFallbackDecoder(); | 110 bool InitFallbackDecoder(); |
| 103 | 111 |
| 104 const DecoderType decoder_type_; | 112 const DecoderType decoder_type_; |
| 105 VideoDecoder* const decoder_; | 113 VideoDecoder* const decoder_; |
| 106 | 114 |
| 107 VideoCodec codec_settings_; | 115 VideoCodec codec_settings_; |
| 108 int32_t number_of_cores_; | 116 int32_t number_of_cores_; |
| 109 rtc::scoped_ptr<VideoDecoder> fallback_decoder_; | 117 rtc::scoped_ptr<VideoDecoder> fallback_decoder_; |
| 110 DecodedImageCallback* callback_; | 118 DecodedImageCallback* callback_; |
| 111 }; | 119 }; |
| 112 | 120 |
| 113 } // namespace webrtc | 121 } // namespace webrtc |
| 114 | 122 |
| 115 #endif // WEBRTC_VIDEO_DECODER_H_ | 123 #endif // WEBRTC_VIDEO_DECODER_H_ |
| OLD | NEW |