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

Unified Diff: media/filters/ffmpeg_video_decode_engine.cc

Issue 3030013: preparation for recycling buffer, patch 2 (Closed)
Patch Set: fix layout test Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/ffmpeg_video_decode_engine.h ('k') | media/filters/ffmpeg_video_decode_engine_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_video_decode_engine.cc
diff --git a/media/filters/ffmpeg_video_decode_engine.cc b/media/filters/ffmpeg_video_decode_engine.cc
index 6c5b16f08933398eb44b05f00e7141a32bdcccb0..0454eb456f6d6076fab2f5cd4edc7761231e35a9 100644
--- a/media/filters/ffmpeg_video_decode_engine.cc
+++ b/media/filters/ffmpeg_video_decode_engine.cc
@@ -119,6 +119,15 @@ void FFmpegVideoDecodeEngine::EmptyThisBuffer(
DecodeFrame(buffer);
}
+void FFmpegVideoDecodeEngine::FillThisBuffer(scoped_refptr<VideoFrame> frame) {
+ scoped_refptr<Buffer> buffer;
+ empty_this_buffer_callback_->Run(buffer);
+}
+
+bool FFmpegVideoDecodeEngine::ProvidesBuffer() const {
+ return false;
+}
+
// Try to decode frame when both input and output are ready.
void FFmpegVideoDecodeEngine::DecodeFrame(scoped_refptr<Buffer> buffer) {
scoped_refptr<VideoFrame> video_frame;
@@ -157,7 +166,10 @@ void FFmpegVideoDecodeEngine::DecodeFrame(scoped_refptr<Buffer> buffer) {
// If frame_decoded == 0, then no frame was produced.
if (frame_decoded == 0) {
- fill_this_buffer_callback_->Run(video_frame);
+ if (buffer->IsEndOfStream()) // We had started flushing.
+ fill_this_buffer_callback_->Run(video_frame);
+ else
+ empty_this_buffer_callback_->Run(buffer);
return;
}
@@ -234,6 +246,10 @@ void FFmpegVideoDecodeEngine::Flush(Task* done_cb) {
avcodec_flush_buffers(codec_context_);
}
+void FFmpegVideoDecodeEngine::Seek(Task* done_cb) {
+ AutoTaskRunner done_runner(done_cb);
+}
+
VideoFrame::Format FFmpegVideoDecodeEngine::GetSurfaceFormat() const {
// J (Motion JPEG) versions of YUV are full range 0..255.
// Regular (MPEG) YUV is 16..240.
« no previous file with comments | « media/filters/ffmpeg_video_decode_engine.h ('k') | media/filters/ffmpeg_video_decode_engine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698