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

Unified Diff: webkit/plugins/ppapi/content_decryptor_delegate.h

Issue 11411053: Reuse PPB_Buffer_Impl in ContentDecryptorDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: webkit/plugins/ppapi/content_decryptor_delegate.h
diff --git a/webkit/plugins/ppapi/content_decryptor_delegate.h b/webkit/plugins/ppapi/content_decryptor_delegate.h
index 5b7d1a5daeac538ba7eb38dccbc9e2010182de13..c4b24f26b8c8161cc0b85871049a8e79c0f3f43b 100644
--- a/webkit/plugins/ppapi/content_decryptor_delegate.h
+++ b/webkit/plugins/ppapi/content_decryptor_delegate.h
@@ -13,6 +13,7 @@
#include "media/base/decryptor.h"
#include "ppapi/c/private/pp_content_decryptor.h"
#include "ppapi/c/private/ppp_content_decryptor_private.h"
+#include "ppapi/shared_impl/scoped_pp_resource.h"
#include "webkit/plugins/webkit_plugins_export.h"
namespace media {
@@ -97,6 +98,18 @@ class WEBKIT_PLUGINS_EXPORT ContentDecryptorDelegate {
// Cancels the pending decrypt-and-decode callback for |stream_type|.
void CancelDecode(media::Decryptor::StreamType stream_type);
+ // Fills |resource| with a PP_Resource containing a PPB_Buffer_Impl and
+ // copies |data| into the buffer resource. This method reuses
ddorwin 2012/11/17 02:07:38 Why "create" and copy in a single function? First,
xhwang 2012/11/18 00:10:33 This memcpy is for input, which is usually small.
+ // |audio_input_resource_| and |video_input_resource_| to reduce the latency
+ // in requesting new PPB_Buffer_Impl resources. The caller must make sure that
+ // |audio_input_resource_| or |video_input_resource_| is available before
+ // calling this method.
+ // If |data| is NULL, fills |resource| with a PP_Resource with ID of 0.
+ // Returns true upon success and false if any error happened.
+ bool MakeMediaBufferResource(media::Decryptor::StreamType stream_type,
+ const uint8* data, int size,
+ ::ppapi::ScopedPPResource* resource);
+
const PP_Instance pp_instance_;
const PPP_ContentDecryptor_Private* const plugin_decryption_interface_;
@@ -126,6 +139,12 @@ class WEBKIT_PLUGINS_EXPORT ContentDecryptorDelegate {
uint32_t pending_video_decode_request_id_;
media::Decryptor::VideoDecodeCB pending_video_decode_cb_;
+ // ScopedPPResource for audio and video input buffers.
ddorwin 2012/11/17 02:07:38 Maybe add // See MakeMediaBufferResource. for an
xhwang 2012/11/18 00:10:33 Done.
+ ::ppapi::ScopedPPResource audio_input_resource_;
+ int audio_input_resource_size_;
+ ::ppapi::ScopedPPResource video_input_resource_;
+ int video_input_resource_size_;
+
DISALLOW_COPY_AND_ASSIGN(ContentDecryptorDelegate);
};
« no previous file with comments | « no previous file | webkit/plugins/ppapi/content_decryptor_delegate.cc » ('j') | webkit/plugins/ppapi/content_decryptor_delegate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698