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

Unified Diff: webkit/media/proxy_decryptor.h

Issue 10575026: Add ProxyDecryptor which wraps concrete Decryptor implementations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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
« no previous file with comments | « no previous file | webkit/media/proxy_decryptor.cc » ('j') | webkit/media/webmediaplayer_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/proxy_decryptor.h
diff --git a/webkit/media/proxy_decryptor.h b/webkit/media/proxy_decryptor.h
new file mode 100644
index 0000000000000000000000000000000000000000..782880fd53221ed12a2783466dd7b0b0bf74375c
--- /dev/null
+++ b/webkit/media/proxy_decryptor.h
@@ -0,0 +1,54 @@
+// 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_PROXY_DECRYPTOR_H_
+#define WEBKIT_MEDIA_PROXY_DECRYPTOR_H_
+
+#include <string>
+
+#include "base/memory/scoped_ptr.h"
+#include "base/synchronization/lock.h"
+#include "media/base/decryptor.h"
+
+namespace media {
+class DecryptorClient;
+}
+
+namespace webkit_media {
+
+// A decryptor proxy that creates a real decryptor object on demand and
+// forwards decryptor calls to it. Currently we don't support run-time
+// switching among decryptor objects.
+class ProxyDecryptor : public media::Decryptor {
+ public:
+ explicit ProxyDecryptor(media::DecryptorClient* client);
+ virtual ~ProxyDecryptor();
+
+ // 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 scoped_refptr<media::DecoderBuffer> Decrypt(
+ const scoped_refptr<media::DecoderBuffer>& input) OVERRIDE;
+
+ private:
+ media::DecryptorClient* const client_;
+ base::Lock lock_;
+ scoped_ptr<media::Decryptor> decryptor_;
+ std::string current_key_system_;
+
+ DISALLOW_COPY_AND_ASSIGN(ProxyDecryptor);
+};
+
+} // namespace webkit_media
+
+#endif // WEBKIT_MEDIA_PROXY_DECRYPTOR_H_
« no previous file with comments | « no previous file | webkit/media/proxy_decryptor.cc » ('j') | webkit/media/webmediaplayer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698