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

Side by Side Diff: source/libvpx/test/webm_video_source.h

Issue 958693004: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 #ifndef TEST_WEBM_VIDEO_SOURCE_H_ 10 #ifndef TEST_WEBM_VIDEO_SOURCE_H_
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 void FillFrame() { 63 void FillFrame() {
64 ASSERT_TRUE(vpx_ctx_->file != NULL); 64 ASSERT_TRUE(vpx_ctx_->file != NULL);
65 const int status = webm_read_frame(webm_ctx_, &buf_, &buf_sz_, &buf_sz_); 65 const int status = webm_read_frame(webm_ctx_, &buf_, &buf_sz_, &buf_sz_);
66 ASSERT_GE(status, 0) << "webm_read_frame failed"; 66 ASSERT_GE(status, 0) << "webm_read_frame failed";
67 if (status == 1) { 67 if (status == 1) {
68 end_of_file_ = true; 68 end_of_file_ = true;
69 } 69 }
70 } 70 }
71 71
72 void SeekToNextKeyFrame() {
73 ASSERT_TRUE(vpx_ctx_->file != NULL);
74 do {
75 const int status = webm_read_frame(webm_ctx_, &buf_, &buf_sz_, &buf_sz_);
76 ASSERT_GE(status, 0) << "webm_read_frame failed";
77 ++frame_;
78 if (status == 1) {
79 end_of_file_ = true;
80 }
81 } while (!webm_ctx_->is_key_frame && !end_of_file_);
82 }
83
72 virtual const uint8_t *cxdata() const { 84 virtual const uint8_t *cxdata() const {
73 return end_of_file_ ? NULL : buf_; 85 return end_of_file_ ? NULL : buf_;
74 } 86 }
75 virtual size_t frame_size() const { return buf_sz_; } 87 virtual size_t frame_size() const { return buf_sz_; }
76 virtual unsigned int frame_number() const { return frame_; } 88 virtual unsigned int frame_number() const { return frame_; }
77 89
78 protected: 90 protected:
79 std::string file_name_; 91 std::string file_name_;
80 VpxInputContext *vpx_ctx_; 92 VpxInputContext *vpx_ctx_;
81 WebmInputContext *webm_ctx_; 93 WebmInputContext *webm_ctx_;
82 uint8_t *buf_; 94 uint8_t *buf_;
83 size_t buf_sz_; 95 size_t buf_sz_;
84 unsigned int frame_; 96 unsigned int frame_;
85 bool end_of_file_; 97 bool end_of_file_;
86 }; 98 };
87 99
88 } // namespace libvpx_test 100 } // namespace libvpx_test
89 101
90 #endif // TEST_WEBM_VIDEO_SOURCE_H_ 102 #endif // TEST_WEBM_VIDEO_SOURCE_H_
OLDNEW
« no previous file with comments | « source/libvpx/test/vp9_frame_parallel_test.cc ('k') | source/libvpx/third_party/x86inc/x86inc.asm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698