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

Unified Diff: third_party/openh264/testing/h264_codec_tester.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_codec_tester.h
diff --git a/third_party/openh264/testing/h264_codec_tester.h b/third_party/openh264/testing/h264_codec_tester.h
new file mode 100644
index 0000000000000000000000000000000000000000..a02457f4867a934655f12ee554e1ae2f53c16f47
--- /dev/null
+++ b/third_party/openh264/testing/h264_codec_tester.h
@@ -0,0 +1,41 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef OPENH264_TESTING_H264_CODEC_TESTER_H_
+#define OPENH264_TESTING_H264_CODEC_TESTER_H_
+
+#include "openh264/src/codec/api/svc/codec_api.h"
+#include "openh264/src/codec/api/svc/codec_app_def.h"
+#include "openh264/src/codec/api/svc/codec_def.h"
+#include "openh264/testing/h264_encoder_impl.h"
+#include "openh264/testing/h264_decoder_impl.h"
+
+namespace openh264 {
+
+class H264CodecTester : public EncodedImageCallback,
+ public DecodedImageCallback {
+ public:
+ H264CodecTester();
+ ~H264CodecTester();
+
+ bool Init(unsigned short width, unsigned short height);
+
+ bool Encode(const VideoFrame& frame);
+ VideoFrame* Decode();
+
+ private:
+ int32_t Encoded(const EncodedImage& encoded_image,
+ const CodecSpecificInfo* codec_specific_info,
+ const RTPFragmentationHeader* fragmentation) override;
+ int32_t Decoded(VideoFrame& decoded_image) override;
+
+ H264EncoderImpl encoder_;
+ H264DecoderImpl decoder_;
+ const EncodedImage* last_encoded_image_;
+ VideoFrame* last_decoded_image_;
+};
+
+} // namespace openh264
+
+#endif // OPENH264_TESTING_H264_CODEC_TESTER_H_

Powered by Google App Engine
This is Rietveld 408576698