Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(759)

Unified Diff: media/webm/webm_crypto_helpers.h

Issue 10829470: Support for parsing encrypted WebM streams by src. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactored decryption code. Add 2 unittests. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..0fa58646737a5d34adc72b2f8f83c51b0c85b3c6
--- /dev/null
+++ b/media/webm/webm_crypto_helpers.h
@@ -0,0 +1,32 @@
+// 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.
+// See https://www.w3.org/Bugs/Public/show_bug.cgi?id=19096 for more
+// information.
+const char kWebMEncryptInitDataType[] = "video/webm";
xhwang 2013/03/12 17:28:57 static?
ddorwin 2013/03/12 19:31:01 This is a header. The definition should probably b
fgalligan1 2013/03/13 17:58:09 I tried to extern and move the definition to the .
+
+// 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.
xhwang 2013/03/12 17:28:57 ".. is encrypted, an IV is prepended to the frame"
xhwang 2013/03/12 17:28:57 s/IV/initialization vector/
fgalligan1 2013/03/13 17:58:09 Done.
fgalligan1 2013/03/13 17:58:09 Done.
+// Leaving the initialization vector empty will tell the decryptor that the
xhwang 2013/03/12 17:28:57 s/initialization vector/IV/
fgalligan1 2013/03/13 17:58:09 Done.
+// frame is unencrypted. Current encrypted WebM request for comments
+// specification is here
+// http://wiki.webmproject.org/encryption/webm-encryption-rfc
xhwang 2013/03/12 17:28:57 Returns NULL if the |data| is invalid?
fgalligan1 2013/03/13 17:58:09 Done.
+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_

Powered by Google App Engine
This is Rietveld 408576698