Chromium Code Reviews| OLD | NEW |
|---|---|
| (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_ | |
| OLD | NEW |