Index: media/crypto/decryptor_client.h |
diff --git a/media/crypto/decryptor_client.h b/media/crypto/decryptor_client.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f658a02bb4688deb6b0d28f0e86528d48d456612 |
--- /dev/null |
+++ b/media/crypto/decryptor_client.h |
@@ -0,0 +1,45 @@ |
+// Copyright (c) 2012 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_CRYPTO_DECRYPTOR_CLIENT_H_ |
+#define MEDIA_CRYPTO_DECRYPTOR_CLIENT_H_ |
+ |
+#include <string> |
+ |
+#include "base/memory/scoped_ptr.h" |
+#include "media/crypto/aes_decryptor.h" |
+ |
+namespace media { |
+ |
+// Interface used by a decryptor to fire key events. |
+// See: http://dvcs.w3.org/hg/html-media/raw-file/tip/encrypted-media/encrypted-media.html#event-summary |
+class DecryptorClient { |
+ public: |
+ virtual ~DecryptorClient() {} |
ddorwin
2012/06/11 21:02:40
You can make this private (and non-virtual) and pr
xhwang
2012/06/12 19:01:15
Good to know! Done.
|
+ |
+ virtual void KeyAdded(const std::string& key_system, |
scherkus (not reviewing)
2012/06/12 03:15:58
docs everywhere
xhwang
2012/06/12 19:01:15
Done.
|
+ const std::string& session_id) = 0; |
+ |
+ // Signals that a key error happened. The |system_code| is key system |
+ // dependent. For clear key system, the |system_code| is always zero. |
+ virtual void KeyError(const std::string& key_system, |
+ const std::string& session_id, |
+ AesDecryptor::KeyError error_code, |
+ int system_code) = 0; |
+ |
+ virtual void KeyMessage(const std::string& key_system, |
+ const std::string& session_id, |
+ scoped_array<uint8> message, |
+ int message_length, |
+ const std::string& default_url) = 0; |
+ |
+ virtual void KeyNeeded(const std::string& key_system, |
ddorwin
2012/06/11 21:02:40
The proposal uses NeedKey.
xhwang
2012/06/12 19:01:15
Done.
|
+ const std::string& session_id, |
+ scoped_array<uint8> init_data, |
+ int init_data_length) = 0; |
+}; |
+ |
+} // namespace media |
+ |
+#endif // MEDIA_CRYPTO_DECRYPTOR_CLIENT_H_ |