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 "chromecast/media/cma/backend/media_pipeline_backend_manager.h" | 5 #include "chromecast/media/cma/backend/media_pipeline_backend_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 const media::MediaPipelineDeviceParams& params) { | 38 const media::MediaPipelineDeviceParams& params) { |
39 DCHECK(media_task_runner_->BelongsToCurrentThread()); | 39 DCHECK(media_task_runner_->BelongsToCurrentThread()); |
40 return CreateMediaPipelineBackend(params, 0); | 40 return CreateMediaPipelineBackend(params, 0); |
41 } | 41 } |
42 | 42 |
43 std::unique_ptr<MediaPipelineBackend> | 43 std::unique_ptr<MediaPipelineBackend> |
44 MediaPipelineBackendManager::CreateMediaPipelineBackend( | 44 MediaPipelineBackendManager::CreateMediaPipelineBackend( |
45 const media::MediaPipelineDeviceParams& params, | 45 const media::MediaPipelineDeviceParams& params, |
46 int stream_type) { | 46 int stream_type) { |
47 DCHECK(media_task_runner_->BelongsToCurrentThread()); | 47 DCHECK(media_task_runner_->BelongsToCurrentThread()); |
48 LOG(INFO) << "Creating a " << params.device_id << " stream."; | |
49 std::unique_ptr<MediaPipelineBackend> backend_ptr( | 48 std::unique_ptr<MediaPipelineBackend> backend_ptr( |
50 new MediaPipelineBackendWrapper( | 49 new MediaPipelineBackendWrapper( |
51 base::WrapUnique( | 50 base::WrapUnique( |
52 media::CastMediaShlib::CreateMediaPipelineBackend(params)), | 51 media::CastMediaShlib::CreateMediaPipelineBackend(params)), |
53 stream_type, GetVolumeMultiplier(stream_type), this)); | 52 stream_type, GetVolumeMultiplier(stream_type), this)); |
54 media_pipeline_backends_.push_back(backend_ptr.get()); | 53 media_pipeline_backends_.push_back(backend_ptr.get()); |
55 return backend_ptr; | 54 return backend_ptr; |
56 } | 55 } |
57 | 56 |
58 bool MediaPipelineBackendManager::IncrementDecoderCount(DecoderType type) { | 57 bool MediaPipelineBackendManager::IncrementDecoderCount(DecoderType type) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 auto it = volume_by_stream_type_.find(stream_type); | 104 auto it = volume_by_stream_type_.find(stream_type); |
106 if (it == volume_by_stream_type_.end()) { | 105 if (it == volume_by_stream_type_.end()) { |
107 return 1.0; | 106 return 1.0; |
108 } else { | 107 } else { |
109 return it->second; | 108 return it->second; |
110 } | 109 } |
111 } | 110 } |
112 | 111 |
113 } // namespace media | 112 } // namespace media |
114 } // namespace chromecast | 113 } // namespace chromecast |
OLD | NEW |