[vlc-devel] [PATCH 1/3] npapi win32: added support of Event Listeners
Sergey Radionov
rsatom at gmail.com
Sat Dec 24 08:31:15 CET 2011
---
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
--
1.7.7.1.msysgit.0
More information about the vlc-devel
mailing list