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