OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef MEDIA_CDM_PPAPI_CDM_ADAPTER_H_ | 5 #ifndef MEDIA_CDM_PPAPI_CDM_ADAPTER_H_ |
6 #define MEDIA_CDM_PPAPI_CDM_ADAPTER_H_ | 6 #define MEDIA_CDM_PPAPI_CDM_ADAPTER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 void QueryOutputProtectionStatus() override; | 108 void QueryOutputProtectionStatus() override; |
109 void OnDeferredInitializationDone(cdm::StreamType stream_type, | 109 void OnDeferredInitializationDone(cdm::StreamType stream_type, |
110 cdm::Status decoder_status) override; | 110 cdm::Status decoder_status) override; |
111 cdm::FileIO* CreateFileIO(cdm::FileIOClient* client) override; | 111 cdm::FileIO* CreateFileIO(cdm::FileIOClient* client) override; |
112 | 112 |
113 // cdm::Host_7 implementation. | 113 // cdm::Host_7 implementation. |
114 void OnSessionMessage(const char* session_id, | 114 void OnSessionMessage(const char* session_id, |
115 uint32_t session_id_size, | 115 uint32_t session_id_size, |
116 cdm::MessageType message_type, | 116 cdm::MessageType message_type, |
117 const char* message, | 117 const char* message, |
118 uint32_t message_size) override; | 118 uint32_t message_size, |
119 const char* legacy_destination_url, | |
120 uint32_t legacy_destination_url_size) override; | |
119 void OnSessionKeysChange(const char* session_id, | 121 void OnSessionKeysChange(const char* session_id, |
120 uint32_t session_id_size, | 122 uint32_t session_id_size, |
121 bool has_additional_usable_key, | 123 bool has_additional_usable_key, |
122 const cdm::KeyInformation* keys_info, | 124 const cdm::KeyInformation* keys_info, |
123 uint32_t keys_info_count) override; | 125 uint32_t keys_info_count) override; |
124 void OnLegacySessionError(const char* session_id, | 126 void OnLegacySessionError(const char* session_id, |
125 uint32_t session_id_size, | 127 uint32_t session_id_size, |
126 cdm::Error error, | 128 cdm::Error error, |
127 uint32_t system_code, | 129 uint32_t system_code, |
128 const char* error_message, | 130 const char* error_message, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
163 | 165 |
164 struct SessionError { | 166 struct SessionError { |
165 SessionError(cdm::Error error, | 167 SessionError(cdm::Error error, |
166 uint32_t system_code, | 168 uint32_t system_code, |
167 std::string error_description); | 169 std::string error_description); |
168 cdm::Error error; | 170 cdm::Error error; |
169 uint32_t system_code; | 171 uint32_t system_code; |
170 std::string error_description; | 172 std::string error_description; |
171 }; | 173 }; |
172 | 174 |
175 struct SessionMessage { | |
176 SessionMessage(std::string session_id, | |
dcheng
2015/01/13 19:57:57
const ref to avoid double copies.
jrummell
2015/01/13 20:31:16
Done.
| |
177 cdm::MessageType message_type, | |
178 std::vector<uint8_t> message, | |
179 std::string legacy_destination_url); | |
180 std::string session_id; | |
181 cdm::MessageType message_type; | |
182 std::vector<uint8_t> message; | |
183 std::string legacy_destination_url; | |
184 }; | |
185 | |
173 bool CreateCdmInstance(const std::string& key_system); | 186 bool CreateCdmInstance(const std::string& key_system); |
174 | 187 |
175 // <code>PPB_ContentDecryptor_Private</code> dispatchers. These are passed to | 188 // <code>PPB_ContentDecryptor_Private</code> dispatchers. These are passed to |
176 // <code>callback_factory_</code> to ensure that calls into | 189 // <code>callback_factory_</code> to ensure that calls into |
177 // <code>PPP_ContentDecryptor_Private</code> are asynchronous. | 190 // <code>PPP_ContentDecryptor_Private</code> are asynchronous. |
178 void SendPromiseResolvedInternal(int32_t result, uint32_t promise_id); | 191 void SendPromiseResolvedInternal(int32_t result, uint32_t promise_id); |
179 void SendPromiseResolvedWithSessionInternal(int32_t result, | 192 void SendPromiseResolvedWithSessionInternal(int32_t result, |
180 uint32_t promise_id, | 193 uint32_t promise_id, |
181 const std::string& session_id); | 194 const std::string& session_id); |
182 void SendPromiseRejectedInternal(int32_t result, | 195 void SendPromiseRejectedInternal(int32_t result, |
183 uint32_t promise_id, | 196 uint32_t promise_id, |
184 const SessionError& error); | 197 const SessionError& error); |
185 void SendSessionMessageInternal(int32_t result, | 198 void SendSessionMessageInternal(int32_t result, |
186 const std::string& session_id, | 199 const SessionMessage& message); |
187 cdm::MessageType message_type, | |
188 const std::vector<uint8_t>& message); | |
189 void SendSessionClosedInternal(int32_t result, const std::string& session_id); | 200 void SendSessionClosedInternal(int32_t result, const std::string& session_id); |
190 void SendSessionErrorInternal(int32_t result, | 201 void SendSessionErrorInternal(int32_t result, |
191 const std::string& session_id, | 202 const std::string& session_id, |
192 const SessionError& error); | 203 const SessionError& error); |
193 void SendSessionKeysChangeInternal( | 204 void SendSessionKeysChangeInternal( |
194 int32_t result, | 205 int32_t result, |
195 const std::string& session_id, | 206 const std::string& session_id, |
196 bool has_additional_usable_key, | 207 bool has_additional_usable_key, |
197 const std::vector<PP_KeyInformation>& key_info); | 208 const std::vector<PP_KeyInformation>& key_info); |
198 void SendExpirationChangeInternal(int32_t result, | 209 void SendExpirationChangeInternal(int32_t result, |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
287 | 298 |
288 uint32_t last_read_file_size_kb_; | 299 uint32_t last_read_file_size_kb_; |
289 bool file_size_uma_reported_; | 300 bool file_size_uma_reported_; |
290 | 301 |
291 DISALLOW_COPY_AND_ASSIGN(CdmAdapter); | 302 DISALLOW_COPY_AND_ASSIGN(CdmAdapter); |
292 }; | 303 }; |
293 | 304 |
294 } // namespace media | 305 } // namespace media |
295 | 306 |
296 #endif // MEDIA_CDM_PPAPI_CDM_ADAPTER_H_ | 307 #endif // MEDIA_CDM_PPAPI_CDM_ADAPTER_H_ |
OLD | NEW |