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

Unified Diff: media/filters/ffmpeg_audio_decoder_unittest.cc

Issue 7867051: Introduce AudioDecoderConfig to migrate away from GetAVStream(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: forgot files 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
Index: media/filters/ffmpeg_audio_decoder_unittest.cc
diff --git a/media/filters/ffmpeg_audio_decoder_unittest.cc b/media/filters/ffmpeg_audio_decoder_unittest.cc
index 843137b2f557ea65492f1c4d067abe950d25a486..36bab517e54f87d07c686860186c7241fc09404c 100644
--- a/media/filters/ffmpeg_audio_decoder_unittest.cc
+++ b/media/filters/ffmpeg_audio_decoder_unittest.cc
@@ -42,25 +42,19 @@ class FFmpegAudioDecoderTest : public testing::Test {
base::Bind(&FFmpegAudioDecoderTest::DecodeFinished,
base::Unretained(this)));
- memset(&stream_, 0, sizeof(stream_));
- memset(&codec_context_, 0, sizeof(codec_context_));
-
- stream_.codec = &codec_context_;
- codec_context_.codec_id = CODEC_ID_VORBIS;
- codec_context_.codec_type = AVMEDIA_TYPE_AUDIO;
- codec_context_.channels = 2;
- codec_context_.channel_layout = AV_CH_LAYOUT_STEREO;
- codec_context_.sample_fmt = AV_SAMPLE_FMT_S16;
- codec_context_.sample_rate = 44100;
- codec_context_.extradata = vorbis_extradata_.get();
- codec_context_.extradata_size = vorbis_extradata_size_;
+ config_.reset(new AudioDecoderConfig(kCodecVorbis,
+ 16,
+ CHANNEL_LAYOUT_STEREO,
+ 44100,
+ vorbis_extradata_.get(),
+ vorbis_extradata_size_));
}
virtual ~FFmpegAudioDecoderTest() {}
void Initialize() {
- EXPECT_CALL(*demuxer_, GetAVStream())
- .WillOnce(Return(&stream_));
+ EXPECT_CALL(*demuxer_, audio_decoder_config())
+ .WillOnce(Return(config_.get()));
decoder_->Initialize(demuxer_,
NewExpectedCallback(),
@@ -101,8 +95,7 @@ class FFmpegAudioDecoderTest : public testing::Test {
scoped_refptr<Buffer> vorbis_packet_2_;
int vorbis_packet_index_;
- AVStream stream_;
- AVCodecContext codec_context_;
+ scoped_ptr<AudioDecoderConfig> config_;
};
TEST_F(FFmpegAudioDecoderTest, Initialize) {

Powered by Google App Engine
This is Rietveld 408576698