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

Unified Diff: webkit/media/crypto/ppapi_decryptor.h

Issue 10704241: Add PpapiDecryptor which wraps a CDM plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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: webkit/media/crypto/ppapi_decryptor.h
diff --git a/webkit/media/crypto/ppapi_decryptor.h b/webkit/media/crypto/ppapi_decryptor.h
new file mode 100644
index 0000000000000000000000000000000000000000..45cdc2530414fbc0feb0dac1c463641042c60ef3
--- /dev/null
+++ b/webkit/media/crypto/ppapi_decryptor.h
@@ -0,0 +1,57 @@
+// 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 WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_
+#define WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_
+
+#include "base/memory/ref_counted.h"
+#include "media/base/decryptor.h"
+#include "webkit/media/crypto/key_systems.h"
+
+namespace media {
+class DecryptorClient;
+}
+
+namespace webkit {
+namespace ppapi {
+class PluginInstance;
+}
+}
+
+namespace webkit_media {
+
+class PpapiDecryptor : public media::Decryptor {
+ public:
+ PpapiDecryptor(media::DecryptorClient* client,
+ const CreatePluginCB& create_plugin_cb);
+ virtual ~PpapiDecryptor();
+
+ // media::Decryptor implementation.
+ virtual void GenerateKeyRequest(const std::string& key_system,
+ const uint8* init_data,
+ int init_data_length) OVERRIDE;
+ virtual void AddKey(const std::string& key_system,
+ const uint8* key,
+ int key_length,
+ const uint8* init_data,
+ int init_data_length,
+ const std::string& session_id) OVERRIDE;
+ virtual void CancelKeyRequest(const std::string& key_system,
+ const std::string& session_id) OVERRIDE;
+ virtual void Decrypt(const scoped_refptr<media::DecoderBuffer>& encrypted,
+ const DecryptCB& decrypt_cb) OVERRIDE;
+
+ private:
+ void DataReady(const DecryptCB& decrypt_cb, const uint8* data, int data_size);
+
+ media::DecryptorClient* client_;
+ CreatePluginCB create_plugin_cb_;
+ scoped_refptr<webkit::ppapi::PluginInstance> cdm_plugin_;
+
+ DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor);
+};
+
+} // namespace webkit_media
+
+#endif // WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_

Powered by Google App Engine
This is Rietveld 408576698