Index: media/webm/webm_crypt_helpers.h |
diff --git a/media/webm/webm_crypt_helpers.h b/media/webm/webm_crypt_helpers.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2da6424568b6826293443b8c3e6b1a1f7c431623 |
--- /dev/null |
+++ b/media/webm/webm_crypt_helpers.h |
@@ -0,0 +1,31 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
ddorwin
2012/09/01 16:46:41
Same as the other helper file - two files for one
fgalligan1
2013/03/09 01:10:59
Done.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef MEDIA_WEBM_WEBM_CRYPT_HELPERS_H_ |
+#define MEDIA_WEBM_WEBM_CRYPT_HELPERS_H_ |
+ |
+#include "base/basictypes.h" |
+ |
+#include "base/memory/scoped_ptr.h" |
+#include "media/base/decoder_buffer.h" |
+ |
+namespace media { |
+ |
+// Returns an initialized DecoderBuffer which can be sent to the Decryptor if |
ddorwin
2012/09/01 16:46:41
nit: , which
|
+// the stream is encrypted or sent to the Decoder if the stream is not |
+// encrypted. Currently encrypted streams must be WebM. |
xhwang
2012/08/29 05:08:14
This function should not worry about how the buffe
ddorwin
2012/09/01 16:46:41
Isn't the "Currently..." sentence implicit in the
|
+// Every encrypted Block has an HMAC and IV prepended to it. |
+// Current encrypted WebM request for comments specification is here |
+// http://wiki.webmproject.org/encryption/webm-encryption-rfc |
+// If encrypted, skip past the HMAC to get the buffer. Encrypted buffers |
ddorwin
2012/09/01 16:46:41
This probably needs to be updated to handle verifi
fgalligan1
2013/03/09 01:10:59
hmac removed.
|
+// must include the IV and the encrypted frame because the decryptor will |
+// verify this data before decryption. The HMAC and IV will be copied into |
+// DecryptConfig. |
+scoped_refptr<DecoderBuffer> WebMCopyBufferCheckIfEncrypted( |
ddorwin
2012/09/01 16:46:41
The function name does not "flow" - it's two separ
|
+ const uint8* data, int data_size, |
+ const uint8* key_id, int key_id_size); |
xhwang
2012/08/29 05:08:14
The only reason we use pointer/size for initData i
|
+ |
+} // webkit_media |
ddorwin
2012/09/01 16:46:41
media
fgalligan1
2013/03/09 01:10:59
Done.
|
+ |
+#endif // MEDIA_WEBM_WEBM_CRYPT_HELPERS_H_ |