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/browser_cdm_cast.h" | 5 #include "chromecast/media/cdm/browser_cdm_cast.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "media/base/cdm_key_information.h" | 10 #include "media/base/cdm_key_information.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
95 cdm_keys_info.push_back(cdm_key_information.release()); | 95 cdm_keys_info.push_back(cdm_key_information.release()); |
96 } | 96 } |
97 session_keys_change_cb_.Run(session_id, true, cdm_keys_info.Pass()); | 97 session_keys_change_cb_.Run(session_id, true, cdm_keys_info.Pass()); |
98 | 98 |
99 player_tracker_impl_->NotifyNewKey(); | 99 player_tracker_impl_->NotifyNewKey(); |
100 } | 100 } |
101 | 101 |
102 void BrowserCdmCast::SetServerCertificateHelper( | 102 void BrowserCdmCast::SetServerCertificateHelper( |
103 const std::vector<uint8>& certificate_data, | 103 const std::vector<uint8>& certificate_data, |
104 scoped_ptr<::media::SimpleCdmPromise> promise) { | 104 scoped_ptr<::media::SimpleCdmPromise> promise) { |
105 SetServerCertificate(certificate_data.data(), | 105 SetServerCertificate(&certificate_data[0], |
106 certificate_data.size(), | 106 certificate_data.size(), |
107 promise.Pass()); | 107 promise.Pass()); |
108 } | 108 } |
xhwang
2015/04/24 04:52:23
You need to rebase :)
| |
109 | 109 |
110 void BrowserCdmCast::CreateSessionAndGenerateRequestHelper( | 110 void BrowserCdmCast::CreateSessionAndGenerateRequestHelper( |
111 ::media::MediaKeys::SessionType session_type, | 111 ::media::MediaKeys::SessionType session_type, |
112 ::media::EmeInitDataType init_data_type, | 112 ::media::EmeInitDataType init_data_type, |
113 const std::vector<uint8>& init_data, | 113 const std::vector<uint8>& init_data, |
114 scoped_ptr<::media::NewSessionCdmPromise> promise) { | 114 scoped_ptr<::media::NewSessionCdmPromise> promise) { |
115 CreateSessionAndGenerateRequest( | 115 CreateSessionAndGenerateRequest( |
116 session_type, init_data_type, init_data.data(), init_data.size(), | 116 session_type, init_data_type, &init_data[0], init_data.size(), |
117 promise.Pass()); | 117 promise.Pass()); |
118 } | 118 } |
119 | 119 |
120 void BrowserCdmCast::UpdateSessionHelper( | 120 void BrowserCdmCast::UpdateSessionHelper( |
121 const std::string& session_id, | 121 const std::string& session_id, |
122 const std::vector<uint8>& response, | 122 const std::vector<uint8>& response, |
123 scoped_ptr<::media::SimpleCdmPromise> promise) { | 123 scoped_ptr<::media::SimpleCdmPromise> promise) { |
124 UpdateSession(session_id, response.data(), response.size(), promise.Pass()); | 124 UpdateSession(session_id, &response[0], response.size(), promise.Pass()); |
125 } | 125 } |
126 | 126 |
127 // A macro runs current member function on |cdm_loop_| thread. | 127 // A macro runs current member function on |cdm_loop_| thread. |
128 #define FORWARD_ON_CDM_THREAD(param_fn, ...) \ | 128 #define FORWARD_ON_CDM_THREAD(param_fn, ...) \ |
129 cdm_loop_->PostTask( \ | 129 cdm_loop_->PostTask( \ |
130 FROM_HERE, \ | 130 FROM_HERE, \ |
131 base::Bind(&BrowserCdmCast::param_fn, \ | 131 base::Bind(&BrowserCdmCast::param_fn, \ |
132 base::Unretained(browser_cdm_cast_.get()), ##__VA_ARGS__)) | 132 base::Unretained(browser_cdm_cast_.get()), ##__VA_ARGS__)) |
133 | 133 |
134 | 134 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
222 FORWARD_ON_CDM_THREAD(RemoveSession, session_id, base::Passed(&promise)); | 222 FORWARD_ON_CDM_THREAD(RemoveSession, session_id, base::Passed(&promise)); |
223 } | 223 } |
224 | 224 |
225 ::media::CdmContext* BrowserCdmCastUi::GetCdmContext() { | 225 ::media::CdmContext* BrowserCdmCastUi::GetCdmContext() { |
226 NOTREACHED(); | 226 NOTREACHED(); |
227 return nullptr; | 227 return nullptr; |
228 } | 228 } |
229 | 229 |
230 } // namespace media | 230 } // namespace media |
231 } // namespace chromecast | 231 } // namespace chromecast |
OLD | NEW |