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.name << " with type " << stream_type; |
48 std::unique_ptr<MediaPipelineBackend> backend_ptr( | 49 std::unique_ptr<MediaPipelineBackend> backend_ptr( |
49 new MediaPipelineBackendWrapper( | 50 new MediaPipelineBackendWrapper( |
50 base::WrapUnique( | 51 base::WrapUnique( |
51 media::CastMediaShlib::CreateMediaPipelineBackend(params)), | 52 media::CastMediaShlib::CreateMediaPipelineBackend(params)), |
52 stream_type, GetVolumeMultiplier(stream_type), this)); | 53 stream_type, GetVolumeMultiplier(stream_type), this)); |
53 media_pipeline_backends_.push_back(backend_ptr.get()); | 54 media_pipeline_backends_.push_back(backend_ptr.get()); |
54 return backend_ptr; | 55 return backend_ptr; |
55 } | 56 } |
56 | 57 |
57 bool MediaPipelineBackendManager::IncrementDecoderCount(DecoderType type) { | 58 bool MediaPipelineBackendManager::IncrementDecoderCount(DecoderType type) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 auto it = volume_by_stream_type_.find(stream_type); | 105 auto it = volume_by_stream_type_.find(stream_type); |
105 if (it == volume_by_stream_type_.end()) { | 106 if (it == volume_by_stream_type_.end()) { |
106 return 1.0; | 107 return 1.0; |
107 } else { | 108 } else { |
108 return it->second; | 109 return it->second; |
109 } | 110 } |
110 } | 111 } |
111 | 112 |
112 } // namespace media | 113 } // namespace media |
113 } // namespace chromecast | 114 } // namespace chromecast |
OLD | NEW |