| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "media/base/audio_decoder_config.h" | 7 #include "media/base/audio_decoder_config.h" |
| 8 #include "media/base/decoder_buffer.h" | 8 #include "media/base/decoder_buffer.h" |
| 9 #include "media/base/mock_demuxer_host.h" | 9 #include "media/base/mock_demuxer_host.h" |
| 10 #include "media/base/test_data_util.h" | 10 #include "media/base/test_data_util.h" |
| (...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 ASSERT_TRUE(InitDemuxerWithEncryptionInfo( | 798 ASSERT_TRUE(InitDemuxerWithEncryptionInfo( |
| 799 has_audio, has_video, is_audio_encrypted, is_video_encrypted)); | 799 has_audio, has_video, is_audio_encrypted, is_video_encrypted)); |
| 800 | 800 |
| 801 scoped_refptr<DemuxerStream> audio_stream = | 801 scoped_refptr<DemuxerStream> audio_stream = |
| 802 demuxer_->GetStream(DemuxerStream::AUDIO); | 802 demuxer_->GetStream(DemuxerStream::AUDIO); |
| 803 if (has_audio) { | 803 if (has_audio) { |
| 804 ASSERT_TRUE(audio_stream); | 804 ASSERT_TRUE(audio_stream); |
| 805 | 805 |
| 806 const AudioDecoderConfig& config = audio_stream->audio_decoder_config(); | 806 const AudioDecoderConfig& config = audio_stream->audio_decoder_config(); |
| 807 EXPECT_EQ(kCodecVorbis, config.codec()); | 807 EXPECT_EQ(kCodecVorbis, config.codec()); |
| 808 EXPECT_EQ(16, config.bits_per_channel()); | 808 EXPECT_EQ(32, config.bits_per_channel()); |
| 809 EXPECT_EQ(CHANNEL_LAYOUT_STEREO, config.channel_layout()); | 809 EXPECT_EQ(CHANNEL_LAYOUT_STEREO, config.channel_layout()); |
| 810 EXPECT_EQ(44100, config.samples_per_second()); | 810 EXPECT_EQ(44100, config.samples_per_second()); |
| 811 EXPECT_TRUE(config.extra_data()); | 811 EXPECT_TRUE(config.extra_data()); |
| 812 EXPECT_GT(config.extra_data_size(), 0u); | 812 EXPECT_GT(config.extra_data_size(), 0u); |
| 813 EXPECT_EQ(kSampleFormatPlanarF32, config.sample_format()); |
| 813 EXPECT_EQ(is_audio_encrypted, | 814 EXPECT_EQ(is_audio_encrypted, |
| 814 audio_stream->audio_decoder_config().is_encrypted()); | 815 audio_stream->audio_decoder_config().is_encrypted()); |
| 815 } else { | 816 } else { |
| 816 EXPECT_FALSE(audio_stream); | 817 EXPECT_FALSE(audio_stream); |
| 817 } | 818 } |
| 818 | 819 |
| 819 scoped_refptr<DemuxerStream> video_stream = | 820 scoped_refptr<DemuxerStream> video_stream = |
| 820 demuxer_->GetStream(DemuxerStream::VIDEO); | 821 demuxer_->GetStream(DemuxerStream::VIDEO); |
| 821 if (has_video) { | 822 if (has_video) { |
| 822 EXPECT_TRUE(video_stream); | 823 EXPECT_TRUE(video_stream); |
| (...skipping 1696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2519 // call. This can happen if video element gets destroyed before | 2520 // call. This can happen if video element gets destroyed before |
| 2520 // the pipeline has a chance to initialize the demuxer. | 2521 // the pipeline has a chance to initialize the demuxer. |
| 2521 TEST_F(ChunkDemuxerTest, TestShutdownBeforeInitialize) { | 2522 TEST_F(ChunkDemuxerTest, TestShutdownBeforeInitialize) { |
| 2522 demuxer_->Shutdown(); | 2523 demuxer_->Shutdown(); |
| 2523 demuxer_->Initialize( | 2524 demuxer_->Initialize( |
| 2524 &host_, CreateInitDoneCB(DEMUXER_ERROR_COULD_NOT_OPEN)); | 2525 &host_, CreateInitDoneCB(DEMUXER_ERROR_COULD_NOT_OPEN)); |
| 2525 message_loop_.RunUntilIdle(); | 2526 message_loop_.RunUntilIdle(); |
| 2526 } | 2527 } |
| 2527 | 2528 |
| 2528 } // namespace media | 2529 } // namespace media |
| OLD | NEW |