| 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_PPAPI_DECRYPTOR_H_ | 5 #ifndef WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ |
| 6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ | 6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 const uint8* init_data, | 43 const uint8* init_data, |
| 44 int init_data_length) OVERRIDE; | 44 int init_data_length) OVERRIDE; |
| 45 virtual void AddKey(const std::string& key_system, | 45 virtual void AddKey(const std::string& key_system, |
| 46 const uint8* key, | 46 const uint8* key, |
| 47 int key_length, | 47 int key_length, |
| 48 const uint8* init_data, | 48 const uint8* init_data, |
| 49 int init_data_length, | 49 int init_data_length, |
| 50 const std::string& session_id) OVERRIDE; | 50 const std::string& session_id) OVERRIDE; |
| 51 virtual void CancelKeyRequest(const std::string& key_system, | 51 virtual void CancelKeyRequest(const std::string& key_system, |
| 52 const std::string& session_id) OVERRIDE; | 52 const std::string& session_id) OVERRIDE; |
| 53 virtual void Decrypt(const scoped_refptr<media::DecoderBuffer>& encrypted, | 53 virtual void Decrypt(StreamType stream_type, |
| 54 const scoped_refptr<media::DecoderBuffer>& encrypted, |
| 54 const DecryptCB& decrypt_cb) OVERRIDE; | 55 const DecryptCB& decrypt_cb) OVERRIDE; |
| 55 virtual void CancelDecrypt() OVERRIDE; | 56 virtual void CancelDecrypt(StreamType stream_type) OVERRIDE; |
| 57 virtual void InitializeAudioDecoder( |
| 58 scoped_ptr<media::AudioDecoderConfig> config, |
| 59 const DecoderInitCB& init_cb, |
| 60 const KeyAddedCB& key_added_cb) OVERRIDE; |
| 56 virtual void InitializeVideoDecoder( | 61 virtual void InitializeVideoDecoder( |
| 57 scoped_ptr<media::VideoDecoderConfig> config, | 62 scoped_ptr<media::VideoDecoderConfig> config, |
| 58 const DecoderInitCB& init_cb, | 63 const DecoderInitCB& init_cb, |
| 59 const KeyAddedCB& key_added_cb) OVERRIDE; | 64 const KeyAddedCB& key_added_cb) OVERRIDE; |
| 65 virtual void DecryptAndDecodeAudio( |
| 66 const scoped_refptr<media::DecoderBuffer>& encrypted, |
| 67 const AudioDecodeCB& audio_decode_cb) OVERRIDE; |
| 60 virtual void DecryptAndDecodeVideo( | 68 virtual void DecryptAndDecodeVideo( |
| 61 const scoped_refptr<media::DecoderBuffer>& encrypted, | 69 const scoped_refptr<media::DecoderBuffer>& encrypted, |
| 62 const VideoDecodeCB& video_decode_cb) OVERRIDE; | 70 const VideoDecodeCB& video_decode_cb) OVERRIDE; |
| 63 virtual void CancelDecryptAndDecodeVideo() OVERRIDE; | 71 virtual void ResetDecoder(StreamType stream_type) OVERRIDE; |
| 64 virtual void StopVideoDecoder() OVERRIDE; | 72 virtual void DeinitializeDecoder(StreamType stream_type) OVERRIDE; |
| 65 | 73 |
| 66 private: | 74 private: |
| 67 void ReportFailureToCallPlugin(const std::string& key_system, | 75 void ReportFailureToCallPlugin(const std::string& key_system, |
| 68 const std::string& session_id); | 76 const std::string& session_id); |
| 69 | 77 |
| 70 void OnVideoDecoderInitialized(bool success); | 78 void OnDecoderInitialized(StreamType stream_type, |
| 79 const KeyAddedCB& key_added_cb, |
| 80 bool success); |
| 71 | 81 |
| 72 media::DecryptorClient* client_; | 82 media::DecryptorClient* client_; |
| 73 scoped_refptr<webkit::ppapi::PluginInstance> cdm_plugin_; | 83 scoped_refptr<webkit::ppapi::PluginInstance> cdm_plugin_; |
| 74 scoped_refptr<base::MessageLoopProxy> render_loop_proxy_; | 84 scoped_refptr<base::MessageLoopProxy> render_loop_proxy_; |
| 75 | 85 |
| 86 DecoderInitCB audio_decoder_init_cb_; |
| 76 DecoderInitCB video_decoder_init_cb_; | 87 DecoderInitCB video_decoder_init_cb_; |
| 77 KeyAddedCB key_added_cb_; | 88 KeyAddedCB audio_key_added_cb_; |
| 89 KeyAddedCB video_key_added_cb_; |
| 78 | 90 |
| 79 base::WeakPtrFactory<PpapiDecryptor> weak_ptr_factory_; | 91 base::WeakPtrFactory<PpapiDecryptor> weak_ptr_factory_; |
| 80 base::WeakPtr<PpapiDecryptor> weak_this_; | 92 base::WeakPtr<PpapiDecryptor> weak_this_; |
| 81 | 93 |
| 82 DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor); | 94 DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor); |
| 83 }; | 95 }; |
| 84 | 96 |
| 85 } // namespace webkit_media | 97 } // namespace webkit_media |
| 86 | 98 |
| 87 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ | 99 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ |
| OLD | NEW |