*/\r
if( isValid() )\r
{\r
- if( audioObj ) NPN_ReleaseObject(audioObj);\r
- if( inputObj ) NPN_ReleaseObject(inputObj);\r
- if( logObj ) NPN_ReleaseObject(logObj);\r
- if( playlistObj ) NPN_ReleaseObject(playlistObj);\r
- if( videoObj ) NPN_ReleaseObject(videoObj);\r
+ if( audioObj ) NPN_ReleaseObject(audioObj);\r
+ if( inputObj ) NPN_ReleaseObject(inputObj);\r
+ if( logObj ) NPN_ReleaseObject(logObj);\r
+ if( playlistObj ) NPN_ReleaseObject(playlistObj);\r
+ if( videoObj ) NPN_ReleaseObject(videoObj);\r
}\r
}\r
\r
switch( index )\r
{\r
case ID_root_audio:\r
- // create child object in lazyman fashion to avoid ownership problem with firefox\r
- if( audioObj )\r
- NPN_RetainObject(audioObj);\r
- else\r
- audioObj = NPN_CreateObject(_instance, RuntimeNPClass<LibvlcAudioNPObject>::getClass());\r
- OBJECT_TO_NPVARIANT(audioObj, result);\r
+ // create child object in lazyman fashion to avoid ownership problem with firefox\r
+ if( ! audioObj )\r
+ audioObj = NPN_CreateObject(_instance, RuntimeNPClass<LibvlcAudioNPObject>::getClass());\r
+ OBJECT_TO_NPVARIANT(NPN_RetainObject(audioObj), result);\r
return INVOKERESULT_NO_ERROR;\r
case ID_root_input:\r
- // create child object in lazyman fashion to avoid ownership problem with firefox\r
- if( inputObj )\r
- NPN_RetainObject(inputObj);\r
- else\r
- inputObj = NPN_CreateObject(_instance, RuntimeNPClass<LibvlcInputNPObject>::getClass());\r
- OBJECT_TO_NPVARIANT(inputObj, result);\r
+ // create child object in lazyman fashion to avoid ownership problem with firefox\r
+ if( ! inputObj )\r
+ inputObj = NPN_CreateObject(_instance, RuntimeNPClass<LibvlcInputNPObject>::getClass());\r
+ OBJECT_TO_NPVARIANT(NPN_RetainObject(inputObj), result);\r
return INVOKERESULT_NO_ERROR;\r
case ID_root_log:\r
- // create child object in lazyman fashion to avoid ownership problem with firefox\r
- if( logObj )\r
- NPN_RetainObject(logObj);\r
- else\r
- logObj = NPN_CreateObject(_instance, RuntimeNPClass<LibvlcLogNPObject>::getClass());\r
- OBJECT_TO_NPVARIANT(logObj, result);\r
+ // create child object in lazyman fashion to avoid ownership problem with firefox\r
+ if( ! logObj )\r
+ logObj = NPN_CreateObject(_instance, RuntimeNPClass<LibvlcLogNPObject>::getClass());\r
+ OBJECT_TO_NPVARIANT(NPN_RetainObject(logObj), result);\r
return INVOKERESULT_NO_ERROR;\r
case ID_root_playlist:\r
- // create child object in lazyman fashion to avoid ownership problem with firefox\r
- if( playlistObj )\r
- NPN_RetainObject(playlistObj);\r
- else\r
- playlistObj = NPN_CreateObject(_instance, RuntimeNPClass<LibvlcPlaylistNPObject>::getClass());\r
- OBJECT_TO_NPVARIANT(playlistObj, result);\r
+ // create child object in lazyman fashion to avoid ownership problem with firefox\r
+ if( ! playlistObj )\r
+ playlistObj = NPN_CreateObject(_instance, RuntimeNPClass<LibvlcPlaylistNPObject>::getClass());\r
+ OBJECT_TO_NPVARIANT(NPN_RetainObject(playlistObj), result);\r
return INVOKERESULT_NO_ERROR;\r
case ID_root_video:\r
- // create child object in lazyman fashion to avoid ownership problem with firefox\r
- if( videoObj )\r
- NPN_RetainObject(videoObj);\r
- else\r
- videoObj = NPN_CreateObject(_instance,RuntimeNPClass<LibvlcVideoNPObject>::getClass());\r
- OBJECT_TO_NPVARIANT(videoObj, result);\r
+ // create child object in lazyman fashion to avoid ownership problem with firefox\r
+ if( ! videoObj )\r
+ videoObj = NPN_CreateObject(_instance,RuntimeNPClass<LibvlcVideoNPObject>::getClass());\r
+ OBJECT_TO_NPVARIANT(NPN_RetainObject(videoObj), result);\r
return INVOKERESULT_NO_ERROR;\r
case ID_root_VersionInfo:\r
{\r
}\r
case ID_audio_track:\r
{\r
- libvlc_input_t *p_input = libvlc_playlist_get_input(p_plugin->getVLC(), &ex);\r
+ libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
libvlc_exception_clear(&ex);\r
return INVOKERESULT_GENERIC_ERROR;\r
}\r
- int track = libvlc_audio_get_track(p_input, &ex);\r
- libvlc_input_free(p_input);\r
+ int track = libvlc_audio_get_track(p_md, &ex);\r
+ libvlc_media_instance_release(p_md);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
case ID_audio_track:\r
if( isNumberValue(value) )\r
{\r
- libvlc_input_t *p_input = libvlc_playlist_get_input(p_plugin->getVLC(), &ex);\r
+ libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
libvlc_exception_clear(&ex);\r
return INVOKERESULT_GENERIC_ERROR;\r
}\r
- libvlc_audio_set_track(p_input,\r
+ libvlc_audio_set_track(p_md,\r
numberValue(value), &ex);\r
- libvlc_input_free(p_input);\r
+ libvlc_media_instance_release(p_md);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
libvlc_exception_t ex;\r
libvlc_exception_init(&ex);\r
\r
- libvlc_input_t *p_input = libvlc_playlist_get_input(p_plugin->getVLC(), &ex);\r
+ libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);\r
if( libvlc_exception_raised(&ex) )\r
{\r
if( index != ID_input_state )\r
{\r
case ID_input_length:\r
{\r
- double val = (double)libvlc_input_get_length(p_input, &ex);\r
- libvlc_input_free(p_input);\r
+ double val = (double)libvlc_media_instance_get_length(p_md, &ex);\r
+ libvlc_media_instance_release(p_md);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
}\r
case ID_input_position:\r
{\r
- double val = libvlc_input_get_position(p_input, &ex);\r
- libvlc_input_free(p_input);\r
+ double val = libvlc_media_instance_get_position(p_md, &ex);\r
+ libvlc_media_instance_release(p_md);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
}\r
case ID_input_time:\r
{\r
- double val = (double)libvlc_input_get_time(p_input, &ex);\r
- libvlc_input_free(p_input);\r
+ double val = (double)libvlc_media_instance_get_time(p_md, &ex);\r
+ libvlc_media_instance_release(p_md);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
}\r
case ID_input_state:\r
{\r
- int val = libvlc_input_get_state(p_input, &ex);\r
- libvlc_input_free(p_input);\r
+ int val = libvlc_media_instance_get_state(p_md, &ex);\r
+ libvlc_media_instance_release(p_md);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
}\r
case ID_input_rate:\r
{\r
- float val = libvlc_input_get_rate(p_input, &ex);\r
- libvlc_input_free(p_input);\r
+ float val = libvlc_media_instance_get_rate(p_md, &ex);\r
+ libvlc_media_instance_release(p_md);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
}\r
case ID_input_fps:\r
{\r
- double val = libvlc_input_get_fps(p_input, &ex);\r
- libvlc_input_free(p_input);\r
+ double val = libvlc_media_instance_get_fps(p_md, &ex);\r
+ libvlc_media_instance_release(p_md);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
}\r
case ID_input_hasvout:\r
{\r
- vlc_bool_t val = libvlc_input_has_vout(p_input, &ex);\r
- libvlc_input_free(p_input);\r
+ vlc_bool_t val = libvlc_media_instance_has_vout(p_md, &ex);\r
+ libvlc_media_instance_release(p_md);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
default:\r
;\r
}\r
- libvlc_input_free(p_input);\r
+ libvlc_media_instance_release(p_md);\r
}\r
return INVOKERESULT_GENERIC_ERROR;\r
}\r
libvlc_exception_t ex;\r
libvlc_exception_init(&ex);\r
\r
- libvlc_input_t *p_input = libvlc_playlist_get_input(p_plugin->getVLC(), &ex);\r
+ libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
{\r
if( ! NPVARIANT_IS_DOUBLE(value) )\r
{\r
- libvlc_input_free(p_input);\r
+ libvlc_media_instance_release(p_md);\r
return INVOKERESULT_INVALID_VALUE;\r
}\r
\r
float val = (float)NPVARIANT_TO_DOUBLE(value);\r
- libvlc_input_set_position(p_input, val, &ex);\r
- libvlc_input_free(p_input);\r
+ libvlc_media_instance_set_position(p_md, val, &ex);\r
+ libvlc_media_instance_release(p_md);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
val = (vlc_int64_t)NPVARIANT_TO_DOUBLE(value);\r
else\r
{\r
- libvlc_input_free(p_input);\r
+ libvlc_media_instance_release(p_md);\r
return INVOKERESULT_INVALID_VALUE;\r
}\r
\r
- libvlc_input_set_time(p_input, val, &ex);\r
- libvlc_input_free(p_input);\r
+ libvlc_media_instance_set_time(p_md, val, &ex);\r
+ libvlc_media_instance_release(p_md);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
val = (float)NPVARIANT_TO_DOUBLE(value);\r
else\r
{\r
- libvlc_input_free(p_input);\r
+ libvlc_media_instance_release(p_md);\r
return INVOKERESULT_INVALID_VALUE;\r
}\r
\r
- libvlc_input_set_rate(p_input, val, &ex);\r
- libvlc_input_free(p_input);\r
+ libvlc_media_instance_set_rate(p_md, val, &ex);\r
+ libvlc_media_instance_release(p_md);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
default:\r
;\r
}\r
- libvlc_input_free(p_input);\r
+ libvlc_media_instance_release(p_md);\r
}\r
return INVOKERESULT_GENERIC_ERROR;\r
}\r
{\r
if( isValid() )\r
{\r
- if( messagesObj ) NPN_ReleaseObject(messagesObj);\r
+ if( messagesObj ) NPN_ReleaseObject(messagesObj);\r
}\r
};\r
\r
{\r
case ID_log_messages:\r
{\r
- // create child object in lazyman fashion to avoid ownership problem with firefox\r
- if( messagesObj )\r
- NPN_RetainObject(messagesObj);\r
- else\r
- messagesObj = NPN_CreateObject(_instance, RuntimeNPClass<LibvlcMessagesNPObject>::getClass());\r
- OBJECT_TO_NPVARIANT(messagesObj, result);\r
+ // create child object in lazyman fashion to avoid ownership problem with firefox\r
+ if( ! messagesObj )\r
+ messagesObj = NPN_CreateObject(_instance, RuntimeNPClass<LibvlcMessagesNPObject>::getClass());\r
+ OBJECT_TO_NPVARIANT(NPN_RetainObject(messagesObj), result);\r
return INVOKERESULT_NO_ERROR;\r
}\r
case ID_log_verbosity:\r
{\r
if( isValid() )\r
{\r
- if( playlistItemsObj ) NPN_ReleaseObject(playlistItemsObj);\r
+ if( playlistItemsObj ) NPN_ReleaseObject(playlistItemsObj);\r
}\r
};\r
\r
}\r
case ID_playlist_items:\r
{\r
- // create child object in lazyman fashion to avoid ownership problem with firefox\r
- if( playlistItemsObj )\r
- NPN_RetainObject(playlistItemsObj);\r
- else\r
- playlistItemsObj = NPN_CreateObject(_instance, RuntimeNPClass<LibvlcPlaylistItemsNPObject>::getClass());\r
- OBJECT_TO_NPVARIANT(playlistItemsObj, result);\r
+ // create child object in lazyman fashion to avoid ownership problem with firefox\r
+ if( ! playlistItemsObj )\r
+ playlistItemsObj = NPN_CreateObject(_instance, RuntimeNPClass<LibvlcPlaylistItemsNPObject>::getClass());\r
+ OBJECT_TO_NPVARIANT(NPN_RetainObject(playlistItemsObj), result);\r
return INVOKERESULT_NO_ERROR;\r
}\r
default:\r
return INVOKERESULT_GENERIC_ERROR;\r
}\r
\r
-void LibvlcPlaylistNPObject::parseOptions(const NPString &s, int *i_options, char*** ppsz_options)\r
+void LibvlcPlaylistNPObject::parseOptions(const NPString &nps, int *i_options, char*** ppsz_options)\r
{\r
- if( s.utf8length )\r
+ if( nps.utf8length )\r
{\r
- char *val = stringValue(s);\r
+ char *s = stringValue(nps);\r
+ char *val = s;\r
if( val )\r
{\r
long capacity = 16;\r
{\r
int nOptions = 0;\r
\r
- char *end = val + s.utf8length;\r
+ char *end = val + nps.utf8length;\r
while( val < end )\r
{\r
// skip leading blanks\r
if( ! moreOptions )\r
{\r
/* failed to allocate more memory */\r
- delete val;\r
+ delete s;\r
/* return what we got so far */\r
*i_options = nOptions;\r
*ppsz_options = options;\r
- break;\r
+ return;\r
}\r
options = moreOptions;\r
}\r
*i_options = nOptions;\r
*ppsz_options = options;\r
}\r
- delete val;\r
+ delete s;\r
}\r
}\r
}\r
"width",\r
"aspectRatio",\r
"subtitle",\r
- "crop"\r
+ "crop",\r
+ "teletext"\r
};\r
\r
enum LibvlcVideoNPObjectPropertyIds\r
ID_video_width,\r
ID_video_aspectratio,\r
ID_video_subtitle,\r
- ID_video_crop\r
+ ID_video_crop,\r
+ ID_video_teletext\r
};\r
\r
const int LibvlcVideoNPObject::propertyCount = sizeof(LibvlcVideoNPObject::propertyNames)/sizeof(NPUTF8 *);\r
libvlc_exception_t ex;\r
libvlc_exception_init(&ex);\r
\r
- libvlc_input_t *p_input = libvlc_playlist_get_input(p_plugin->getVLC(), &ex);\r
+ libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
{\r
case ID_video_fullscreen:\r
{\r
- int val = libvlc_get_fullscreen(p_input, &ex);\r
- libvlc_input_free(p_input);\r
+ int val = libvlc_get_fullscreen(p_md, &ex);\r
+ libvlc_media_instance_release(p_md);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
}\r
case ID_video_height:\r
{\r
- int val = libvlc_video_get_height(p_input, &ex);\r
- libvlc_input_free(p_input);\r
+ int val = libvlc_video_get_height(p_md, &ex);\r
+ libvlc_media_instance_release(p_md);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
}\r
case ID_video_width:\r
{\r
- int val = libvlc_video_get_width(p_input, &ex);\r
- libvlc_input_free(p_input);\r
+ int val = libvlc_video_get_width(p_md, &ex);\r
+ libvlc_media_instance_release(p_md);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
}\r
case ID_video_aspectratio:\r
{\r
- NPUTF8 *psz_aspect = libvlc_video_get_aspect_ratio(p_input, &ex);\r
- libvlc_input_free(p_input);\r
+ NPUTF8 *psz_aspect = libvlc_video_get_aspect_ratio(p_md, &ex);\r
+ libvlc_media_instance_release(p_md);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
}\r
case ID_video_subtitle:\r
{\r
- int i_spu = libvlc_video_get_spu(p_input, &ex);\r
- libvlc_input_free(p_input);\r
+ int i_spu = libvlc_video_get_spu(p_md, &ex);\r
+ libvlc_media_instance_release(p_md);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
}\r
case ID_video_crop:\r
{\r
- NPUTF8 *psz_geometry = libvlc_video_get_crop_geometry(p_input, &ex);\r
- libvlc_input_free(p_input);\r
+ NPUTF8 *psz_geometry = libvlc_video_get_crop_geometry(p_md, &ex);\r
+ libvlc_media_instance_release(p_md);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
STRINGZ_TO_NPVARIANT(psz_geometry, result);\r
return INVOKERESULT_NO_ERROR;\r
}\r
+ case ID_video_teletext:\r
+ {\r
+ int i_page = libvlc_video_get_teletext(p_md, &ex);\r
+ libvlc_media_instance_release(p_md);\r
+ if( libvlc_exception_raised(&ex) )\r
+ {\r
+ NPN_SetException(this, libvlc_exception_get_message(&ex));\r
+ libvlc_exception_clear(&ex);\r
+ return INVOKERESULT_GENERIC_ERROR;\r
+ }\r
+ INT32_TO_NPVARIANT(i_page, result);\r
+ return INVOKERESULT_NO_ERROR;\r
+ }\r
}\r
- libvlc_input_free(p_input);\r
+ libvlc_media_instance_release(p_md);\r
}\r
return INVOKERESULT_GENERIC_ERROR;\r
}\r
libvlc_exception_t ex;\r
libvlc_exception_init(&ex);\r
\r
- libvlc_input_t *p_input = libvlc_playlist_get_input(p_plugin->getVLC(), &ex);\r
+ libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
{\r
if( ! NPVARIANT_IS_BOOLEAN(value) )\r
{\r
- libvlc_input_free(p_input);\r
+ libvlc_media_instance_release(p_md);\r
return INVOKERESULT_INVALID_VALUE;\r
}\r
\r
int val = NPVARIANT_TO_BOOLEAN(value);\r
- libvlc_set_fullscreen(p_input, val, &ex);\r
- libvlc_input_free(p_input);\r
+ libvlc_set_fullscreen(p_md, val, &ex);\r
+ libvlc_media_instance_release(p_md);\r
\r
if( libvlc_exception_raised(&ex) )\r
{\r
\r
if( ! NPVARIANT_IS_STRING(value) )\r
{\r
- libvlc_input_free(p_input);\r
+ libvlc_media_instance_release(p_md);\r
return INVOKERESULT_INVALID_VALUE;\r
}\r
\r
psz_aspect = stringValue(NPVARIANT_TO_STRING(value));\r
if( !psz_aspect )\r
{\r
- libvlc_input_free(p_input);\r
+ libvlc_media_instance_release(p_md);\r
return INVOKERESULT_GENERIC_ERROR;\r
}\r
\r
- libvlc_video_set_aspect_ratio(p_input, psz_aspect, &ex);\r
+ libvlc_video_set_aspect_ratio(p_md, psz_aspect, &ex);\r
delete psz_aspect;\r
- libvlc_input_free(p_input);\r
+ libvlc_media_instance_release(p_md);\r
\r
if( libvlc_exception_raised(&ex) )\r
{\r
{\r
if( isNumberValue(value) )\r
{\r
- libvlc_video_set_spu(p_input,\r
+ libvlc_video_set_spu(p_md,\r
numberValue(value), &ex);\r
- libvlc_input_free(p_input);\r
+ libvlc_media_instance_release(p_md);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
}\r
return INVOKERESULT_NO_ERROR;\r
}\r
- libvlc_input_free(p_input);\r
+ libvlc_media_instance_release(p_md);\r
return INVOKERESULT_INVALID_VALUE;\r
}\r
case ID_video_crop:\r
\r
if( ! NPVARIANT_IS_STRING(value) )\r
{\r
- libvlc_input_free(p_input);\r
+ libvlc_media_instance_release(p_md);\r
return INVOKERESULT_INVALID_VALUE;\r
}\r
\r
psz_geometry = stringValue(NPVARIANT_TO_STRING(value));\r
if( !psz_geometry )\r
{\r
- libvlc_input_free(p_input);\r
+ libvlc_media_instance_release(p_md);\r
return INVOKERESULT_GENERIC_ERROR;\r
}\r
\r
- libvlc_video_set_crop_geometry(p_input, psz_geometry, &ex);\r
+ libvlc_video_set_crop_geometry(p_md, psz_geometry, &ex);\r
delete psz_geometry;\r
- libvlc_input_free(p_input);\r
+ libvlc_media_instance_release(p_md);\r
\r
if( libvlc_exception_raised(&ex) )\r
{\r
}\r
return INVOKERESULT_NO_ERROR;\r
}\r
+ case ID_video_teletext:\r
+ {\r
+ if( isNumberValue(value) )\r
+ {\r
+ libvlc_video_set_teletext(p_md,\r
+ numberValue(value), &ex);\r
+ libvlc_media_instance_release(p_md);\r
+ if( libvlc_exception_raised(&ex) )\r
+ {\r
+ NPN_SetException(this, libvlc_exception_get_message(&ex));\r
+ libvlc_exception_clear(&ex);\r
+ return INVOKERESULT_GENERIC_ERROR;\r
+ }\r
+ return INVOKERESULT_NO_ERROR;\r
+ }\r
+ libvlc_media_instance_release(p_md);\r
+ return INVOKERESULT_INVALID_VALUE;\r
+ }\r
}\r
- libvlc_input_free(p_input);\r
+ libvlc_media_instance_release(p_md);\r
}\r
return INVOKERESULT_GENERIC_ERROR;\r
}\r
const NPUTF8 * const LibvlcVideoNPObject::methodNames[] =\r
{\r
"toggleFullscreen",\r
+ "toggleTeletext"\r
};\r
\r
enum LibvlcVideoNPObjectMethodIds\r
{\r
ID_video_togglefullscreen,\r
+ ID_video_toggleteletext\r
};\r
\r
const int LibvlcVideoNPObject::methodCount = sizeof(LibvlcVideoNPObject::methodNames)/sizeof(NPUTF8 *);\r
libvlc_exception_t ex;\r
libvlc_exception_init(&ex);\r
\r
- libvlc_input_t *p_input = libvlc_playlist_get_input(p_plugin->getVLC(), &ex);\r
+ libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
case ID_video_togglefullscreen:\r
if( argCount == 0 )\r
{\r
- libvlc_toggle_fullscreen(p_input, &ex);\r
- libvlc_input_free(p_input);\r
+ libvlc_toggle_fullscreen(p_md, &ex);\r
+ libvlc_media_instance_release(p_md);\r
+ if( libvlc_exception_raised(&ex) )\r
+ {\r
+ NPN_SetException(this, libvlc_exception_get_message(&ex));\r
+ libvlc_exception_clear(&ex);\r
+ return INVOKERESULT_GENERIC_ERROR;\r
+ }\r
+ else\r
+ {\r
+ VOID_TO_NPVARIANT(result);\r
+ return INVOKERESULT_NO_ERROR;\r
+ }\r
+ }\r
+ else\r
+ {\r
+ /* cannot get md, probably not playing */\r
+ if( libvlc_exception_raised(&ex) )\r
+ {\r
+ NPN_SetException(this, libvlc_exception_get_message(&ex));\r
+ libvlc_exception_clear(&ex);\r
+ }\r
+ return INVOKERESULT_GENERIC_ERROR;\r
+ }\r
+ return INVOKERESULT_NO_SUCH_METHOD;\r
+ case ID_video_toggleteletext:\r
+ if( argCount == 0 )\r
+ {\r
+ libvlc_toggle_teletext(p_md, &ex);\r
+ libvlc_media_instance_release(p_md);\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r
}\r
else\r
{\r
- /* cannot get input, probably not playing */\r
+ /* cannot get md, probably not playing */\r
if( libvlc_exception_raised(&ex) )\r
{\r
NPN_SetException(this, libvlc_exception_get_message(&ex));\r