| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(StreamType stream_type, | 53 virtual void Decrypt(StreamType stream_type, |
| 54 const scoped_refptr<media::DecoderBuffer>& encrypted, | 54 const scoped_refptr<media::DecoderBuffer>& encrypted, |
| 55 const DecryptCB& decrypt_cb) OVERRIDE; | 55 const DecryptCB& decrypt_cb) OVERRIDE; |
| 56 virtual void CancelDecrypt(StreamType stream_type) OVERRIDE; | 56 virtual void CancelDecrypt(StreamType stream_type) OVERRIDE; |
| 57 virtual void InitializeAudioDecoder( | 57 virtual void InitializeAudioDecoder( |
| 58 scoped_ptr<media::AudioDecoderConfig> config, | 58 scoped_ptr<media::AudioDecoderConfig> config, |
| 59 const DecoderInitCB& init_cb, | 59 const DecoderInitCB& init_cb, |
| 60 const KeyAddedCB& key_added_cb) OVERRIDE; | 60 const OnKeyAddedCB& key_added_cb) OVERRIDE; |
| 61 virtual void InitializeVideoDecoder( | 61 virtual void InitializeVideoDecoder( |
| 62 scoped_ptr<media::VideoDecoderConfig> config, | 62 scoped_ptr<media::VideoDecoderConfig> config, |
| 63 const DecoderInitCB& init_cb, | 63 const DecoderInitCB& init_cb, |
| 64 const KeyAddedCB& key_added_cb) OVERRIDE; | 64 const OnKeyAddedCB& key_added_cb) OVERRIDE; |
| 65 virtual void DecryptAndDecodeAudio( | 65 virtual void DecryptAndDecodeAudio( |
| 66 const scoped_refptr<media::DecoderBuffer>& encrypted, | 66 const scoped_refptr<media::DecoderBuffer>& encrypted, |
| 67 const AudioDecodeCB& audio_decode_cb) OVERRIDE; | 67 const AudioDecodeCB& audio_decode_cb) OVERRIDE; |
| 68 virtual void DecryptAndDecodeVideo( | 68 virtual void DecryptAndDecodeVideo( |
| 69 const scoped_refptr<media::DecoderBuffer>& encrypted, | 69 const scoped_refptr<media::DecoderBuffer>& encrypted, |
| 70 const VideoDecodeCB& video_decode_cb) OVERRIDE; | 70 const VideoDecodeCB& video_decode_cb) OVERRIDE; |
| 71 virtual void ResetDecoder(StreamType stream_type) OVERRIDE; | 71 virtual void ResetDecoder(StreamType stream_type) OVERRIDE; |
| 72 virtual void DeinitializeDecoder(StreamType stream_type) OVERRIDE; | 72 virtual void DeinitializeDecoder(StreamType stream_type) OVERRIDE; |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 void ReportFailureToCallPlugin(const std::string& key_system, | 75 void ReportFailureToCallPlugin(const std::string& key_system, |
| 76 const std::string& session_id); | 76 const std::string& session_id); |
| 77 | 77 |
| 78 void OnDecoderInitialized(StreamType stream_type, | 78 void OnDecoderInitialized(StreamType stream_type, |
| 79 const KeyAddedCB& key_added_cb, | 79 const OnKeyAddedCB& key_added_cb, |
| 80 bool success); | 80 bool success); |
| 81 | 81 |
| 82 media::DecryptorClient* client_; | 82 media::DecryptorClient* client_; |
| 83 scoped_refptr<webkit::ppapi::PluginInstance> cdm_plugin_; | 83 scoped_refptr<webkit::ppapi::PluginInstance> cdm_plugin_; |
| 84 scoped_refptr<base::MessageLoopProxy> render_loop_proxy_; | 84 scoped_refptr<base::MessageLoopProxy> render_loop_proxy_; |
| 85 | 85 |
| 86 DecoderInitCB audio_decoder_init_cb_; | 86 DecoderInitCB audio_decoder_init_cb_; |
| 87 DecoderInitCB video_decoder_init_cb_; | 87 DecoderInitCB video_decoder_init_cb_; |
| 88 KeyAddedCB audio_key_added_cb_; | 88 OnKeyAddedCB audio_key_added_cb_; |
| 89 KeyAddedCB video_key_added_cb_; | 89 OnKeyAddedCB video_key_added_cb_; |
| 90 | 90 |
| 91 base::WeakPtrFactory<PpapiDecryptor> weak_ptr_factory_; | 91 base::WeakPtrFactory<PpapiDecryptor> weak_ptr_factory_; |
| 92 base::WeakPtr<PpapiDecryptor> weak_this_; | 92 base::WeakPtr<PpapiDecryptor> weak_this_; |
| 93 | 93 |
| 94 DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor); | 94 DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor); |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 } // namespace webkit_media | 97 } // namespace webkit_media |
| 98 | 98 |
| 99 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ | 99 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ |
| OLD | NEW |