diff options
Diffstat (limited to 'third_party/aom/test/webm_video_source.h')
-rw-r--r-- | third_party/aom/test/webm_video_source.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/third_party/aom/test/webm_video_source.h b/third_party/aom/test/webm_video_source.h index b6c998042..482f5dea2 100644 --- a/third_party/aom/test/webm_video_source.h +++ b/third_party/aom/test/webm_video_source.h @@ -15,8 +15,8 @@ #include <cstdlib> #include <new> #include <string> -#include "../tools_common.h" -#include "../webmdec.h" +#include "common/tools_common.h" +#include "common/webmdec.h" #include "test/video_source.h" namespace libaom_test { @@ -27,8 +27,8 @@ class WebMVideoSource : public CompressedVideoSource { public: explicit WebMVideoSource(const std::string &file_name) : file_name_(file_name), aom_ctx_(new AvxInputContext()), - webm_ctx_(new WebmInputContext()), buf_(NULL), buf_sz_(0), frame_(0), - end_of_file_(false) {} + webm_ctx_(new WebmInputContext()), buf_(NULL), buf_sz_(0), frame_sz_(0), + frame_number_(0), end_of_file_(false) {} virtual ~WebMVideoSource() { if (aom_ctx_->file != NULL) fclose(aom_ctx_->file); @@ -50,13 +50,13 @@ class WebMVideoSource : public CompressedVideoSource { } virtual void Next() { - ++frame_; + ++frame_number_; FillFrame(); } void FillFrame() { ASSERT_TRUE(aom_ctx_->file != NULL); - const int status = webm_read_frame(webm_ctx_, &buf_, &buf_sz_); + const int status = webm_read_frame(webm_ctx_, &buf_, &frame_sz_, &buf_sz_); ASSERT_GE(status, 0) << "webm_read_frame failed"; if (status == 1) { end_of_file_ = true; @@ -66,9 +66,10 @@ class WebMVideoSource : public CompressedVideoSource { void SeekToNextKeyFrame() { ASSERT_TRUE(aom_ctx_->file != NULL); do { - const int status = webm_read_frame(webm_ctx_, &buf_, &buf_sz_); + const int status = + webm_read_frame(webm_ctx_, &buf_, &frame_sz_, &buf_sz_); ASSERT_GE(status, 0) << "webm_read_frame failed"; - ++frame_; + ++frame_number_; if (status == 1) { end_of_file_ = true; } @@ -76,16 +77,17 @@ class WebMVideoSource : public CompressedVideoSource { } virtual const uint8_t *cxdata() const { return end_of_file_ ? NULL : buf_; } - virtual size_t frame_size() const { return buf_sz_; } - virtual unsigned int frame_number() const { return frame_; } + virtual size_t frame_size() const { return frame_sz_; } + virtual unsigned int frame_number() const { return frame_number_; } protected: std::string file_name_; AvxInputContext *aom_ctx_; WebmInputContext *webm_ctx_; - uint8_t *buf_; + uint8_t *buf_; // Owned by webm_ctx_ and freed when webm_ctx_ is freed. size_t buf_sz_; - unsigned int frame_; + size_t frame_sz_; + unsigned int frame_number_; bool end_of_file_; }; |