summaryrefslogtreecommitdiffstats
path: root/third_party/aom/test/webm_video_source.h
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2018-10-19 21:52:15 -0500
committertrav90 <travawine@palemoon.org>2018-10-19 21:52:20 -0500
commitbbcc64772580c8a979288791afa02d30bc476d2e (patch)
tree437ce94c3fdd7497508e5b55de06c6d011678597 /third_party/aom/test/webm_video_source.h
parent14805f6ddbfb173c327768fff9f81f40ce5e81b0 (diff)
downloadUXP-bbcc64772580c8a979288791afa02d30bc476d2e.tar
UXP-bbcc64772580c8a979288791afa02d30bc476d2e.tar.gz
UXP-bbcc64772580c8a979288791afa02d30bc476d2e.tar.lz
UXP-bbcc64772580c8a979288791afa02d30bc476d2e.tar.xz
UXP-bbcc64772580c8a979288791afa02d30bc476d2e.zip
Update aom to v1.0.0
Update aom to commit id d14c5bb4f336ef1842046089849dee4a301fbbf0.
Diffstat (limited to 'third_party/aom/test/webm_video_source.h')
-rw-r--r--third_party/aom/test/webm_video_source.h26
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_;
};