[vlc-commits] npapi win32: added support of Event Listeners

Sergey Radionov git at videolan.org
Sat Dec 24 14:40:05 CET 2011


npapi-vlc | branch: master | Sergey Radionov <RSATom at gmail.com> | Sat Dec 24 14:04:29 2011 +0700| [46634a5c1d72d7d06c5af6dfa7afd423950b4d9d] | committer: Jean-Baptiste Kempf

npapi win32: added support of Event Listeners

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=46634a5c1d72d7d06c5af6dfa7afd423950b4d9d
---

 npapi/support/npwin.cpp  |    7 +++++++
 npapi/vlcplugin_base.cpp |    2 +-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/npapi/support/npwin.cpp b/npapi/support/npwin.cpp
index a189cc1..d3fa906 100644
--- a/npapi/support/npwin.cpp
+++ b/npapi/support/npwin.cpp
@@ -212,6 +212,13 @@ void NPN_Version(int* plugin_major, int* plugin_minor, int* netscape_major, int*
     *netscape_minor = LOBYTE(g_pNavigatorFuncs->version);
 }
 
+void NPN_PluginThreadAsyncCall(NPP plugin, void (*func)(void *), void *userData)
+{
+#if (((NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR) >= 20)
+    (g_pNavigatorFuncs->pluginthreadasynccall)(plugin, func, userData);
+#endif
+}
+
 NPError NPN_GetValue(NPP instance, NPNVariable variable, void *result)
 {
     return g_pNavigatorFuncs->getvalue(instance, variable, result);
diff --git a/npapi/vlcplugin_base.cpp b/npapi/vlcplugin_base.cpp
index bd6db07..c100583 100644
--- a/npapi/vlcplugin_base.cpp
+++ b/npapi/vlcplugin_base.cpp
@@ -375,7 +375,7 @@ void VlcPluginBase::eventAsync(void *param)
 void VlcPluginBase::event_callback(const libvlc_event_t* event,
                 NPVariant *npparams, uint32_t npcount)
 {
-#ifdef XP_UNIX
+#if defined(XP_UNIX) || defined(XP_WIN)
     events.callback(event, npparams, npcount);
     NPN_PluginThreadAsyncCall(getBrowser(), eventAsync, this);
 #else



More information about the vlc-commits mailing list