OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ | 5 #ifndef WEBKIT_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ |
6 #define WEBKIT_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ | 6 #define WEBKIT_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 const uint8* init_data, | 57 const uint8* init_data, |
58 int init_data_length) OVERRIDE; | 58 int init_data_length) OVERRIDE; |
59 virtual void AddKey(const std::string& key_system, | 59 virtual void AddKey(const std::string& key_system, |
60 const uint8* key, | 60 const uint8* key, |
61 int key_length, | 61 int key_length, |
62 const uint8* init_data, | 62 const uint8* init_data, |
63 int init_data_length, | 63 int init_data_length, |
64 const std::string& session_id) OVERRIDE; | 64 const std::string& session_id) OVERRIDE; |
65 virtual void CancelKeyRequest(const std::string& key_system, | 65 virtual void CancelKeyRequest(const std::string& key_system, |
66 const std::string& session_id) OVERRIDE; | 66 const std::string& session_id) OVERRIDE; |
67 virtual void Decrypt(const scoped_refptr<media::DecoderBuffer>& encrypted, | 67 virtual void Decrypt(StreamType stream_type, |
| 68 const scoped_refptr<media::DecoderBuffer>& encrypted, |
68 const DecryptCB& decrypt_cb) OVERRIDE; | 69 const DecryptCB& decrypt_cb) OVERRIDE; |
69 virtual void CancelDecrypt() OVERRIDE; | 70 virtual void CancelDecrypt(StreamType stream_type) OVERRIDE; |
| 71 virtual void InitializeAudioDecoder( |
| 72 scoped_ptr<media::AudioDecoderConfig> config, |
| 73 const DecoderInitCB& init_cb, |
| 74 const KeyAddedCB& key_added_cb) OVERRIDE; |
70 virtual void InitializeVideoDecoder( | 75 virtual void InitializeVideoDecoder( |
71 scoped_ptr<media::VideoDecoderConfig> config, | 76 scoped_ptr<media::VideoDecoderConfig> config, |
72 const DecoderInitCB& init_cb, | 77 const DecoderInitCB& init_cb, |
73 const KeyAddedCB& key_added_cb) OVERRIDE; | 78 const KeyAddedCB& key_added_cb) OVERRIDE; |
| 79 virtual void DecryptAndDecodeAudio( |
| 80 const scoped_refptr<media::DecoderBuffer>& encrypted, |
| 81 const AudioDecodeCB& audio_decode_cb) OVERRIDE; |
74 virtual void DecryptAndDecodeVideo( | 82 virtual void DecryptAndDecodeVideo( |
75 const scoped_refptr<media::DecoderBuffer>& encrypted, | 83 const scoped_refptr<media::DecoderBuffer>& encrypted, |
76 const VideoDecodeCB& video_decode_cb) OVERRIDE; | 84 const VideoDecodeCB& video_decode_cb) OVERRIDE; |
77 virtual void CancelDecryptAndDecodeVideo() OVERRIDE; | 85 virtual void ResetDecoder(StreamType stream_type) OVERRIDE; |
78 virtual void StopVideoDecoder() OVERRIDE; | 86 virtual void DeinitializeDecoder(StreamType stream_type) OVERRIDE; |
79 | 87 |
80 private: | 88 private: |
81 // Helper functions to create decryptors to handle the given |key_system|. | 89 // Helper functions to create decryptors to handle the given |key_system|. |
82 scoped_ptr<media::Decryptor> CreatePpapiDecryptor( | 90 scoped_ptr<media::Decryptor> CreatePpapiDecryptor( |
83 const std::string& key_system); | 91 const std::string& key_system); |
84 scoped_ptr<media::Decryptor> CreateDecryptor(const std::string& key_system); | 92 scoped_ptr<media::Decryptor> CreateDecryptor(const std::string& key_system); |
85 | 93 |
86 void OnNewKeyAdded(); | 94 void OnNewKeyAdded(); |
87 | 95 |
88 // Sends |pending_buffer_to_decrypt_| to |decryptor_| for decryption. | 96 // Sends |pending_buffer_to_decrypt_| to |decryptor_| for decryption. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // the |pending_buffer_to_decrypt_| again if kNoKey is returned because a | 145 // the |pending_buffer_to_decrypt_| again if kNoKey is returned because a |
138 // new key has been added. | 146 // new key has been added. |
139 bool has_new_key_added_; | 147 bool has_new_key_added_; |
140 | 148 |
141 DISALLOW_COPY_AND_ASSIGN(ProxyDecryptor); | 149 DISALLOW_COPY_AND_ASSIGN(ProxyDecryptor); |
142 }; | 150 }; |
143 | 151 |
144 } // namespace webkit_media | 152 } // namespace webkit_media |
145 | 153 |
146 #endif // WEBKIT_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ | 154 #endif // WEBKIT_MEDIA_CRYPTO_PROXY_DECRYPTOR_H_ |
OLD | NEW |