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

Side by Side 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: Add webkit bug in comments. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/media/crypto/key_systems.cc ('k') | webkit/media/crypto/ppapi_decryptor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_
6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_
7
8 #include <string>
9
10 #include "base/memory/ref_counted.h"
11 #include "media/base/decryptor.h"
12
13 namespace media {
14 class DecryptorClient;
15 }
16
17 namespace webkit {
18 namespace ppapi {
19 class PluginInstance;
20 }
21 }
22
23 namespace webkit_media {
24
25 class PpapiDecryptor : public media::Decryptor {
26 public:
27 PpapiDecryptor(
28 media::DecryptorClient* client,
29 const scoped_refptr<webkit::ppapi::PluginInstance>& plugin_instance);
30 virtual ~PpapiDecryptor();
31
32 // media::Decryptor implementation.
33 virtual void GenerateKeyRequest(const std::string& key_system,
34 const uint8* init_data,
35 int init_data_length) OVERRIDE;
36 virtual void AddKey(const std::string& key_system,
37 const uint8* key,
38 int key_length,
39 const uint8* init_data,
40 int init_data_length,
41 const std::string& session_id) OVERRIDE;
42 virtual void CancelKeyRequest(const std::string& key_system,
43 const std::string& session_id) OVERRIDE;
44 virtual void Decrypt(const scoped_refptr<media::DecoderBuffer>& encrypted,
45 const DecryptCB& decrypt_cb) OVERRIDE;
46
47 private:
48 // Callback for the plugin to hand back the decrypted data.
49 void DataReady(const DecryptCB& decrypt_cb, const uint8* data, int data_size);
50
51 // TODO(xhwang): Need to figure out how the CDM plugin fires key events
52 // (e.g. KeyMessage).
53 media::DecryptorClient* client_;
54 scoped_refptr<webkit::ppapi::PluginInstance> cdm_plugin_;
55
56 DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor);
57 };
58
59 } // namespace webkit_media
60
61 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_
OLDNEW
« no previous file with comments | « webkit/media/crypto/key_systems.cc ('k') | webkit/media/crypto/ppapi_decryptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698