| 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/service/cast_renderer.h" | 5 #include "chromecast/media/service/cast_renderer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "chromecast/base/task_runner_impl.h" | 9 #include "chromecast/base/task_runner_impl.h" |
| 10 #include "chromecast/media/base/video_mode_switcher.h" | 10 #include "chromecast/media/base/video_mode_switcher.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // Force compositor to treat video as opaque (needed for overlay codepath). | 198 // Force compositor to treat video as opaque (needed for overlay codepath). |
| 199 OnVideoOpacityChange(true); | 199 OnVideoOpacityChange(true); |
| 200 } | 200 } |
| 201 } | 201 } |
| 202 | 202 |
| 203 void CastRenderer::SetCdm(::media::CdmContext* cdm_context, | 203 void CastRenderer::SetCdm(::media::CdmContext* cdm_context, |
| 204 const ::media::CdmAttachedCB& cdm_attached_cb) { | 204 const ::media::CdmAttachedCB& cdm_attached_cb) { |
| 205 DCHECK(task_runner_->BelongsToCurrentThread()); | 205 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 206 DCHECK(cdm_context); | 206 DCHECK(cdm_context); |
| 207 | 207 |
| 208 auto cast_cdm_context = static_cast<CastCdmContext*>(cdm_context); | 208 auto* cast_cdm_context = static_cast<CastCdmContext*>(cdm_context); |
| 209 | 209 |
| 210 if (!pipeline_) { | 210 if (!pipeline_) { |
| 211 // If the pipeline has not yet been created in Initialize(), cache | 211 // If the pipeline has not yet been created in Initialize(), cache |
| 212 // |cast_cdm_context| and pass it in when Initialize() is called. | 212 // |cast_cdm_context| and pass it in when Initialize() is called. |
| 213 cast_cdm_context_ = cast_cdm_context; | 213 cast_cdm_context_ = cast_cdm_context; |
| 214 } else { | 214 } else { |
| 215 pipeline_->SetCdm(cast_cdm_context); | 215 pipeline_->SetCdm(cast_cdm_context); |
| 216 } | 216 } |
| 217 | 217 |
| 218 cdm_attached_cb.Run(true); | 218 cdm_attached_cb.Run(true); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 } | 299 } |
| 300 | 300 |
| 301 void CastRenderer::OnVideoOpacityChange(bool opaque) { | 301 void CastRenderer::OnVideoOpacityChange(bool opaque) { |
| 302 DCHECK(task_runner_->BelongsToCurrentThread()); | 302 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 303 DCHECK(opaque); | 303 DCHECK(opaque); |
| 304 client_->OnVideoOpacityChange(opaque); | 304 client_->OnVideoOpacityChange(opaque); |
| 305 } | 305 } |
| 306 | 306 |
| 307 } // namespace media | 307 } // namespace media |
| 308 } // namespace chromecast | 308 } // namespace chromecast |
| OLD | NEW |