| 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/cdm/cast_cdm_proxy.h" | 5 #include "chromecast/media/cdm/cast_cdm_proxy.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 void CastCdmProxy::SetServerCertificate( | 101 void CastCdmProxy::SetServerCertificate( |
| 102 const std::vector<uint8_t>& certificate, | 102 const std::vector<uint8_t>& certificate, |
| 103 std::unique_ptr<::media::SimpleCdmPromise> promise) { | 103 std::unique_ptr<::media::SimpleCdmPromise> promise) { |
| 104 DCHECK(thread_checker_.CalledOnValidThread()); | 104 DCHECK(thread_checker_.CalledOnValidThread()); |
| 105 FORWARD_ON_CDM_THREAD( | 105 FORWARD_ON_CDM_THREAD( |
| 106 SetServerCertificate, certificate, | 106 SetServerCertificate, certificate, |
| 107 base::Passed(BindPromiseToCurrentLoop(std::move(promise)))); | 107 base::Passed(BindPromiseToCurrentLoop(std::move(promise)))); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void CastCdmProxy::CreateSessionAndGenerateRequest( | 110 void CastCdmProxy::CreateSessionAndGenerateRequest( |
| 111 ::media::MediaKeys::SessionType session_type, | 111 ::media::ContentDecryptionModule::SessionType session_type, |
| 112 ::media::EmeInitDataType init_data_type, | 112 ::media::EmeInitDataType init_data_type, |
| 113 const std::vector<uint8_t>& init_data, | 113 const std::vector<uint8_t>& init_data, |
| 114 std::unique_ptr<::media::NewSessionCdmPromise> promise) { | 114 std::unique_ptr<::media::NewSessionCdmPromise> promise) { |
| 115 DCHECK(thread_checker_.CalledOnValidThread()); | 115 DCHECK(thread_checker_.CalledOnValidThread()); |
| 116 FORWARD_ON_CDM_THREAD( | 116 FORWARD_ON_CDM_THREAD( |
| 117 CreateSessionAndGenerateRequest, session_type, init_data_type, init_data, | 117 CreateSessionAndGenerateRequest, session_type, init_data_type, init_data, |
| 118 base::Passed(BindPromiseToCurrentLoop(std::move(promise)))); | 118 base::Passed(BindPromiseToCurrentLoop(std::move(promise)))); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void CastCdmProxy::LoadSession( | 121 void CastCdmProxy::LoadSession( |
| 122 ::media::MediaKeys::SessionType session_type, | 122 ::media::ContentDecryptionModule::SessionType session_type, |
| 123 const std::string& session_id, | 123 const std::string& session_id, |
| 124 std::unique_ptr<::media::NewSessionCdmPromise> promise) { | 124 std::unique_ptr<::media::NewSessionCdmPromise> promise) { |
| 125 DCHECK(thread_checker_.CalledOnValidThread()); | 125 DCHECK(thread_checker_.CalledOnValidThread()); |
| 126 FORWARD_ON_CDM_THREAD( | 126 FORWARD_ON_CDM_THREAD( |
| 127 LoadSession, session_type, session_id, | 127 LoadSession, session_type, session_id, |
| 128 base::Passed(BindPromiseToCurrentLoop(std::move(promise)))); | 128 base::Passed(BindPromiseToCurrentLoop(std::move(promise)))); |
| 129 } | 129 } |
| 130 | 130 |
| 131 void CastCdmProxy::UpdateSession( | 131 void CastCdmProxy::UpdateSession( |
| 132 const std::string& session_id, | 132 const std::string& session_id, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 158 | 158 |
| 159 ::media::CdmContext* CastCdmProxy::GetCdmContext() { | 159 ::media::CdmContext* CastCdmProxy::GetCdmContext() { |
| 160 // This will be recast as a CastCdmService pointer before being passed to the | 160 // This will be recast as a CastCdmService pointer before being passed to the |
| 161 // media pipeline. The returned object should only be called on the CMA | 161 // media pipeline. The returned object should only be called on the CMA |
| 162 // renderer thread. | 162 // renderer thread. |
| 163 return cast_cdm_->GetCdmContext(); | 163 return cast_cdm_->GetCdmContext(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 } // namespace media | 166 } // namespace media |
| 167 } // namespace chromecast | 167 } // namespace chromecast |
| OLD | NEW |