| 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 |
| 11 #ifndef WEBRTC_VIDEO_DECODER_H_ | 11 #ifndef WEBRTC_VIDEO_DECODER_H_ |
| 12 #define WEBRTC_VIDEO_DECODER_H_ | 12 #define WEBRTC_VIDEO_DECODER_H_ |
| 13 | 13 |
| 14 #include <string> |
| 14 #include <vector> | 15 #include <vector> |
| 15 | 16 |
| 16 #include "webrtc/common_types.h" | 17 #include "webrtc/common_types.h" |
| 17 #include "webrtc/typedefs.h" | 18 #include "webrtc/typedefs.h" |
| 18 #include "webrtc/video_frame.h" | 19 #include "webrtc/video_frame.h" |
| 19 | 20 |
| 20 namespace webrtc { | 21 namespace webrtc { |
| 21 | 22 |
| 22 class RTPFragmentationHeader; | 23 class RTPFragmentationHeader; |
| 23 // TODO(pbos): Expose these through a public (root) header or change these APIs. | 24 // TODO(pbos): Expose these through a public (root) header or change these APIs. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 bool missing_frames, | 67 bool missing_frames, |
| 67 const RTPFragmentationHeader* fragmentation, | 68 const RTPFragmentationHeader* fragmentation, |
| 68 const CodecSpecificInfo* codec_specific_info = NULL, | 69 const CodecSpecificInfo* codec_specific_info = NULL, |
| 69 int64_t render_time_ms = -1) = 0; | 70 int64_t render_time_ms = -1) = 0; |
| 70 | 71 |
| 71 virtual int32_t RegisterDecodeCompleteCallback( | 72 virtual int32_t RegisterDecodeCompleteCallback( |
| 72 DecodedImageCallback* callback) = 0; | 73 DecodedImageCallback* callback) = 0; |
| 73 | 74 |
| 74 virtual int32_t Release() = 0; | 75 virtual int32_t Release() = 0; |
| 75 virtual int32_t Reset() = 0; | 76 virtual int32_t Reset() = 0; |
| 77 virtual const char* ImplementationName() const { return "unknown"; } |
| 76 }; | 78 }; |
| 77 | 79 |
| 78 // Class used to wrap external VideoDecoders to provide a fallback option on | 80 // 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 | 81 // software decoding when a hardware decoder fails to decode a stream due to |
| 80 // hardware restrictions, such as max resolution. | 82 // hardware restrictions, such as max resolution. |
| 81 class VideoDecoderSoftwareFallbackWrapper : public webrtc::VideoDecoder { | 83 class VideoDecoderSoftwareFallbackWrapper : public webrtc::VideoDecoder { |
| 82 public: | 84 public: |
| 83 VideoDecoderSoftwareFallbackWrapper(VideoCodecType codec_type, | 85 VideoDecoderSoftwareFallbackWrapper(VideoCodecType codec_type, |
| 84 VideoDecoder* decoder); | 86 VideoDecoder* decoder); |
| 85 | 87 |
| 86 int32_t InitDecode(const VideoCodec* codec_settings, | 88 int32_t InitDecode(const VideoCodec* codec_settings, |
| 87 int32_t number_of_cores) override; | 89 int32_t number_of_cores) override; |
| 88 | 90 |
| 89 int32_t Decode(const EncodedImage& input_image, | 91 int32_t Decode(const EncodedImage& input_image, |
| 90 bool missing_frames, | 92 bool missing_frames, |
| 91 const RTPFragmentationHeader* fragmentation, | 93 const RTPFragmentationHeader* fragmentation, |
| 92 const CodecSpecificInfo* codec_specific_info, | 94 const CodecSpecificInfo* codec_specific_info, |
| 93 int64_t render_time_ms) override; | 95 int64_t render_time_ms) override; |
| 94 | 96 |
| 95 int32_t RegisterDecodeCompleteCallback( | 97 int32_t RegisterDecodeCompleteCallback( |
| 96 DecodedImageCallback* callback) override; | 98 DecodedImageCallback* callback) override; |
| 97 | 99 |
| 98 int32_t Release() override; | 100 int32_t Release() override; |
| 99 int32_t Reset() override; | 101 int32_t Reset() override; |
| 100 | 102 |
| 103 const char* ImplementationName() const override; |
| 104 |
| 101 private: | 105 private: |
| 102 bool InitFallbackDecoder(); | 106 bool InitFallbackDecoder(); |
| 103 | 107 |
| 104 const DecoderType decoder_type_; | 108 const DecoderType decoder_type_; |
| 105 VideoDecoder* const decoder_; | 109 VideoDecoder* const decoder_; |
| 106 | 110 |
| 107 VideoCodec codec_settings_; | 111 VideoCodec codec_settings_; |
| 108 int32_t number_of_cores_; | 112 int32_t number_of_cores_; |
| 113 std::string fallback_implementation_name_; |
| 109 rtc::scoped_ptr<VideoDecoder> fallback_decoder_; | 114 rtc::scoped_ptr<VideoDecoder> fallback_decoder_; |
| 110 DecodedImageCallback* callback_; | 115 DecodedImageCallback* callback_; |
| 111 }; | 116 }; |
| 112 | 117 |
| 113 } // namespace webrtc | 118 } // namespace webrtc |
| 114 | 119 |
| 115 #endif // WEBRTC_VIDEO_DECODER_H_ | 120 #endif // WEBRTC_VIDEO_DECODER_H_ |
| OLD | NEW |