Add pre decode frame hook to decoder test class.

Adds a hook that derived test classes can implement to be notified
before every call to decode a frame.

Change-Id: Iefa836459cf3e5d7df9ee27f8198daf82b1be088
This commit is contained in:
Frank Galligan 2013-12-09 17:07:10 -08:00
parent a19d694f09
commit f9d69bd0fd
2 changed files with 5 additions and 0 deletions

View File

@ -30,6 +30,7 @@ void DecoderTest::RunLoop(CompressedVideoSource *video) {
// Decode frames.
for (video->Begin(); video->cxdata(); video->Next()) {
PreDecodeFrameHook(*video, decoder);
vpx_codec_err_t res_dec = decoder->DecodeFrame(video->cxdata(),
video->frame_size());
ASSERT_EQ(VPX_CODEC_OK, res_dec) << decoder->DecodeError();

View File

@ -101,6 +101,10 @@ class DecoderTest {
// Main decoding loop
virtual void RunLoop(CompressedVideoSource *video);
// Hook to be called before decompressing every frame.
virtual void PreDecodeFrameHook(const CompressedVideoSource& video,
Decoder *decoder) {}
// Hook to be called on every decompressed frame.
virtual void DecompressedFrameHook(const vpx_image_t& img,
const unsigned int frame_number) {}