Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(763)

Unified Diff: third_party/openh264/testing/h264_decoder_impl.h

Issue 1403893007: Adding third_party/openh264/src, build files and unittests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename var to 'use_openh264', add OpenH264 to 'all' target of GN Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698