Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: webkit/plugins/ppapi/ppapi_plugin_instance.h

Issue 11091005: Update PluginInstance for decrypt-and-decode video. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: resolve ddorwin's comments Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 // We store the arguments so we can re-send them if we are reset to talk to 771 // We store the arguments so we can re-send them if we are reset to talk to
774 // NaCl via the IPC NaCl proxy. 772 // NaCl via the IPC NaCl proxy.
775 std::vector<std::string> argn_; 773 std::vector<std::string> argn_;
776 std::vector<std::string> argv_; 774 std::vector<std::string> argv_;
777 775
778 // This is NULL unless HandleDocumentLoad has called. In that case, we store 776 // 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. 777 // 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_; 778 scoped_refptr<PPB_URLLoader_Impl> document_loader_;
781 779
782 media::DecryptorClient* decryptor_client_; 780 media::DecryptorClient* decryptor_client_;
781
782 // Request ID for tracking pending content decryption callbacks.
783 // Note that zero indicates an invalid request ID.
784 // TODO(xhwang): Add completion callbacks for Reset/Stop and remove the use
785 // of request IDs.
783 uint32_t next_decryption_request_id_; 786 uint32_t next_decryption_request_id_;
787
788 // TODO(xhwang): Use two separate callbacks for video and audio instead using
789 // a map here.
784 typedef std::map<uint32_t, media::Decryptor::DecryptCB> DecryptionCBMap; 790 typedef std::map<uint32_t, media::Decryptor::DecryptCB> DecryptionCBMap;
785 DecryptionCBMap pending_decryption_cbs_; 791 DecryptionCBMap pending_decryption_cbs_;
786 792
793 uint32_t pending_video_decoder_init_request_id_;
794 media::Decryptor::DecoderInitCB pending_video_decoder_init_cb_;
795
796 uint32_t pending_video_decode_request_id_;
797 media::Decryptor::VideoDecodeCB pending_video_decode_cb_;
798
787 DISALLOW_COPY_AND_ASSIGN(PluginInstance); 799 DISALLOW_COPY_AND_ASSIGN(PluginInstance);
788 }; 800 };
789 801
790 } // namespace ppapi 802 } // namespace ppapi
791 } // namespace webkit 803 } // namespace webkit
792 804
793 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_ 805 #endif // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698