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

Unified Diff: webkit/plugins/ppapi/ppb_video_decoder_impl.cc

Issue 7065010: Add initialization callback support for Video Decoder PPAPI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix CR comments Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: webkit/plugins/ppapi/ppb_video_decoder_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_video_decoder_impl.cc b/webkit/plugins/ppapi/ppb_video_decoder_impl.cc
index 76edf084db209379bf17774c1c78363fe2f3ac12..7cc37ba0c3b8767904f58a8af139d1a907699f9a 100644
--- a/webkit/plugins/ppapi/ppb_video_decoder_impl.cc
+++ b/webkit/plugins/ppapi/ppb_video_decoder_impl.cc
@@ -44,7 +44,8 @@ PP_Bool GetConfigs(PP_Instance instance_id,
}
PP_Resource Create(PP_Instance instance_id,
- PP_VideoConfigElement* decoder_config) {
+ PP_VideoConfigElement* decoder_config,
+ PP_CompletionCallback callback) {
PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id);
if (!instance)
return 0;
@@ -52,8 +53,10 @@ PP_Resource Create(PP_Instance instance_id,
scoped_refptr<PPB_VideoDecoder_Impl> decoder(
new PPB_VideoDecoder_Impl(instance));
- if (!decoder->Init(const_cast<PP_VideoConfigElement*>(decoder_config)))
+ if (!decoder->Init(
+ const_cast<PP_VideoConfigElement*>(decoder_config), callback)) {
return 0;
+ }
return decoder->GetReference();
}
@@ -212,7 +215,8 @@ bool PPB_VideoDecoder_Impl::GetConfigs(
return true;
}
-bool PPB_VideoDecoder_Impl::Init(PP_VideoConfigElement* decoder_config) {
+bool PPB_VideoDecoder_Impl::Init(PP_VideoConfigElement* decoder_config,
+ PP_CompletionCallback callback) {
if (!instance())
return false;
@@ -224,6 +228,8 @@ bool PPB_VideoDecoder_Impl::Init(PP_VideoConfigElement* decoder_config) {
CopyToConfigList(decoder_config, &copied);
platform_video_decoder_->Initialize(copied);
+ initialization_callback_ = callback;
+
return platform_video_decoder_.get()? true : false;
}
@@ -392,6 +398,15 @@ void PPB_VideoDecoder_Impl::NotifyFlushDone() {
PP_RunCompletionCallback(&callback, PP_OK);
}
+void PPB_VideoDecoder_Impl::NotifyInitializeDone() {
+ if (initialization_callback_.func == NULL)
+ return;
+
+ PP_CompletionCallback callback = PP_BlockUntilComplete();
+ std::swap(callback, initialization_callback_);
+ PP_RunCompletionCallback(&callback, PP_OK);
+}
+
} // namespace ppapi
} // namespace webkit
« ppapi/c/dev/ppb_video_decoder_dev.h ('K') | « webkit/plugins/ppapi/ppb_video_decoder_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698