It will be hard to convince all Mozilla plugins-capable browsers to
call XInitThreads() early enough, if it ever happens. In the mean time,
make sure we use only pure XCB and avoid Xlib in VLC plugins.
Note: I did not check that the web plugins itself was not using Xlib
outside the main Mozilla browser thread.
This should fix#3662. We loose GLX and PulseAudio inside Mozilla.
The old gecko-sdk defines a bunch of types and macros in npupp.h,
which is no longer available in xulrunner-sdk 1.9.2. Luckily,
all of the NPN*UPP types were typedeffed to UniversalProcPtr,
so this change just uses that type, incorporated into the
HOST_TO_PLUGIN_GLUE macro. We also define a new CALL_NPN macro
for choosing to use the CallNPN_*Proc macros from npupp.h or
just invoking the function pointer directly.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
The Mac OS Carbon APIs are not available to 64-bit applications.
This change just ifdefs out calls to them to avoid compiler errors.
In 64-bit, NPP_HandleEvent will have to be rewritten to use the
Cocoa event model.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
These macros were previously defined in mozilla-config.h, but we're
not supposed to include those files according to the mozilla devs.
However, the macros must be defined for npapi.h to define the
necessary platform-specific structures. This patch sets up the
macros before including npapi.h.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
The heap corruption occured when events returned a value. Since the events cross COM boundaries,
the values returned should be allocated in COM context too. Allocating the memory with CoMemTaskAlloc()
should be used instead of new or malloc().
Events that do not originate from within the ActiveX JS context (which is a COM context)
cannot cross into ActiveX/COM context. All events received from libvlc are in a different
thread context then the ActiveX/COM code. Thus from a libvlc event handler callback it is
not possible to call into the ActiveX/COM context.
To solve this issue a seperate thread is created that manages sending of all events for
the ActiveX webplugin (including events from libvlc). All events are by default routed
through the GlobalInterfaceTable (GIT) which takes care ActiveX/COM calls that cross
different thread context in the ActiveX/COM world.
Signed-off-by: Jean-Paul Saman <jean-paul.saman@m2x.nl>