| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <utility> | 6 #include <utility> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 void MockOnDecoderSelected(scoped_ptr<AudioDecoder> decoder, | 71 void MockOnDecoderSelected(scoped_ptr<AudioDecoder> decoder, |
| 72 scoped_ptr<DecryptingDemuxerStream> stream) { | 72 scoped_ptr<DecryptingDemuxerStream> stream) { |
| 73 OnDecoderSelected(decoder.get(), stream.get()); | 73 OnDecoderSelected(decoder.get(), stream.get()); |
| 74 selected_decoder_ = std::move(decoder); | 74 selected_decoder_ = std::move(decoder); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void UseClearStream() { | 77 void UseClearStream() { |
| 78 AudioDecoderConfig clear_audio_config(kCodecVorbis, kSampleFormatPlanarF32, | 78 AudioDecoderConfig clear_audio_config(kCodecVorbis, kSampleFormatPlanarF32, |
| 79 CHANNEL_LAYOUT_STEREO, 44100, | 79 CHANNEL_LAYOUT_STEREO, 44100, |
| 80 EmptyExtraData(), Unencrypted()); | 80 EmptyExtraData(), false); |
| 81 demuxer_stream_->set_audio_decoder_config(clear_audio_config); | 81 demuxer_stream_->set_audio_decoder_config(clear_audio_config); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void UseEncryptedStream() { | 84 void UseEncryptedStream() { |
| 85 AudioDecoderConfig encrypted_audio_config( | 85 AudioDecoderConfig encrypted_audio_config( |
| 86 kCodecVorbis, kSampleFormatPlanarF32, CHANNEL_LAYOUT_STEREO, 44100, | 86 kCodecVorbis, kSampleFormatPlanarF32, CHANNEL_LAYOUT_STEREO, 44100, |
| 87 EmptyExtraData(), AesCtrEncryptionScheme()); | 87 EmptyExtraData(), true); |
| 88 demuxer_stream_->set_audio_decoder_config(encrypted_audio_config); | 88 demuxer_stream_->set_audio_decoder_config(encrypted_audio_config); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void InitializeDecoderSelector(DecryptorCapability decryptor_capability, | 91 void InitializeDecoderSelector(DecryptorCapability decryptor_capability, |
| 92 int num_decoders) { | 92 int num_decoders) { |
| 93 if (decryptor_capability != kNoCdm) { | 93 if (decryptor_capability != kNoCdm) { |
| 94 cdm_context_.reset(new StrictMock<MockCdmContext>()); | 94 cdm_context_.reset(new StrictMock<MockCdmContext>()); |
| 95 | 95 |
| 96 if (decryptor_capability == kNoDecryptor) { | 96 if (decryptor_capability == kNoDecryptor) { |
| 97 EXPECT_CALL(*cdm_context_, GetDecryptor()) | 97 EXPECT_CALL(*cdm_context_, GetDecryptor()) |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 // initialized and returned. | 376 // initialized and returned. |
| 377 EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _)) | 377 EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _)) |
| 378 .WillOnce(RunCallback<2>(true)); | 378 .WillOnce(RunCallback<2>(true)); |
| 379 EXPECT_CALL(*this, OnDecoderSelected(NotNull(), NotNull())); | 379 EXPECT_CALL(*this, OnDecoderSelected(NotNull(), NotNull())); |
| 380 #endif | 380 #endif |
| 381 | 381 |
| 382 SelectDecoder(); | 382 SelectDecoder(); |
| 383 } | 383 } |
| 384 | 384 |
| 385 } // namespace media | 385 } // namespace media |
| OLD | NEW |