diff options
author | Vignesh Venkatasubramanian <vigneshv@google.com> | 2016-04-27 06:17:12 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-04-27 06:17:12 +0000 |
commit | 021105e3ac551bfdfca07485d55d8bf168f07d1a (patch) | |
tree | d16ab40ad7dd61aa26c5d1dbc93e7876ebd2a2f1 | |
parent | 9dfec135a69b9ebafbaf7b28d33e46797828d7de (diff) | |
parent | fa99c376e509ef52ed8370019538b23e76477ddb (diff) | |
download | libvpx-021105e3ac551bfdfca07485d55d8bf168f07d1a.tar libvpx-021105e3ac551bfdfca07485d55d8bf168f07d1a.tar.gz libvpx-021105e3ac551bfdfca07485d55d8bf168f07d1a.tar.bz2 libvpx-021105e3ac551bfdfca07485d55d8bf168f07d1a.zip |
Merge "TODO cleanup: Remove unused buffer_size"
-rw-r--r-- | test/webm_video_source.h | 4 | ||||
-rw-r--r-- | vpxdec.c | 3 | ||||
-rw-r--r-- | webmdec.cc | 9 | ||||
-rw-r--r-- | webmdec.h | 6 |
4 files changed, 8 insertions, 14 deletions
diff --git a/test/webm_video_source.h b/test/webm_video_source.h index 650bc52dc..825875687 100644 --- a/test/webm_video_source.h +++ b/test/webm_video_source.h @@ -62,7 +62,7 @@ class WebMVideoSource : public CompressedVideoSource { void FillFrame() { ASSERT_TRUE(vpx_ctx_->file != NULL); - const int status = webm_read_frame(webm_ctx_, &buf_, &buf_sz_, &buf_sz_); + const int status = webm_read_frame(webm_ctx_, &buf_, &buf_sz_); ASSERT_GE(status, 0) << "webm_read_frame failed"; if (status == 1) { end_of_file_ = true; @@ -72,7 +72,7 @@ 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_); + const int status = webm_read_frame(webm_ctx_, &buf_, &buf_sz_); ASSERT_GE(status, 0) << "webm_read_frame failed"; ++frame_; if (status == 1) { @@ -257,8 +257,7 @@ static int read_frame(struct VpxDecInputContext *input, uint8_t **buf, switch (input->vpx_input_ctx->file_type) { #if CONFIG_WEBM_IO case FILE_TYPE_WEBM: - return webm_read_frame(input->webm_ctx, - buf, bytes_in_buffer, buffer_size); + return webm_read_frame(input->webm_ctx, buf, bytes_in_buffer); #endif case FILE_TYPE_RAW: return raw_read_frame(input->vpx_input_ctx->file, diff --git a/webmdec.cc b/webmdec.cc index 81150aa66..93835e1de 100644 --- a/webmdec.cc +++ b/webmdec.cc @@ -122,7 +122,6 @@ int file_is_webm(struct WebmInputContext *webm_ctx, int webm_read_frame(struct WebmInputContext *webm_ctx, uint8_t **buffer, - size_t *bytes_in_buffer, size_t *buffer_size) { // This check is needed for frame parallel decoding, in which case this // function could be called even after it has reached end of input stream. @@ -147,7 +146,7 @@ int webm_read_frame(struct WebmInputContext *webm_ctx, } else if (block_entry_eos || block_entry->EOS()) { cluster = segment->GetNext(cluster); if (cluster == NULL || cluster->EOS()) { - *bytes_in_buffer = 0; + *buffer_size = 0; webm_ctx->reached_eos = 1; return 1; } @@ -187,10 +186,9 @@ int webm_read_frame(struct WebmInputContext *webm_ctx, if (*buffer == NULL) { return -1; } - *buffer_size = frame.len; webm_ctx->buffer = *buffer; } - *bytes_in_buffer = frame.len; + *buffer_size = frame.len; webm_ctx->timestamp_ns = block->GetTime(cluster); webm_ctx->is_key_frame = block->IsKey(); @@ -203,10 +201,9 @@ int webm_guess_framerate(struct WebmInputContext *webm_ctx, struct VpxInputContext *vpx_ctx) { uint32_t i = 0; uint8_t *buffer = NULL; - size_t bytes_in_buffer = 0; size_t buffer_size = 0; while (webm_ctx->timestamp_ns < 1000000000 && i < 50) { - if (webm_read_frame(webm_ctx, &buffer, &bytes_in_buffer, &buffer_size)) { + if (webm_read_frame(webm_ctx, &buffer, &buffer_size)) { break; } ++i; @@ -42,20 +42,18 @@ int file_is_webm(struct WebmInputContext *webm_ctx, // Reads a WebM Video Frame. Memory for the buffer is created, owned and managed // by this function. For the first call, |buffer| should be NULL and -// |*bytes_in_buffer| should be 0. Once all the frames are read and used, +// |*buffer_size| should be 0. Once all the frames are read and used, // webm_free() should be called, otherwise there will be a leak. // Parameters: // webm_ctx - WebmInputContext object // buffer - pointer where the frame data will be filled. -// bytes_in_buffer - pointer to buffer size. -// buffer_size - unused TODO(vigneshv): remove this +// buffer_size - pointer to buffer size. // Return values: // 0 - Success // 1 - End of Stream // -1 - Error int webm_read_frame(struct WebmInputContext *webm_ctx, uint8_t **buffer, - size_t *bytes_in_buffer, size_t *buffer_size); // Guesses the frame rate of the input file based on the container timestamps. |