| 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 // TODO(tomfinegan): Move decryptor methods to delegate class. | 256 // TODO(tomfinegan): Move decryptor methods to delegate class. |
| 257 void set_decrypt_client(media::DecryptorClient* client); | 257 void set_decrypt_client(media::DecryptorClient* client); |
| 258 bool GenerateKeyRequest(const std::string& key_system, | 258 bool GenerateKeyRequest(const std::string& key_system, |
| 259 const std::string& init_data); | 259 const std::string& init_data); |
| 260 bool AddKey(const std::string& session_id, | 260 bool AddKey(const std::string& session_id, |
| 261 const std::string& key, | 261 const std::string& key, |
| 262 const std::string& init_data); | 262 const std::string& init_data); |
| 263 bool CancelKeyRequest(const std::string& session_id); | 263 bool CancelKeyRequest(const std::string& session_id); |
| 264 bool Decrypt(const scoped_refptr<media::DecoderBuffer>& encrypted_buffer, | 264 bool Decrypt(const scoped_refptr<media::DecoderBuffer>& encrypted_buffer, |
| 265 const media::Decryptor::DecryptCB& decrypt_cb); | 265 const media::Decryptor::DecryptCB& decrypt_cb); |
| 266 // TODO(xhwang): Change DecryptCB to a DecoderInitCB. | |
| 267 bool InitializeVideoDecoder( | 266 bool InitializeVideoDecoder( |
| 268 const media::VideoDecoderConfig& decoder_config, | 267 const media::VideoDecoderConfig& decoder_config, |
| 269 const media::Decryptor::DecryptCB& decrypt_cb); | 268 const media::Decryptor::DecoderInitCB& decoder_init_cb); |
| 270 // TODO(tomfinegan): Add callback args for DeinitializeDecoder() and | 269 // TODO(tomfinegan): Add callback args for DeinitializeDecoder() and |
| 271 // ResetDecoder() | 270 // ResetDecoder() |
| 272 bool DeinitializeDecoder(); | 271 bool DeinitializeDecoder(); |
| 273 bool ResetDecoder(); | 272 bool ResetDecoder(); |
| 274 // TODO(xhwang): Update this when we need to support decrypt and decode. | |
| 275 // Note: This method can be used with an unencrypted frame. | 273 // Note: This method can be used with an unencrypted frame. |
| 276 bool DecryptAndDecode( | 274 bool DecryptAndDecode( |
| 277 const scoped_refptr<media::DecoderBuffer>& encrypted_buffer, | 275 const scoped_refptr<media::DecoderBuffer>& encrypted_buffer, |
| 278 const media::Decryptor::DecryptCB& decrypt_cb); | 276 const media::Decryptor::VideoDecodeCB& video_decode_cb); |
| 279 | 277 |
| 280 // There are 2 implementations of the fullscreen interface | 278 // There are 2 implementations of the fullscreen interface |
| 281 // PPB_FlashFullscreen is used by Pepper Flash. | 279 // PPB_FlashFullscreen is used by Pepper Flash. |
| 282 // PPB_Fullscreen is intended for other applications including NaCl. | 280 // PPB_Fullscreen is intended for other applications including NaCl. |
| 283 // The two interface are mutually exclusive. | 281 // The two interface are mutually exclusive. |
| 284 | 282 |
| 285 // Implementation of PPB_FlashFullscreen. | 283 // Implementation of PPB_FlashFullscreen. |
| 286 | 284 |
| 287 // Because going to fullscreen is asynchronous (but going out is not), there | 285 // Because going to fullscreen is asynchronous (but going out is not), there |
| 288 // are 3 states: | 286 // are 3 states: |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 // We store the arguments so we can re-send them if we are reset to talk to | 773 // We store the arguments so we can re-send them if we are reset to talk to |
| 776 // NaCl via the IPC NaCl proxy. | 774 // NaCl via the IPC NaCl proxy. |
| 777 std::vector<std::string> argn_; | 775 std::vector<std::string> argn_; |
| 778 std::vector<std::string> argv_; | 776 std::vector<std::string> argv_; |
| 779 | 777 |
| 780 // This is NULL unless HandleDocumentLoad has called. In that case, we store | 778 // This is NULL unless HandleDocumentLoad has called. In that case, we store |
| 781 // the pointer so we can re-send it later if we are reset to talk to NaCl. | 779 // the pointer so we can re-send it later if we are reset to talk to NaCl. |
| 782 scoped_refptr<PPB_URLLoader_Impl> document_loader_; | 780 scoped_refptr<PPB_URLLoader_Impl> document_loader_; |
| 783 | 781 |
| 784 media::DecryptorClient* decryptor_client_; | 782 media::DecryptorClient* decryptor_client_; |
| 783 |
| 784 // Request ID for tracking pending content decryption callbacks. |
| 785 // Note that zero indicates an invalid request ID. |
| 786 // TODO(xhwang): Add completion callbacks for Reset/Stop and remove the use |
| 787 // of request IDs. |
| 785 uint32_t next_decryption_request_id_; | 788 uint32_t next_decryption_request_id_; |
| 789 |
| 790 // TODO(xhwang): Use two separate callbacks for video and audio instead using |
| 791 // a map here. |
| 786 typedef std::map<uint32_t, media::Decryptor::DecryptCB> DecryptionCBMap; | 792 typedef std::map<uint32_t, media::Decryptor::DecryptCB> DecryptionCBMap; |
| 787 DecryptionCBMap pending_decryption_cbs_; | 793 DecryptionCBMap pending_decryption_cbs_; |
| 788 | 794 |
| 795 uint32_t pending_video_decoder_init_request_id_; |
| 796 media::Decryptor::DecoderInitCB pending_video_decoder_init_cb_; |
| 797 |
| 798 uint32_t pending_video_decode_request_id_; |
| 799 media::Decryptor::VideoDecodeCB pending_video_decode_cb_; |
| 800 |
| 789 DISALLOW_COPY_AND_ASSIGN(PluginInstance); | 801 DISALLOW_COPY_AND_ASSIGN(PluginInstance); |
| 790 }; | 802 }; |
| 791 | 803 |
| 792 } // namespace ppapi | 804 } // namespace ppapi |
| 793 } // namespace webkit | 805 } // namespace webkit |
| 794 | 806 |
| 795 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 807 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
| OLD | NEW |