Index: third_party/openh264/testing/h264_decoder_impl.h |
diff --git a/third_party/openh264/testing/h264_decoder_impl.h b/third_party/openh264/testing/h264_decoder_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a0e9eacb4c7d8e336aa26e5acc4d447a2fdae82a |
--- /dev/null |
+++ b/third_party/openh264/testing/h264_decoder_impl.h |
@@ -0,0 +1,69 @@ |
+/* |
+ * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
+ * |
+ * Use of this source code is governed by a BSD-style license |
+ * that can be found in the LICENSE file in the root of the source |
+ * tree. An additional intellectual property rights grant can be found |
+ * in the file PATENTS. All contributing project authors may |
+ * be found in the AUTHORS file in the root of the source tree. |
+ * |
+ */ |
+ |
+// TODO(hbos): This is essentially a copy of an decoder class in WebRTC that as |
+// of this statement has not yet landed, but that I want to have accessible in |
+// Chromium before that CL lands. This is because I use it in order to validate |
+// the build files for OpenH264 and the WebRTC encoder/decoder CL cannot land |
+// until I can build OpenH264 from source. Once the build files are stable I |
+// will land both CLs and remove this copy of the decoder. |
+ |
+#ifndef OPENH264_TESTING_H264_DECODER_IMPL_H_ |
+#define OPENH264_TESTING_H264_DECODER_IMPL_H_ |
+ |
+#include "webrtc/modules/video_coding/codecs/h264/include/h264.h" |
+ |
+class ISVCDecoder; |
+ |
+using webrtc::CodecSpecificInfo; |
+using webrtc::DecodedImageCallback; |
+using webrtc::EncodedImage; |
+using webrtc::RTPFragmentationHeader; |
+using webrtc::VideoCodec; |
+using webrtc::VideoDecoder; |
+using webrtc::VideoFrame; |
+ |
+namespace openh264 { |
+ |
+class H264DecoderImpl : public webrtc::H264Decoder { |
+ public: |
+ H264DecoderImpl(); |
+ ~H264DecoderImpl() override; |
+ |
+ // |number_of_cores| is ignored. |codec_settings| is also ignored except if |
+ // it's not null then |codec_settings->codecType| must be kVideoCodecH264. |
+ int32_t InitDecode(const VideoCodec* codec_settings, |
+ int32_t /*number_of_cores*/) override; |
+ int32_t Release() override; |
+ int32_t Reset() override; |
+ |
+ int32_t RegisterDecodeCompleteCallback( |
+ DecodedImageCallback* callback) override; |
+ |
+ // |missing_frames|, |fragmentation| and |render_time_ms| are ignored. |
+ int32_t Decode(const EncodedImage& input_image, |
+ bool /*missing_frames*/, |
+ const RTPFragmentationHeader* /*fragmentation*/, |
+ const CodecSpecificInfo* codec_specific_info = nullptr, |
+ int64_t render_time_ms = -1) override; |
+ |
+ bool IsInitialized(); |
+ |
+ private: |
+ ISVCDecoder* openh264_decoder_; |
+ |
+ VideoFrame decoded_image_; |
+ DecodedImageCallback* decoded_image_callback_; |
+}; |
+ |
+} // namespace openh264 |
+ |
+#endif // OPENH264_TESTING_H264_DECODER_IMPL_H_ |