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

Side by Side Diff: webkit/media/crypto/proxy_decryptor.h

Issue 10575026: Add ProxyDecryptor which wraps concrete Decryptor implementations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revise on 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
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_PROXY_DECRYPTOR_H_
6 #define WEBKIT_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_
7
8 #include <string>
9
10 #include "base/memory/scoped_ptr.h"
11 #include "base/synchronization/lock.h"
12 #include "media/base/decryptor.h"
13
14 namespace media {
15 class DecryptorClient;
16 }
17
18 namespace webkit_media {
19
20 // A decryptor proxy that creates a real decryptor object on demand and
21 // forwards decryptor calls to it. Currently we don't support run-time
ddorwin 2012/06/27 04:00:08 Make the second sentence a TODO so we don't forget
xhwang 2012/06/27 21:41:26 Done.
22 // switching among decryptor objects.
23 class ProxyDecryptor : public media::Decryptor {
24 public:
25 explicit ProxyDecryptor(media::DecryptorClient* client);
26 virtual ~ProxyDecryptor();
27
28 // media::Decryptor implementation.
29 virtual void GenerateKeyRequest(const std::string& key_system,
30 const uint8* init_data,
31 int init_data_length) OVERRIDE;
32 virtual void AddKey(const std::string& key_system,
33 const uint8* key,
34 int key_length,
35 const uint8* init_data,
36 int init_data_length,
37 const std::string& session_id) OVERRIDE;
38 virtual void CancelKeyRequest(const std::string& key_system,
39 const std::string& session_id) OVERRIDE;
40 virtual scoped_refptr<media::DecoderBuffer> Decrypt(
41 const scoped_refptr<media::DecoderBuffer>& input) OVERRIDE;
42
43 private:
44 media::DecryptorClient* const client_;
45 base::Lock lock_;
46 scoped_ptr<media::Decryptor> decryptor_;
47 std::string current_key_system_;
48
49 DISALLOW_COPY_AND_ASSIGN(ProxyDecryptor);
50 };
51
52 } // namespace webkit_media
53
54 #endif // WEBKIT_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698