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

Unified Diff: media/filters/ffmpeg_audio_decoder.cc

Issue 7796033: Replace AudioDecoderConfig with simple accessors on AudioDecoder. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: rebase Created 9 years, 3 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_audio_decoder.h ('k') | media/filters/ffmpeg_audio_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_audio_decoder.cc
diff --git a/media/filters/ffmpeg_audio_decoder.cc b/media/filters/ffmpeg_audio_decoder.cc
index 22c568574395cbe344d5f11b7061ac0966a644e4..50335d3829b77adf5d1cf852bb76fedbbae9d0e5 100644
--- a/media/filters/ffmpeg_audio_decoder.cc
+++ b/media/filters/ffmpeg_audio_decoder.cc
@@ -29,7 +29,9 @@ const size_t FFmpegAudioDecoder::kOutputBufferSize =
FFmpegAudioDecoder::FFmpegAudioDecoder(MessageLoop* message_loop)
: DecoderBase<AudioDecoder, Buffer>(message_loop),
codec_context_(NULL),
- config_(0, CHANNEL_LAYOUT_NONE, 0),
+ bits_per_channel_(0),
+ channel_layout_(CHANNEL_LAYOUT_NONE),
+ sample_rate_(0),
estimated_next_timestamp_(kNoTimestamp) {
}
@@ -70,12 +72,11 @@ void FFmpegAudioDecoder::DoInitialize(DemuxerStream* demuxer_stream,
return;
}
- config_.bits_per_channel =
- av_get_bits_per_sample_fmt(codec_context_->sample_fmt);
- config_.channel_layout =
+ bits_per_channel_ = av_get_bits_per_sample_fmt(codec_context_->sample_fmt);
+ channel_layout_ =
ChannelLayoutToChromeChannelLayout(codec_context_->channel_layout,
codec_context_->channels);
- config_.sample_rate = codec_context_->sample_rate;
+ sample_rate_ = codec_context_->sample_rate;
// Prepare the output buffer.
output_buffer_.reset(static_cast<uint8*>(av_malloc(kOutputBufferSize)));
@@ -86,14 +87,22 @@ void FFmpegAudioDecoder::DoInitialize(DemuxerStream* demuxer_stream,
*success = true;
}
-AudioDecoderConfig FFmpegAudioDecoder::config() {
- return config_;
-}
-
void FFmpegAudioDecoder::ProduceAudioSamples(scoped_refptr<Buffer> output) {
DecoderBase<AudioDecoder, Buffer>::PostReadTaskHack(output);
}
+int FFmpegAudioDecoder::bits_per_channel() {
+ return bits_per_channel_;
+}
+
+ChannelLayout FFmpegAudioDecoder::channel_layout() {
+ return channel_layout_;
+}
+
+int FFmpegAudioDecoder::sample_rate() {
+ return sample_rate_;
+}
+
void FFmpegAudioDecoder::DoSeek(base::TimeDelta time, Task* done_cb) {
avcodec_flush_buffers(codec_context_);
estimated_next_timestamp_ = kNoTimestamp;
« no previous file with comments | « media/filters/ffmpeg_audio_decoder.h ('k') | media/filters/ffmpeg_audio_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698