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

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: 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
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 "base/memory/ref_counted.h"
9 #include "media/base/decryptor.h"
10 #include "webkit/media/crypto/key_systems.h"
11
12 namespace media {
13 class DecryptorClient;
14 }
15
16 namespace webkit {
17 namespace ppapi {
18 class PluginInstance;
19 }
20 }
21
22 namespace webkit_media {
23
24 class PpapiDecryptor : public media::Decryptor {
25 public:
26 PpapiDecryptor(media::DecryptorClient* client,
27 const CreatePluginCB& create_plugin_cb);
28 virtual ~PpapiDecryptor();
29
30 // media::Decryptor implementation.
31 virtual void GenerateKeyRequest(const std::string& key_system,
32 const uint8* init_data,
33 int init_data_length) OVERRIDE;
34 virtual void AddKey(const std::string& key_system,
35 const uint8* key,
36 int key_length,
37 const uint8* init_data,
38 int init_data_length,
39 const std::string& session_id) OVERRIDE;
40 virtual void CancelKeyRequest(const std::string& key_system,
41 const std::string& session_id) OVERRIDE;
42 virtual void Decrypt(const scoped_refptr<media::DecoderBuffer>& encrypted,
43 const DecryptCB& decrypt_cb) OVERRIDE;
44
45 private:
46 void DataReady(const DecryptCB& decrypt_cb, const uint8* data, int data_size);
47
48 media::DecryptorClient* client_;
49 CreatePluginCB create_plugin_cb_;
50 scoped_refptr<webkit::ppapi::PluginInstance> cdm_plugin_;
51
52 DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor);
53 };
54
55 } // namespace webkit_media
56
57 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698