| 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 MEDIA_BASE_DECRYPTOR_H_ | 5 #ifndef MEDIA_BASE_DECRYPTOR_H_ |
| 6 #define MEDIA_BASE_DECRYPTOR_H_ | 6 #define MEDIA_BASE_DECRYPTOR_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 enum StreamType { | 59 enum StreamType { |
| 60 kAudio, | 60 kAudio, |
| 61 kVideo | 61 kVideo |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 Decryptor(); | 64 Decryptor(); |
| 65 virtual ~Decryptor(); | 65 virtual ~Decryptor(); |
| 66 | 66 |
| 67 // Generates a key request for the |key_system| with |init_data| provided. | 67 // Generates a key request for the |key_system| with |type| and |
| 68 // |init_data| provided. |
| 68 // Returns true if generating key request succeeded, false otherwise. | 69 // Returns true if generating key request succeeded, false otherwise. |
| 69 // Note: AddKey() and CancelKeyRequest() should only be called after | 70 // Note: AddKey() and CancelKeyRequest() should only be called after |
| 70 // GenerateKeyRequest() returns true. | 71 // GenerateKeyRequest() returns true. |
| 71 virtual bool GenerateKeyRequest(const std::string& key_system, | 72 virtual bool GenerateKeyRequest(const std::string& key_system, |
| 73 const std::string& type, |
| 72 const uint8* init_data, | 74 const uint8* init_data, |
| 73 int init_data_length) = 0; | 75 int init_data_length) = 0; |
| 74 | 76 |
| 75 // Adds a |key| to the |key_system|. The |key| is not limited to a decryption | 77 // Adds a |key| to the |key_system|. The |key| is not limited to a decryption |
| 76 // key. It can be any data that the key system accepts, such as a license. | 78 // key. It can be any data that the key system accepts, such as a license. |
| 77 // If multiple calls of this function set different keys for the same | 79 // If multiple calls of this function set different keys for the same |
| 78 // key ID, the older key will be replaced by the newer key. | 80 // key ID, the older key will be replaced by the newer key. |
| 79 virtual void AddKey(const std::string& key_system, | 81 virtual void AddKey(const std::string& key_system, |
| 80 const uint8* key, | 82 const uint8* key, |
| 81 int key_length, | 83 int key_length, |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 // The decoder can be reinitialized after it is uninitialized. | 194 // The decoder can be reinitialized after it is uninitialized. |
| 193 virtual void DeinitializeDecoder(StreamType stream_type) = 0; | 195 virtual void DeinitializeDecoder(StreamType stream_type) = 0; |
| 194 | 196 |
| 195 private: | 197 private: |
| 196 DISALLOW_COPY_AND_ASSIGN(Decryptor); | 198 DISALLOW_COPY_AND_ASSIGN(Decryptor); |
| 197 }; | 199 }; |
| 198 | 200 |
| 199 } // namespace media | 201 } // namespace media |
| 200 | 202 |
| 201 #endif // MEDIA_BASE_DECRYPTOR_H_ | 203 #endif // MEDIA_BASE_DECRYPTOR_H_ |
| OLD | NEW |