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

Unified Diff: media/filters/ffmpeg_video_decoder.cc

Issue 8763010: Replace AudioDecoder::ProduceAudioSamples/ConsumeAudioSamples with read callbacks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mac tests Created 9 years 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_audio_decoder_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_video_decoder.cc
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc
index 66b25b6120005765a5ac5db310138897c54fece4..c1fa54d14865dc9941f80d3fbbceadbda7bb882e 100644
--- a/media/filters/ffmpeg_video_decoder.cc
+++ b/media/filters/ffmpeg_video_decoder.cc
@@ -171,8 +171,8 @@ void FFmpegVideoDecoder::Flush(const base::Closure& callback) {
}
void FFmpegVideoDecoder::Read(const ReadCB& callback) {
- // TODO(scherkus): forced task post since VideoRendererBase::FrameReady() will
- // call Read() on FFmpegVideoDecoder's thread as we executed |read_cb_|.
+ // Complete operation asynchronously on different stack of execution as per
+ // the API contract of VideoDecoder::Read()
message_loop_->PostTask(FROM_HERE, base::Bind(
&FFmpegVideoDecoder::DoRead, this, callback));
}
@@ -183,7 +183,7 @@ const gfx::Size& FFmpegVideoDecoder::natural_size() {
void FFmpegVideoDecoder::DoRead(const ReadCB& callback) {
DCHECK_EQ(MessageLoop::current(), message_loop_);
- CHECK(!callback.is_null());
+ DCHECK(!callback.is_null());
CHECK(read_cb_.is_null()) << "Overlapping decodes are not supported.";
// This can happen during shutdown after Stop() has been called.
@@ -211,8 +211,8 @@ void FFmpegVideoDecoder::ReadFromDemuxerStream() {
}
void FFmpegVideoDecoder::DecodeBuffer(const scoped_refptr<Buffer>& buffer) {
- // TODO(scherkus): forced task post since FFmpegDemuxerStream::Read() can
- // immediately execute our callback on FFmpegVideoDecoder's thread.
+ // TODO(scherkus): fix FFmpegDemuxerStream::Read() to not execute our read
+ // callback on the same execution stack so we can get rid of forced task post.
message_loop_->PostTask(FROM_HERE, base::Bind(
&FFmpegVideoDecoder::DoDecodeBuffer, this, buffer));
}
« no previous file with comments | « media/filters/ffmpeg_audio_decoder_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698