Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 WEBKIT_MEDIA_CRYPTO_PPAPI_CONTENT_DECRYPTION_MODULE_H_ | 5 #ifndef WEBKIT_MEDIA_CRYPTO_PPAPI_CONTENT_DECRYPTION_MODULE_H_ |
| 6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_CONTENT_DECRYPTION_MODULE_H_ | 6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_CONTENT_DECRYPTION_MODULE_H_ |
| 7 | 7 |
| 8 #if defined(_MSC_VER) | 8 #if defined(_MSC_VER) |
| 9 typedef unsigned char uint8_t; | 9 typedef unsigned char uint8_t; |
| 10 typedef unsigned int uint32_t; | 10 typedef unsigned int uint32_t; |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 188 kStreamTypeVideo = 1 | 188 kStreamTypeVideo = 1 |
| 189 }; | 189 }; |
| 190 | 190 |
| 191 // ContentDecryptionModule interface that all CDMs need to implement. | 191 // ContentDecryptionModule interface that all CDMs need to implement. |
| 192 // Note: ContentDecryptionModule implementations must use the allocator | 192 // Note: ContentDecryptionModule implementations must use the allocator |
| 193 // provided in CreateCdmInstance() to allocate any Buffer that needs to | 193 // provided in CreateCdmInstance() to allocate any Buffer that needs to |
| 194 // be passed back to the caller. Implementations must call Buffer::Destroy() | 194 // be passed back to the caller. Implementations must call Buffer::Destroy() |
| 195 // when a Buffer is created that will never be returned to the caller. | 195 // when a Buffer is created that will never be returned to the caller. |
| 196 class ContentDecryptionModule { | 196 class ContentDecryptionModule { |
| 197 public: | 197 public: |
| 198 // Generates a |key_request| given the |init_data|. | 198 // Generates a |key_request| given the |mime_type| and |init_data|. |
| 199 // | 199 // |
| 200 // Returns kSuccess if the key request was successfully generated, | 200 // Returns kSuccess if the key request was successfully generated, |
| 201 // in which case the callee should have allocated memory for the output | 201 // in which case the callee should have allocated memory for the output |
| 202 // parameters (e.g |session_id| in |key_request|) and passed the ownership | 202 // parameters (e.g |session_id| in |key_request|) and passed the ownership |
| 203 // to the caller. | 203 // to the caller. |
| 204 // Returns kSessionError if any error happened, in which case the | 204 // Returns kSessionError if any error happened, in which case the |
| 205 // |key_request| should not be used by the caller. | 205 // |key_request| should not be used by the caller. |
| 206 // | 206 virtual Status GenerateKeyRequest(const char* mime_type, |
|
ddorwin
2012/10/26 18:37:06
I notice that we don't pass key_system in GKR(). T
Tom Finegan
2012/10/26 22:51:33
Done.
| |
| 207 // TODO(xhwang): It's not safe to pass the ownership of the dynamically | 207 int mime_type_size, |
| 208 // allocated memory over library boundaries. Fix it after related PPAPI change | 208 const uint8_t* init_data, |
| 209 // and sample CDM are landed. | |
| 210 virtual Status GenerateKeyRequest(const uint8_t* init_data, | |
| 211 int init_data_size, | 209 int init_data_size, |
| 212 KeyMessage* key_request) = 0; | 210 KeyMessage* key_request) = 0; |
| 213 | 211 |
| 214 // Adds the |key| to the CDM to be associated with |key_id|. | 212 // Adds the |key| to the CDM to be associated with |key_id|. |
| 215 // | 213 // |
| 216 // Returns kSuccess if the key was successfully added, kSessionError | 214 // Returns kSuccess if the key was successfully added, kSessionError |
| 217 // otherwise. | 215 // otherwise. |
| 218 virtual Status AddKey(const char* session_id, | 216 virtual Status AddKey(const char* session_id, |
| 219 int session_id_size, | 217 int session_id_size, |
| 220 const uint8_t* key, | 218 const uint8_t* key, |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 451 virtual Buffer* buffer() = 0; | 449 virtual Buffer* buffer() = 0; |
| 452 | 450 |
| 453 protected: | 451 protected: |
| 454 AudioFrames() {} | 452 AudioFrames() {} |
| 455 virtual ~AudioFrames() {} | 453 virtual ~AudioFrames() {} |
| 456 }; | 454 }; |
| 457 | 455 |
| 458 } // namespace cdm | 456 } // namespace cdm |
| 459 | 457 |
| 460 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CONTENT_DECRYPTION_MODULE_H_ | 458 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CONTENT_DECRYPTION_MODULE_H_ |
| OLD | NEW |