OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/pipeline/media_pipeline_impl.h" | 5 #include "chromecast/media/cma/pipeline/media_pipeline_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 } | 148 } |
149 | 149 |
150 void MediaPipelineImpl::OnDecoderError(MediaPipelineBackend::Decoder* decoder) { | 150 void MediaPipelineImpl::OnDecoderError(MediaPipelineBackend::Decoder* decoder) { |
151 if (decoder == audio_decoder_) { | 151 if (decoder == audio_decoder_) { |
152 audio_pipeline_->OnError(); | 152 audio_pipeline_->OnError(); |
153 } else if (decoder == video_decoder_) { | 153 } else if (decoder == video_decoder_) { |
154 video_pipeline_->OnError(); | 154 video_pipeline_->OnError(); |
155 } | 155 } |
156 } | 156 } |
157 | 157 |
158 void MediaPipelineImpl::OnKeyStatusChanged(const std::string& key_id, | |
159 CastKeyStatus key_status, | |
160 uint32_t system_code) { | |
161 CMALOG(kLogControl) << __FUNCTION__; | |
162 DCHECK(thread_checker_.CalledOnValidThread()); | |
163 if (cdm_) | |
yucliu1
2015/11/18 01:06:36
Is it possible for !cdm_ happen? If this did happe
halliwell
2015/11/18 02:32:18
Agreed, I don't think it's possible. A key can on
| |
164 cdm_->SetKeyStatus(key_id, key_status, system_code); | |
165 } | |
166 | |
158 void MediaPipelineImpl::SetCdm(BrowserCdmCast* cdm) { | 167 void MediaPipelineImpl::SetCdm(BrowserCdmCast* cdm) { |
159 CMALOG(kLogControl) << __FUNCTION__; | 168 CMALOG(kLogControl) << __FUNCTION__; |
160 DCHECK(thread_checker_.CalledOnValidThread()); | 169 DCHECK(thread_checker_.CalledOnValidThread()); |
161 cdm_ = cdm; | 170 cdm_ = cdm; |
162 if (audio_pipeline_) | 171 if (audio_pipeline_) |
163 audio_pipeline_->SetCdm(cdm); | 172 audio_pipeline_->SetCdm(cdm); |
164 if (video_pipeline_) | 173 if (video_pipeline_) |
165 video_pipeline_->SetCdm(cdm); | 174 video_pipeline_->SetCdm(cdm); |
166 } | 175 } |
167 | 176 |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
449 | 458 |
450 void MediaPipelineImpl::OnError(::media::PipelineStatus error) { | 459 void MediaPipelineImpl::OnError(::media::PipelineStatus error) { |
451 DCHECK(thread_checker_.CalledOnValidThread()); | 460 DCHECK(thread_checker_.CalledOnValidThread()); |
452 DCHECK_NE(error, ::media::PIPELINE_OK) << "PIPELINE_OK is not an error!"; | 461 DCHECK_NE(error, ::media::PIPELINE_OK) << "PIPELINE_OK is not an error!"; |
453 if (!client_.error_cb.is_null()) | 462 if (!client_.error_cb.is_null()) |
454 client_.error_cb.Run(error); | 463 client_.error_cb.Run(error); |
455 } | 464 } |
456 | 465 |
457 } // namespace media | 466 } // namespace media |
458 } // namespace chromecast | 467 } // namespace chromecast |
OLD | NEW |