Commit ff6d1b16 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Implement VersionInfo as property. (Forward port of [17345])

parent 43b5cae7
......@@ -63,6 +63,7 @@ const NPUTF8 * const LibvlcRootNPObject::propertyNames[] =
"input",
"playlist",
"video",
"VersionInfo",
};
const int LibvlcRootNPObject::propertyCount = sizeof(LibvlcRootNPObject::propertyNames)/sizeof(NPUTF8 *);
......@@ -73,6 +74,7 @@ enum LibvlcRootNPObjectPropertyIds
ID_input,
ID_playlist,
ID_video,
ID_VersionInfo,
};
RuntimeNPObject::InvokeResult LibvlcRootNPObject::getProperty(int index, NPVariant &result)
......@@ -91,6 +93,15 @@ RuntimeNPObject::InvokeResult LibvlcRootNPObject::getProperty(int index, NPVaria
case ID_video:
OBJECT_TO_NPVARIANT(NPN_RetainObject(videoObj), result);
return INVOKERESULT_NO_ERROR;
case ID_VersionInfo:
NPUTF8 *versionStr = NULL;
versionStr = strdup( VLC_Version() );
if (!versionStr)
return INVOKERESULT_GENERIC_ERROR;
STRINGZ_TO_NPVARIANT(versionStr, result);
return INVOKERESULT_NO_ERROR;
}
return INVOKERESULT_GENERIC_ERROR;
}
......
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