| 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/browser/media/cast_renderer.h" | 5 #include "chromecast/browser/media/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/cdm/cast_cdm_context.h" | 10 #include "chromecast/media/cdm/cast_cdm_context.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 video_stream->EnableBitstreamConverter(); | 136 video_stream->EnableBitstreamConverter(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 if (cast_cdm_context_) { | 139 if (cast_cdm_context_) { |
| 140 pipeline_->SetCdm(cast_cdm_context_); | 140 pipeline_->SetCdm(cast_cdm_context_); |
| 141 cast_cdm_context_ = nullptr; | 141 cast_cdm_context_ = nullptr; |
| 142 } | 142 } |
| 143 | 143 |
| 144 client_ = client; | 144 client_ = client; |
| 145 init_cb.Run(::media::PIPELINE_OK); | 145 init_cb.Run(::media::PIPELINE_OK); |
| 146 |
| 147 if (video_stream) { |
| 148 // Force compositor to treat video as opaque (needed for overlay codepath). |
| 149 OnVideoOpacityChange(true); |
| 150 } |
| 146 } | 151 } |
| 147 | 152 |
| 148 void CastRenderer::SetCdm(::media::CdmContext* cdm_context, | 153 void CastRenderer::SetCdm(::media::CdmContext* cdm_context, |
| 149 const ::media::CdmAttachedCB& cdm_attached_cb) { | 154 const ::media::CdmAttachedCB& cdm_attached_cb) { |
| 150 DCHECK(task_runner_->BelongsToCurrentThread()); | 155 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 151 DCHECK(cdm_context); | 156 DCHECK(cdm_context); |
| 152 | 157 |
| 153 auto cast_cdm_context = static_cast<CastCdmContext*>(cdm_context); | 158 auto cast_cdm_context = static_cast<CastCdmContext*>(cdm_context); |
| 154 | 159 |
| 155 if (!pipeline_) { | 160 if (!pipeline_) { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 client_->OnWaitingForDecryptionKey(); | 237 client_->OnWaitingForDecryptionKey(); |
| 233 } | 238 } |
| 234 | 239 |
| 235 void CastRenderer::OnVideoNaturalSizeChange(const gfx::Size& size) { | 240 void CastRenderer::OnVideoNaturalSizeChange(const gfx::Size& size) { |
| 236 DCHECK(task_runner_->BelongsToCurrentThread()); | 241 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 237 client_->OnVideoNaturalSizeChange(size); | 242 client_->OnVideoNaturalSizeChange(size); |
| 238 } | 243 } |
| 239 | 244 |
| 240 void CastRenderer::OnVideoOpacityChange(bool opaque) { | 245 void CastRenderer::OnVideoOpacityChange(bool opaque) { |
| 241 DCHECK(task_runner_->BelongsToCurrentThread()); | 246 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 247 DCHECK(opaque); |
| 242 client_->OnVideoOpacityChange(opaque); | 248 client_->OnVideoOpacityChange(opaque); |
| 243 } | 249 } |
| 244 | 250 |
| 245 } // namespace media | 251 } // namespace media |
| 246 } // namespace chromecast | 252 } // namespace chromecast |
| OLD | NEW |