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

Unified Diff: media/filters/ffmpeg_audio_decoder.cc

Issue 10447035: Introducing DecoderBuffer and general Buffer cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/2011/2012/ Created 8 years, 7 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 dc660e5a391f8a0da16dea33287f9455b11ec2c4..be750bf7c8e710bd97154ca6898a2d2d2f293213 100644
--- a/media/filters/ffmpeg_audio_decoder.cc
+++ b/media/filters/ffmpeg_audio_decoder.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "media/base/audio_decoder_config.h"
#include "media/base/data_buffer.h"
+#include "media/base/decoder_buffer.h"
#include "media/base/demuxer.h"
#include "media/base/pipeline.h"
#include "media/ffmpeg/ffmpeg_common.h"
@@ -168,7 +169,8 @@ void FFmpegAudioDecoder::DoRead(const ReadCB& read_cb) {
ReadFromDemuxerStream();
}
-void FFmpegAudioDecoder::DoDecodeBuffer(const scoped_refptr<Buffer>& input) {
+void FFmpegAudioDecoder::DoDecodeBuffer(
+ const scoped_refptr<DecoderBuffer>& input) {
DCHECK_EQ(MessageLoop::current(), message_loop_);
DCHECK(!read_cb_.is_null());
@@ -190,13 +192,8 @@ void FFmpegAudioDecoder::DoDecodeBuffer(const scoped_refptr<Buffer>& input) {
AVPacket packet;
av_init_packet(&packet);
- if (input->IsEndOfStream()) {
- packet.data = NULL;
- packet.size = 0;
- } else {
- packet.data = const_cast<uint8*>(input->GetData());
- packet.size = input->GetDataSize();
- }
+ packet.data = const_cast<uint8*>(input->GetData());
+ packet.size = input->GetDataSize();
PipelineStatistics statistics;
statistics.audio_bytes_decoded = input->GetDataSize();
@@ -256,7 +253,8 @@ void FFmpegAudioDecoder::ReadFromDemuxerStream() {
demuxer_stream_->Read(base::Bind(&FFmpegAudioDecoder::DecodeBuffer, this));
}
-void FFmpegAudioDecoder::DecodeBuffer(const scoped_refptr<Buffer>& buffer) {
+void FFmpegAudioDecoder::DecodeBuffer(
+ const scoped_refptr<DecoderBuffer>& buffer) {
// 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(
« 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