| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <memory> | 5 #include <memory> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 encrypted_(encrypted), | 89 encrypted_(encrypted), |
| 90 pipeline_backend_(nullptr) { | 90 pipeline_backend_(nullptr) { |
| 91 eos_[STREAM_AUDIO] = eos_[STREAM_VIDEO] = false; | 91 eos_[STREAM_AUDIO] = eos_[STREAM_VIDEO] = false; |
| 92 } | 92 } |
| 93 | 93 |
| 94 void Setup() { | 94 void Setup() { |
| 95 if (encrypted_) { | 95 if (encrypted_) { |
| 96 cdm_context_.reset(new CastCdmContextForTest()); | 96 cdm_context_.reset(new CastCdmContextForTest()); |
| 97 } | 97 } |
| 98 std::unique_ptr<MediaPipelineBackendDefault> backend = | 98 std::unique_ptr<MediaPipelineBackendDefault> backend = |
| 99 base::WrapUnique(new MediaPipelineBackendDefault()); | 99 base::MakeUnique<MediaPipelineBackendDefault>(); |
| 100 pipeline_backend_ = backend.get(); | 100 pipeline_backend_ = backend.get(); |
| 101 media_pipeline_.Initialize(kLoadTypeURL, std::move(backend)); | 101 media_pipeline_.Initialize(kLoadTypeURL, std::move(backend)); |
| 102 | 102 |
| 103 if (have_audio_) { | 103 if (have_audio_) { |
| 104 ::media::AudioDecoderConfig audio_config( | 104 ::media::AudioDecoderConfig audio_config( |
| 105 ::media::kCodecMP3, ::media::kSampleFormatS16, | 105 ::media::kCodecMP3, ::media::kSampleFormatS16, |
| 106 ::media::CHANNEL_LAYOUT_STEREO, 44100, ::media::EmptyExtraData(), | 106 ::media::CHANNEL_LAYOUT_STEREO, 44100, ::media::EmptyExtraData(), |
| 107 ::media::Unencrypted()); | 107 ::media::Unencrypted()); |
| 108 AvPipelineClient client; | 108 AvPipelineClient client; |
| 109 client.eos_cb = base::Bind(&PipelineHelper::OnEos, base::Unretained(this), | 109 client.eos_cb = base::Bind(&PipelineHelper::OnEos, base::Unretained(this), |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 | 365 |
| 366 message_loop_.RunUntilIdle(); | 366 message_loop_.RunUntilIdle(); |
| 367 message_loop_.PostTask(FROM_HERE, | 367 message_loop_.PostTask(FROM_HERE, |
| 368 base::Bind(&PipelineHelper::SetCdmLicenseInstalled, | 368 base::Bind(&PipelineHelper::SetCdmLicenseInstalled, |
| 369 base::Unretained(pipeline_helper_.get()))); | 369 base::Unretained(pipeline_helper_.get()))); |
| 370 message_loop_.Run(); | 370 message_loop_.Run(); |
| 371 } | 371 } |
| 372 | 372 |
| 373 } // namespace media | 373 } // namespace media |
| 374 } // namespace chromecast | 374 } // namespace chromecast |
| OLD | NEW |