Commit 4a80777b authored by Jean-Paul Saman's avatar Jean-Paul Saman

Forward port of rev 17335. Implement versionInfo() method

parent fc7795f1
......@@ -97,11 +97,46 @@ RuntimeNPObject::InvokeResult LibvlcRootNPObject::getProperty(int index, NPVaria
const NPUTF8 * const LibvlcRootNPObject::methodNames[] =
{
/* no methods */
"versionInfo",
};
const int LibvlcRootNPObject::methodCount = sizeof(LibvlcRootNPObject::methodNames)/sizeof(NPUTF8 *);
enum LibvlcRootNPObjectMethodIds
{
ID_version,
};
RuntimeNPObject::InvokeResult LibvlcRootNPObject::invoke(int index, const NPVariant *args, uint32_t argCount, NPVariant &result)
{
VlcPlugin *p_plugin = reinterpret_cast<VlcPlugin *>(_instance->pdata);
if( p_plugin )
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
switch( index )
{
case ID_version:
if( argCount == 0 )
{
NPUTF8 *versionStr = NULL;
versionStr = strdup( VLC_Version() );
if (!versionStr)
return INVOKERESULT_GENERIC_ERROR;
STRINGZ_TO_NPVARIANT(versionStr, result);
return INVOKERESULT_NO_ERROR;
}
return INVOKERESULT_NO_SUCH_METHOD;
default:
return INVOKERESULT_NO_SUCH_METHOD;
}
}
return INVOKERESULT_GENERIC_ERROR;
}
/*
** implementation of libvlc audio object
*/
......
......@@ -43,6 +43,8 @@ protected:
static const int methodCount;
static const NPUTF8 * const methodNames[];
InvokeResult invoke(int index, const NPVariant *args, uint32_t argCount, NPVariant &result);
NPObject *audioObj;
NPObject *inputObj;
NPObject *logObj;
......
......@@ -177,7 +177,7 @@ int16 NPP_HandleEvent( NPP instance, void * event )
}
const NPWindow *npwindow = p_plugin->getWindow();
if( needsDisplay && npwindow->window )
{
/* draw the beautiful "No Picture" */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment