| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <stdint.h> | 5 #include <stdint.h> |
| 6 #include <stdlib.h> | 6 #include <stdlib.h> |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
| 18 #include "base/run_loop.h" | 18 #include "base/run_loop.h" |
| 19 #include "base/threading/thread_checker.h" | 19 #include "base/threading/thread_checker.h" |
| 20 #include "base/threading/thread_task_runner_handle.h" | 20 #include "base/threading/thread_task_runner_handle.h" |
| 21 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| 22 #include "chromecast/base/task_runner_impl.h" | 22 #include "chromecast/base/task_runner_impl.h" |
| 23 #include "chromecast/media/cma/base/decoder_buffer_adapter.h" | 23 #include "chromecast/media/cma/base/decoder_buffer_adapter.h" |
| 24 #include "chromecast/media/cma/base/decoder_config_adapter.h" | 24 #include "chromecast/media/cma/base/decoder_config_adapter.h" |
| 25 #include "chromecast/public/cast_media_shlib.h" | 25 #include "chromecast/public/cast_media_shlib.h" |
| 26 #include "chromecast/public/media/cast_decoder_buffer.h" | 26 #include "chromecast/public/media/cast_decoder_buffer.h" |
| 27 #include "chromecast/public/media/decoder_config.h" | 27 #include "chromecast/public/media/decoder_config.h" |
| 28 #include "chromecast/public/media/media_pipeline_backend.h" | 28 #include "chromecast/public/media/media_pipeline_backend.h" |
| 29 #include "chromecast/public/media/media_pipeline_device_params.h" | 29 #include "chromecast/public/media/media_pipeline_device_params.h" |
| 30 #include "media/audio/audio_device_description.h" |
| 30 #include "media/base/audio_decoder_config.h" | 31 #include "media/base/audio_decoder_config.h" |
| 31 #include "media/base/decoder_buffer.h" | 32 #include "media/base/decoder_buffer.h" |
| 32 #include "testing/gtest/include/gtest/gtest.h" | 33 #include "testing/gtest/include/gtest/gtest.h" |
| 33 | 34 |
| 34 namespace chromecast { | 35 namespace chromecast { |
| 35 namespace media { | 36 namespace media { |
| 36 | 37 |
| 37 class MultizoneBackendTest; | 38 class MultizoneBackendTest; |
| 38 | 39 |
| 39 namespace { | 40 namespace { |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 next_push_playback_timestamp_(kNoTimestamp) { | 183 next_push_playback_timestamp_(kNoTimestamp) { |
| 183 CHECK(!eos_cb_.is_null()); | 184 CHECK(!eos_cb_.is_null()); |
| 184 } | 185 } |
| 185 | 186 |
| 186 void BufferFeeder::Initialize(float playback_rate) { | 187 void BufferFeeder::Initialize(float playback_rate) { |
| 187 original_playback_rate_ = playback_rate_ = playback_rate; | 188 original_playback_rate_ = playback_rate_ = playback_rate; |
| 188 MediaPipelineDeviceParams params( | 189 MediaPipelineDeviceParams params( |
| 189 MediaPipelineDeviceParams::kModeIgnorePts, | 190 MediaPipelineDeviceParams::kModeIgnorePts, |
| 190 effects_only_ ? MediaPipelineDeviceParams::kAudioStreamSoundEffects | 191 effects_only_ ? MediaPipelineDeviceParams::kAudioStreamSoundEffects |
| 191 : MediaPipelineDeviceParams::kAudioStreamNormal, | 192 : MediaPipelineDeviceParams::kAudioStreamNormal, |
| 192 task_runner_.get()); | 193 task_runner_.get(), AudioContentType::kMedia, |
| 194 ::media::AudioDeviceDescription::kDefaultDeviceId); |
| 193 backend_.reset(CastMediaShlib::CreateMediaPipelineBackend(params)); | 195 backend_.reset(CastMediaShlib::CreateMediaPipelineBackend(params)); |
| 194 CHECK(backend_); | 196 CHECK(backend_); |
| 195 | 197 |
| 196 decoder_ = backend_->CreateAudioDecoder(); | 198 decoder_ = backend_->CreateAudioDecoder(); |
| 197 CHECK(decoder_); | 199 CHECK(decoder_); |
| 198 ASSERT_TRUE(decoder_->SetConfig(config_)); | 200 ASSERT_TRUE(decoder_->SetConfig(config_)); |
| 199 decoder_->SetDelegate(this); | 201 decoder_->SetDelegate(this); |
| 200 | 202 |
| 201 ASSERT_TRUE(backend_->Initialize()); | 203 ASSERT_TRUE(backend_->Initialize()); |
| 202 ASSERT_TRUE(backend_->SetPlaybackRate(playback_rate)); | 204 ASSERT_TRUE(backend_->SetPlaybackRate(playback_rate)); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 ::testing::Values(0.5f, 0.99f, 1.0f, 1.01f, 2.0f))); | 395 ::testing::Values(0.5f, 0.99f, 1.0f, 1.01f, 2.0f))); |
| 394 | 396 |
| 395 INSTANTIATE_TEST_CASE_P( | 397 INSTANTIATE_TEST_CASE_P( |
| 396 Optional, | 398 Optional, |
| 397 MultizoneBackendTest, | 399 MultizoneBackendTest, |
| 398 testing::Combine(::testing::Values(64000, 88200, 96000), | 400 testing::Combine(::testing::Values(64000, 88200, 96000), |
| 399 ::testing::Values(0.5f, 0.99f, 1.0f, 1.01f, 2.0f))); | 401 ::testing::Values(0.5f, 0.99f, 1.0f, 1.01f, 2.0f))); |
| 400 | 402 |
| 401 } // namespace media | 403 } // namespace media |
| 402 } // namespace chromecast | 404 } // namespace chromecast |
| OLD | NEW |