Chromium Code Reviews| 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. | |
| 276 bool DecryptAndDecode( | 273 bool DecryptAndDecode( |
|
ddorwin
2012/10/13 01:40:28
"// Note: This method can be used with an unencryp
xhwang
2012/10/15 19:53:01
Done.
| |
| 277 const scoped_refptr<media::DecoderBuffer>& encrypted_buffer, | 274 const scoped_refptr<media::DecoderBuffer>& encrypted_buffer, |
| 278 const media::Decryptor::DecryptCB& decrypt_cb); | 275 const media::Decryptor::VideoDecodeCB& video_decode_cb); |
|
ddorwin
2012/10/13 01:40:28
What's the plan for audio? Will we have two CBs or
xhwang
2012/10/15 19:53:01
I guess I'll just rename so we have DecryptAndDeco
| |
| 279 | 276 |
| 280 // There are 2 implementations of the fullscreen interface | 277 // There are 2 implementations of the fullscreen interface |
| 281 // PPB_FlashFullscreen is used by Pepper Flash. | 278 // PPB_FlashFullscreen is used by Pepper Flash. |
| 282 // PPB_Fullscreen is intended for other applications including NaCl. | 279 // PPB_Fullscreen is intended for other applications including NaCl. |
| 283 // The two interface are mutually exclusive. | 280 // The two interface are mutually exclusive. |
| 284 | 281 |
| 285 // Implementation of PPB_FlashFullscreen. | 282 // Implementation of PPB_FlashFullscreen. |
| 286 | 283 |
| 287 // Because going to fullscreen is asynchronous (but going out is not), there | 284 // Because going to fullscreen is asynchronous (but going out is not), there |
| 288 // are 3 states: | 285 // are 3 states: |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 773 // We store the arguments so we can re-send them if we are reset to talk to | 770 // We store the arguments so we can re-send them if we are reset to talk to |
| 774 // NaCl via the IPC NaCl proxy. | 771 // NaCl via the IPC NaCl proxy. |
| 775 std::vector<std::string> argn_; | 772 std::vector<std::string> argn_; |
| 776 std::vector<std::string> argv_; | 773 std::vector<std::string> argv_; |
| 777 | 774 |
| 778 // This is NULL unless HandleDocumentLoad has called. In that case, we store | 775 // This is NULL unless HandleDocumentLoad has called. In that case, we store |
| 779 // the pointer so we can re-send it later if we are reset to talk to NaCl. | 776 // the pointer so we can re-send it later if we are reset to talk to NaCl. |
| 780 scoped_refptr<PPB_URLLoader_Impl> document_loader_; | 777 scoped_refptr<PPB_URLLoader_Impl> document_loader_; |
| 781 | 778 |
| 782 media::DecryptorClient* decryptor_client_; | 779 media::DecryptorClient* decryptor_client_; |
| 780 | |
| 781 // Request ID for tracking pending content decryption callbacks. | |
| 782 // Note that zero indicates an invalid request ID. | |
| 783 // TODO(xhwang): Add completion callbacks for Reset/Stop and remove the use | |
| 784 // of request IDs. | |
| 783 uint32_t next_decryption_request_id_; | 785 uint32_t next_decryption_request_id_; |
| 786 | |
| 787 // TODO(xhwang): Use two separate callbacks for video and audio instead using | |
| 788 // a map here. | |
| 784 typedef std::map<uint32_t, media::Decryptor::DecryptCB> DecryptionCBMap; | 789 typedef std::map<uint32_t, media::Decryptor::DecryptCB> DecryptionCBMap; |
| 785 DecryptionCBMap pending_decryption_cbs_; | 790 DecryptionCBMap pending_decryption_cbs_; |
| 786 | 791 |
| 792 uint32_t pending_video_decoder_init_request_id_; | |
| 793 media::Decryptor::DecoderInitCB pending_video_decoder_init_cb_; | |
| 794 | |
| 795 uint32_t pending_video_decode_request_id_; | |
| 796 media::Decryptor::VideoDecodeCB pending_video_decode_cb_; | |
| 797 | |
| 787 DISALLOW_COPY_AND_ASSIGN(PluginInstance); | 798 DISALLOW_COPY_AND_ASSIGN(PluginInstance); |
| 788 }; | 799 }; |
| 789 | 800 |
| 790 } // namespace ppapi | 801 } // namespace ppapi |
| 791 } // namespace webkit | 802 } // namespace webkit |
| 792 | 803 |
| 793 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ | 804 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ |
| OLD | NEW |