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

Unified Diff: source/libvpx/test/decode_test_driver.h

Issue 812033011: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 5 years, 11 months 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
« no previous file with comments | « source/libvpx/test/decode_perf_test.cc ('k') | source/libvpx/test/decode_test_driver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/test/decode_test_driver.h
===================================================================
--- source/libvpx/test/decode_test_driver.h (revision 293588)
+++ source/libvpx/test/decode_test_driver.h (working copy)
@@ -41,10 +41,16 @@
class Decoder {
public:
Decoder(vpx_codec_dec_cfg_t cfg, unsigned long deadline)
- : cfg_(cfg), deadline_(deadline), init_done_(false) {
+ : cfg_(cfg), flags_(0), deadline_(deadline), init_done_(false) {
memset(&decoder_, 0, sizeof(decoder_));
}
+ Decoder(vpx_codec_dec_cfg_t cfg, const vpx_codec_flags_t flag,
+ unsigned long deadline) // NOLINT
+ : cfg_(cfg), flags_(flag), deadline_(deadline), init_done_(false) {
+ memset(&decoder_, 0, sizeof(decoder_));
+ }
+
virtual ~Decoder() {
vpx_codec_destroy(&decoder_);
}
@@ -66,15 +72,19 @@
}
void Control(int ctrl_id, int arg) {
+ Control(ctrl_id, arg, VPX_CODEC_OK);
+ }
+
+ void Control(int ctrl_id, const void *arg) {
InitOnce();
const vpx_codec_err_t res = vpx_codec_control_(&decoder_, ctrl_id, arg);
ASSERT_EQ(VPX_CODEC_OK, res) << DecodeError();
}
- void Control(int ctrl_id, const void *arg) {
+ void Control(int ctrl_id, int arg, vpx_codec_err_t expected_value) {
InitOnce();
const vpx_codec_err_t res = vpx_codec_control_(&decoder_, ctrl_id, arg);
- ASSERT_EQ(VPX_CODEC_OK, res) << DecodeError();
+ ASSERT_EQ(expected_value, res) << DecodeError();
}
const char* DecodeError() {
@@ -97,6 +107,10 @@
bool IsVP8() const;
+ vpx_codec_ctx_t * GetDecoder() {
+ return &decoder_;
+ }
+
protected:
virtual vpx_codec_iface_t* CodecInterface() const = 0;
@@ -104,7 +118,7 @@
if (!init_done_) {
const vpx_codec_err_t res = vpx_codec_dec_init(&decoder_,
CodecInterface(),
- &cfg_, 0);
+ &cfg_, flags_);
ASSERT_EQ(VPX_CODEC_OK, res) << DecodeError();
init_done_ = true;
}
@@ -112,6 +126,7 @@
vpx_codec_ctx_t decoder_;
vpx_codec_dec_cfg_t cfg_;
+ vpx_codec_flags_t flags_;
unsigned int deadline_;
bool init_done_;
};
@@ -124,6 +139,9 @@
virtual void RunLoop(CompressedVideoSource *video,
const vpx_codec_dec_cfg_t &dec_cfg);
+ virtual void set_cfg(const vpx_codec_dec_cfg_t &dec_cfg);
+ virtual void set_flags(const vpx_codec_flags_t flags);
+
// Hook to be called before decompressing every frame.
virtual void PreDecodeFrameHook(const CompressedVideoSource& /*video*/,
Decoder* /*decoder*/) {}
@@ -146,11 +164,16 @@
const vpx_codec_err_t res_peek);
protected:
- explicit DecoderTest(const CodecFactory *codec) : codec_(codec) {}
+ explicit DecoderTest(const CodecFactory *codec)
+ : codec_(codec),
+ cfg_(),
+ flags_(0) {}
virtual ~DecoderTest() {}
const CodecFactory *codec_;
+ vpx_codec_dec_cfg_t cfg_;
+ vpx_codec_flags_t flags_;
};
} // namespace libvpx_test
« no previous file with comments | « source/libvpx/test/decode_perf_test.cc ('k') | source/libvpx/test/decode_test_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698