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

Unified Diff: media/filters/ffmpeg_audio_decoder.cc

Issue 9325044: Remove AudioDecoder from the Filter heirarchy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved audio_decoder_ out of Pipeline; AudioRendererBase is in charge of it now. Created 8 years, 11 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_audio_decoder.cc
diff --git a/media/filters/ffmpeg_audio_decoder.cc b/media/filters/ffmpeg_audio_decoder.cc
index 608f330f481bd4baf74f78e0c7939c17d293a2ed..54db3f183f3e6cbf6310f6bc4fd6a9fce8621229 100644
--- a/media/filters/ffmpeg_audio_decoder.cc
+++ b/media/filters/ffmpeg_audio_decoder.cc
@@ -5,10 +5,10 @@
#include "media/filters/ffmpeg_audio_decoder.h"
#include "base/bind.h"
+#include "media/base/audio_decoder.h"
scherkus (not reviewing) 2012/02/06 21:04:04 this is in .h
Ami GONE FROM CHROMIUM 2012/02/06 21:38:48 Done.
#include "media/base/audio_decoder_config.h"
#include "media/base/data_buffer.h"
#include "media/base/demuxer.h"
-#include "media/base/filter_host.h"
#include "media/base/pipeline.h"
#include "media/ffmpeg/ffmpeg_common.h"
@@ -59,8 +59,8 @@ FFmpegAudioDecoder::FFmpegAudioDecoder(MessageLoop* message_loop)
FFmpegAudioDecoder::~FFmpegAudioDecoder() {
av_free(decoded_audio_);
- // XXX: should we require Stop() to be called? this might end up getting
- // called on a random thread due to refcounting.
+ // TODO(scherkus): should we require Stop() to be called? this might end up
+ // getting called on a random thread due to refcounting.
if (codec_context_) {
av_free(codec_context_->extradata);
avcodec_close(codec_context_);
@@ -68,23 +68,14 @@ FFmpegAudioDecoder::~FFmpegAudioDecoder() {
}
}
-void FFmpegAudioDecoder::Flush(const base::Closure& callback) {
- message_loop_->PostTask(
- FROM_HERE,
- base::Bind(&FFmpegAudioDecoder::DoFlush, this, callback));
-}
-
void FFmpegAudioDecoder::Initialize(
- DemuxerStream* stream,
+ const scoped_refptr<DemuxerStream> stream,
const PipelineStatusCB& callback,
const StatisticsCallback& stats_callback) {
- // TODO(scherkus): change Initialize() signature to pass |stream| as a
- // scoped_refptr<>.
- scoped_refptr<DemuxerStream> ref_stream(stream);
message_loop_->PostTask(
FROM_HERE,
base::Bind(&FFmpegAudioDecoder::DoInitialize, this,
- ref_stream, callback, stats_callback));
+ stream, callback, stats_callback));
}
void FFmpegAudioDecoder::Read(const ReadCB& callback) {
@@ -106,6 +97,11 @@ int FFmpegAudioDecoder::samples_per_second() {
return samples_per_second_;
}
+void FFmpegAudioDecoder::Reset(const base::Closure& closure) {
+ message_loop_->PostTask(FROM_HERE, base::Bind(
+ &FFmpegAudioDecoder::DoReset, this, closure));
+}
+
void FFmpegAudioDecoder::DoInitialize(
const scoped_refptr<DemuxerStream>& stream,
const PipelineStatusCB& callback,
@@ -148,10 +144,10 @@ void FFmpegAudioDecoder::DoInitialize(
callback.Run(PIPELINE_OK);
}
-void FFmpegAudioDecoder::DoFlush(const base::Closure& callback) {
+void FFmpegAudioDecoder::DoReset(const base::Closure& closure) {
avcodec_flush_buffers(codec_context_);
estimated_next_timestamp_ = kNoTimestamp();
- callback.Run();
+ closure.Run();
}
void FFmpegAudioDecoder::DoRead(const ReadCB& callback) {

Powered by Google App Engine
This is Rietveld 408576698