Chromium Code Reviews| Index: media/webm/webm_crypto_helpers.h |
| diff --git a/media/webm/webm_crypto_helpers.h b/media/webm/webm_crypto_helpers.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3e8a0465ab1edaa6e4ec6e3c23226de1d9269f8f |
| --- /dev/null |
| +++ b/media/webm/webm_crypto_helpers.h |
| @@ -0,0 +1,36 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MEDIA_WEBM_WEBM_CRYPTO_HELPERS_H_ |
| +#define MEDIA_WEBM_WEBM_CRYPTO_HELPERS_H_ |
| + |
| +#include "base/basictypes.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "media/base/decoder_buffer.h" |
| + |
| +namespace media { |
| + |
| +// TODO(xhwang): Figure out the init data type appropriately once it's spec'ed. |
|
ddorwin
2013/03/10 21:29:39
You could link to https://www.w3.org/Bugs/Public/s
fgalligan1
2013/03/12 00:42:42
Done.
|
| +const char kWebMEncryptInitDataType[] = "video/webm"; |
| + |
|
ddorwin
2013/03/10 21:29:39
Should some of the existing Chunk Demuxer code be
fgalligan1
2013/03/12 00:42:42
Done.
|
| +// Generates a 16 byte CTR counter block. The CTR counter block format is a |
| +// CTR IV appended with a CTR block counter. |iv| is an 8 byte CTR IV. |
| +// |iv_size| is the size of |iv| in btyes. Returns a string of |
| +// kDecryptionKeySize bytes. |
| +std::string GenerateWebMCounterBlock(const uint8* iv, int iv_size); |
|
ddorwin
2013/03/10 21:29:39
This is not currently used outside the .cc file.
fgalligan1
2013/03/12 00:42:42
Done.
|
| + |
| +// Returns an initialized DecryptConfig, which can be sent to the Decryptor if |
| +// the stream has potentially encrypted frames. Every encrypted Block has a |
| +// signal byte, and if the frame is encrypted an IV, prepended to the frame. |
| +// Leaving the initialization vector empty will tell the decryptor that the |
| +// frame is unencrypted. Current encrypted WebM request for comments |
| +// specification is here |
| +// http://wiki.webmproject.org/encryption/webm-encryption-rfc |
| +scoped_ptr<DecryptConfig> WebMCreateDecryptConfig( |
| + const uint8* data, int data_size, |
| + const uint8* key_id, int key_id_size); |
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_WEBM_WEBM_CRYPT_HELPERS_H_ |