| 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 #ifndef MEDIA_FORMATS_WEBM_WEBM_CRYPTO_HELPERS_H_ | 5 #ifndef MEDIA_FORMATS_WEBM_WEBM_CRYPTO_HELPERS_H_ |
| 6 #define MEDIA_FORMATS_WEBM_WEBM_CRYPTO_HELPERS_H_ | 6 #define MEDIA_FORMATS_WEBM_WEBM_CRYPTO_HELPERS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 9 #include "media/base/decoder_buffer.h" | 11 #include "media/base/decoder_buffer.h" |
| 10 | 12 |
| 11 namespace media { | 13 namespace media { |
| 12 | 14 |
| 13 // Fills an initialized DecryptConfig, which can be sent to the Decryptor if | 15 // Fills an initialized DecryptConfig, which can be sent to the Decryptor if |
| 14 // the stream has potentially encrypted frames. Also sets |data_offset| which | 16 // the stream has potentially encrypted frames. Also sets |data_offset| which |
| 15 // indicates where the encrypted data starts. Leaving the IV empty will tell | 17 // indicates where the encrypted data starts. Leaving the IV empty will tell |
| 16 // the decryptor that the frame is unencrypted. Returns true if |data| is valid, | 18 // the decryptor that the frame is unencrypted. Returns true if |data| is valid, |
| 17 // false otherwise, in which case |decrypt_config| and |data_offset| will not be | 19 // false otherwise, in which case |decrypt_config| and |data_offset| will not be |
| 18 // changed. Current encrypted WebM request for comments specification is here | 20 // changed. Current encrypted WebM request for comments specification is here |
| 19 // http://wiki.webmproject.org/encryption/webm-encryption-rfc | 21 // http://wiki.webmproject.org/encryption/webm-encryption-rfc |
| 20 bool WebMCreateDecryptConfig(const uint8_t* data, | 22 bool WebMCreateDecryptConfig(const uint8_t* data, |
| 21 int data_size, | 23 int data_size, |
| 22 const uint8_t* key_id, | 24 const uint8_t* key_id, |
| 23 int key_id_size, | 25 int key_id_size, |
| 24 scoped_ptr<DecryptConfig>* decrypt_config, | 26 scoped_ptr<DecryptConfig>* decrypt_config, |
| 25 int* data_offset); | 27 int* data_offset); |
| 26 | 28 |
| 27 } // namespace media | 29 } // namespace media |
| 28 | 30 |
| 29 #endif // MEDIA_FORMATS_WEBM_WEBM_CRYPT_HELPERS_H_ | 31 #endif // MEDIA_FORMATS_WEBM_WEBM_CRYPT_HELPERS_H_ |
| OLD | NEW |