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

Unified Diff: media/filters/ffmpeg_video_decoder.cc

Issue 12989009: Remove reference counting from media::VideoDecoder and friends. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
Index: media/filters/ffmpeg_video_decoder.cc
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc
index 9dd4058513cff2f0d9a5b10b9983f44ba8373f64..105199f197660c4095dd5ac74e0a0bf9cfc60ab7 100644
--- a/media/filters/ffmpeg_video_decoder.cc
+++ b/media/filters/ffmpeg_video_decoder.cc
@@ -58,6 +58,7 @@ static int GetThreadCount(CodecID codec_id) {
FFmpegVideoDecoder::FFmpegVideoDecoder(
const scoped_refptr<base::MessageLoopProxy>& message_loop)
: message_loop_(message_loop),
+ weak_factory_(this),
state_(kUninitialized),
codec_context_(NULL),
av_frame_(NULL) {
@@ -134,6 +135,7 @@ void FFmpegVideoDecoder::Initialize(const scoped_refptr<DemuxerStream>& stream,
const StatisticsCB& statistics_cb) {
DCHECK(message_loop_->BelongsToCurrentThread());
PipelineStatusCB initialize_cb = BindToCurrentLoop(status_cb);
+ weak_this_ = weak_factory_.GetWeakPtr();
FFmpegGlue::InitializeFFmpeg();
DCHECK(!demuxer_stream_) << "Already initialized.";
@@ -224,7 +226,8 @@ void FFmpegVideoDecoder::ReturnFrameOrReadFromDemuxerStream() {
DCHECK_NE(state_, kUninitialized);
DCHECK_NE(state_, kDecodeFinished);
DCHECK(!read_cb_.is_null());
- demuxer_stream_->Read(base::Bind(&FFmpegVideoDecoder::BufferReady, this));
+ demuxer_stream_->Read(base::Bind(
Ami GONE FROM CHROMIUM 2013/03/22 23:48:01 Again, BindToCurrentLoop ?
scherkus (not reviewing) 2013/03/28 02:00:01 ditto
+ &FFmpegVideoDecoder::BufferReady, weak_this_));
}
void FFmpegVideoDecoder::BufferReady(

Powered by Google App Engine
This is Rietveld 408576698