| 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_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 255 |
| 256 // Provides access to PPP_ContentDecryptor_Private. | 256 // Provides access to PPP_ContentDecryptor_Private. |
| 257 // TODO(tomfinegan): Move decryptor methods to delegate class. | 257 // TODO(tomfinegan): Move decryptor methods to delegate class. |
| 258 void set_decrypt_client(media::DecryptorClient* client); | 258 void set_decrypt_client(media::DecryptorClient* client); |
| 259 bool GenerateKeyRequest(const std::string& key_system, | 259 bool GenerateKeyRequest(const std::string& key_system, |
| 260 const std::string& init_data); | 260 const std::string& init_data); |
| 261 bool AddKey(const std::string& session_id, | 261 bool AddKey(const std::string& session_id, |
| 262 const std::string& key, | 262 const std::string& key, |
| 263 const std::string& init_data); | 263 const std::string& init_data); |
| 264 bool CancelKeyRequest(const std::string& session_id); | 264 bool CancelKeyRequest(const std::string& session_id); |
| 265 bool Decrypt(const scoped_refptr<media::DecoderBuffer>& encrypted_buffer, | 265 bool Decrypt(media::Decryptor::StreamType stream_type, |
| 266 const scoped_refptr<media::DecoderBuffer>& encrypted_buffer, |
| 266 const media::Decryptor::DecryptCB& decrypt_cb); | 267 const media::Decryptor::DecryptCB& decrypt_cb); |
| 268 bool CancelDecrypt(media::Decryptor::StreamType stream_type); |
| 267 bool InitializeAudioDecoder( | 269 bool InitializeAudioDecoder( |
| 268 const media::AudioDecoderConfig& decoder_config, | 270 const media::AudioDecoderConfig& decoder_config, |
| 269 const media::Decryptor::DecoderInitCB& decoder_init_cb); | 271 const media::Decryptor::DecoderInitCB& decoder_init_cb); |
| 270 bool InitializeVideoDecoder( | 272 bool InitializeVideoDecoder( |
| 271 const media::VideoDecoderConfig& decoder_config, | 273 const media::VideoDecoderConfig& decoder_config, |
| 272 const media::Decryptor::DecoderInitCB& decoder_init_cb); | 274 const media::Decryptor::DecoderInitCB& decoder_init_cb); |
| 273 // TODO(tomfinegan): Add callback args for DeinitializeDecoder() and | 275 // TODO(tomfinegan): Add callback args for DeinitializeDecoder() and |
| 274 // ResetDecoder() | 276 // ResetDecoder() |
| 275 bool DeinitializeDecoder(); | 277 bool DeinitializeDecoder(media::Decryptor::StreamType stream_type); |
| 276 bool ResetDecoder(); | 278 bool ResetDecoder(media::Decryptor::StreamType stream_type); |
| 277 // Note: This method can be used with an unencrypted frame. | 279 // Note: These methods can be used with unencrypted data. |
| 278 bool DecryptAndDecode( | 280 bool DecryptAndDecodeAudio( |
| 281 const scoped_refptr<media::DecoderBuffer>& encrypted_buffer, |
| 282 const media::Decryptor::AudioDecodeCB& audio_decode_cb); |
| 283 bool DecryptAndDecodeVideo( |
| 279 const scoped_refptr<media::DecoderBuffer>& encrypted_buffer, | 284 const scoped_refptr<media::DecoderBuffer>& encrypted_buffer, |
| 280 const media::Decryptor::VideoDecodeCB& video_decode_cb); | 285 const media::Decryptor::VideoDecodeCB& video_decode_cb); |
| 281 | 286 |
| 282 // There are 2 implementations of the fullscreen interface | 287 // There are 2 implementations of the fullscreen interface |
| 283 // PPB_FlashFullscreen is used by Pepper Flash. | 288 // PPB_FlashFullscreen is used by Pepper Flash. |
| 284 // PPB_Fullscreen is intended for other applications including NaCl. | 289 // PPB_Fullscreen is intended for other applications including NaCl. |
| 285 // The two interface are mutually exclusive. | 290 // The two interface are mutually exclusive. |
| 286 | 291 |
| 287 // Implementation of PPB_FlashFullscreen. | 292 // Implementation of PPB_FlashFullscreen. |
| 288 | 293 |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 // Returns true if the WebView the plugin is in renders via the accelerated | 594 // Returns true if the WebView the plugin is in renders via the accelerated |
| 590 // compositing path. | 595 // compositing path. |
| 591 bool IsViewAccelerated(); | 596 bool IsViewAccelerated(); |
| 592 | 597 |
| 593 // Track, set and reset size attributes to control the size of the plugin | 598 // Track, set and reset size attributes to control the size of the plugin |
| 594 // in and out of fullscreen mode. | 599 // in and out of fullscreen mode. |
| 595 void KeepSizeAttributesBeforeFullscreen(); | 600 void KeepSizeAttributesBeforeFullscreen(); |
| 596 void SetSizeAttributesForFullscreen(); | 601 void SetSizeAttributesForFullscreen(); |
| 597 void ResetSizeAttributesAfterFullscreen(); | 602 void ResetSizeAttributesAfterFullscreen(); |
| 598 | 603 |
| 604 // Cancels the pending decrypt-and-decode callback for |stream_type|. |
| 605 void CancelDecode(media::Decryptor::StreamType stream_type); |
| 606 |
| 599 PluginDelegate* delegate_; | 607 PluginDelegate* delegate_; |
| 600 scoped_refptr<PluginModule> module_; | 608 scoped_refptr<PluginModule> module_; |
| 601 scoped_ptr< ::ppapi::PPP_Instance_Combined> instance_interface_; | 609 scoped_ptr< ::ppapi::PPP_Instance_Combined> instance_interface_; |
| 602 // If this is the NaCl plugin, we create a new module when we switch to the | 610 // If this is the NaCl plugin, we create a new module when we switch to the |
| 603 // IPC-based PPAPI proxy. Store the original module and instance interface | 611 // IPC-based PPAPI proxy. Store the original module and instance interface |
| 604 // so we can shut down properly. | 612 // so we can shut down properly. |
| 605 scoped_refptr<PluginModule> original_module_; | 613 scoped_refptr<PluginModule> original_module_; |
| 606 scoped_ptr< ::ppapi::PPP_Instance_Combined> original_instance_interface_; | 614 scoped_ptr< ::ppapi::PPP_Instance_Combined> original_instance_interface_; |
| 607 | 615 |
| 608 PP_Instance pp_instance_; | 616 PP_Instance pp_instance_; |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 scoped_refptr<PPB_URLLoader_Impl> document_loader_; | 793 scoped_refptr<PPB_URLLoader_Impl> document_loader_; |
| 786 | 794 |
| 787 media::DecryptorClient* decryptor_client_; | 795 media::DecryptorClient* decryptor_client_; |
| 788 | 796 |
| 789 // Request ID for tracking pending content decryption callbacks. | 797 // Request ID for tracking pending content decryption callbacks. |
| 790 // Note that zero indicates an invalid request ID. | 798 // Note that zero indicates an invalid request ID. |
| 791 // TODO(xhwang): Add completion callbacks for Reset/Stop and remove the use | 799 // TODO(xhwang): Add completion callbacks for Reset/Stop and remove the use |
| 792 // of request IDs. | 800 // of request IDs. |
| 793 uint32_t next_decryption_request_id_; | 801 uint32_t next_decryption_request_id_; |
| 794 | 802 |
| 795 // TODO(xhwang): Use two separate callbacks for video and audio instead using | 803 uint32_t pending_audio_decrypt_request_id_; |
| 796 // a map here. | 804 media::Decryptor::DecryptCB pending_audio_decrypt_cb_; |
| 797 typedef std::map<uint32_t, media::Decryptor::DecryptCB> DecryptionCBMap; | 805 |
| 798 DecryptionCBMap pending_decryption_cbs_; | 806 uint32_t pending_video_decrypt_request_id_; |
| 807 media::Decryptor::DecryptCB pending_video_decrypt_cb_; |
| 799 | 808 |
| 800 uint32_t pending_audio_decoder_init_request_id_; | 809 uint32_t pending_audio_decoder_init_request_id_; |
| 801 media::Decryptor::DecoderInitCB pending_audio_decoder_init_cb_; | 810 media::Decryptor::DecoderInitCB pending_audio_decoder_init_cb_; |
| 802 | 811 |
| 803 uint32_t pending_video_decoder_init_request_id_; | 812 uint32_t pending_video_decoder_init_request_id_; |
| 804 media::Decryptor::DecoderInitCB pending_video_decoder_init_cb_; | 813 media::Decryptor::DecoderInitCB pending_video_decoder_init_cb_; |
| 805 | 814 |
| 815 uint32_t pending_audio_decode_request_id_; |
| 816 media::Decryptor::AudioDecodeCB pending_audio_decode_cb_; |
| 817 |
| 806 uint32_t pending_video_decode_request_id_; | 818 uint32_t pending_video_decode_request_id_; |
| 807 media::Decryptor::VideoDecodeCB pending_video_decode_cb_; | 819 media::Decryptor::VideoDecodeCB pending_video_decode_cb_; |
| 808 | 820 |
| 809 DISALLOW_COPY_AND_ASSIGN(PluginInstance); | 821 DISALLOW_COPY_AND_ASSIGN(PluginInstance); |
| 810 }; | 822 }; |
| 811 | 823 |
| 812 } // namespace ppapi | 824 } // namespace ppapi |
| 813 } // namespace webkit | 825 } // namespace webkit |
| 814 | 826 |
| 815 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 827 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
| OLD | NEW |