diff options
author | hkuang <hkuang@google.com> | 2014-10-31 12:10:46 -0700 |
---|---|---|
committer | hkuang <hkuang@google.com> | 2014-11-06 13:51:08 -0800 |
commit | ad693e1ff514f56928fc62790315906f9564395e (patch) | |
tree | 8388fad130dfac4ee79310a14976385c55731a8d /test/webm_video_source.h | |
parent | 9ce3a7d76c5ef702337b96b9aa2c944da1b31869 (diff) | |
download | libvpx-ad693e1ff514f56928fc62790315906f9564395e.tar libvpx-ad693e1ff514f56928fc62790315906f9564395e.tar.gz libvpx-ad693e1ff514f56928fc62790315906f9564395e.tar.bz2 libvpx-ad693e1ff514f56928fc62790315906f9564395e.zip |
Add key frame seeking to webmdec and webm_video_source.
This is for the frame parallel's pause/seek/resume unit test.
Change-Id: Ie235f86ca5f3d525896222766f6d610e6682fd76
Diffstat (limited to 'test/webm_video_source.h')
-rw-r--r-- | test/webm_video_source.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/webm_video_source.h b/test/webm_video_source.h index 11d3d234d..650bc52dc 100644 --- a/test/webm_video_source.h +++ b/test/webm_video_source.h @@ -69,6 +69,18 @@ class WebMVideoSource : public CompressedVideoSource { } } + void SeekToNextKeyFrame() { + ASSERT_TRUE(vpx_ctx_->file != NULL); + do { + const int status = webm_read_frame(webm_ctx_, &buf_, &buf_sz_, &buf_sz_); + ASSERT_GE(status, 0) << "webm_read_frame failed"; + ++frame_; + if (status == 1) { + end_of_file_ = true; + } + } while (!webm_ctx_->is_key_frame && !end_of_file_); + } + virtual const uint8_t *cxdata() const { return end_of_file_ ? NULL : buf_; } |