OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CHROMECAST_PUBLIC_MEDIA_DECRYPT_CONTEXT_H_ | 5 #ifndef CHROMECAST_PUBLIC_MEDIA_DECRYPT_CONTEXT_H_ |
6 #define CHROMECAST_PUBLIC_MEDIA_DECRYPT_CONTEXT_H_ | 6 #define CHROMECAST_PUBLIC_MEDIA_DECRYPT_CONTEXT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <vector> |
9 | 10 |
10 #include "cast_key_system.h" | 11 #include "cast_key_system.h" |
11 | 12 |
12 namespace chromecast { | 13 namespace chromecast { |
13 namespace media { | 14 namespace media { |
14 class CastDecoderBuffer; | 15 class CastDecoderBuffer; |
15 | 16 |
16 // Provides the information needed to decrypt frames. | 17 // Provides the information needed to decrypt frames. |
17 class DecryptContext { | 18 class DecryptContext { |
18 public: | 19 public: |
19 virtual ~DecryptContext() {} | 20 virtual ~DecryptContext() {} |
20 | 21 |
21 // Get the key system to use for decryption. | 22 // Get the key system to use for decryption. |
22 virtual CastKeySystem GetKeySystem() = 0; | 23 virtual CastKeySystem GetKeySystem() = 0; |
23 | 24 |
24 // Decrypts the given buffer. Returns true/false for success/failure, | 25 // Decrypts the given buffer. Returns true/false for success/failure, |
25 // and places the decrypted data in |output| if successful. | 26 // and places the decrypted data in output if successful. |
26 // Decrypted data in |output| has the same length as |buffer|. | 27 virtual bool Decrypt(CastDecoderBuffer* buffer, |
27 virtual bool Decrypt(CastDecoderBuffer* buffer, uint8_t* output) = 0; | 28 std::vector<uint8_t>* output) = 0; |
28 }; | 29 }; |
29 | 30 |
30 } // namespace media | 31 } // namespace media |
31 } // namespace chromecast | 32 } // namespace chromecast |
32 | 33 |
33 #endif // CHROMECAST_PUBLIC_MEDIA_DECRYPT_CONTEXT_H_ | 34 #endif // CHROMECAST_PUBLIC_MEDIA_DECRYPT_CONTEXT_H_ |
OLD | NEW |