Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
ec077666
Commit
ec077666
authored
Dec 07, 2006
by
damienf
Browse files
mozilla: backporting from 0.8.6
parent
fc9b8e56
Changes
10
Hide whitespace changes
Inline
Side-by-side
mozilla/Makefile.am
View file @
ec077666
...
...
@@ -6,7 +6,7 @@ noinst_LIBRARIES = $(noinst_LIBRARIES_mozilla)
MOSTLYCLEANFILES
=
$(npvlc_DATA)
CLEANFILES
=
stamp-pic
$(BUILT_SOURCES)
EXTRA_DIST
=
$(DIST_sources)
npvlc_rc.rc vlc.r
EXTRA_DIST
=
$(DIST_sources)
install.js
npvlc_rc.rc vlc.r
SOURCES_mozilla_common
=
\
vlcshell.cpp
\
...
...
mozilla/control/npolibvlc.cpp
View file @
ec077666
...
...
@@ -61,6 +61,7 @@ const NPUTF8 * const LibvlcRootNPObject::propertyNames[] =
{
"audio"
,
"input"
,
"log"
,
"playlist"
,
"video"
,
"VersionInfo"
,
...
...
@@ -70,38 +71,54 @@ const int LibvlcRootNPObject::propertyCount = sizeof(LibvlcRootNPObject::propert
enum
LibvlcRootNPObjectPropertyIds
{
ID_audio
=
0
,
ID_input
,
ID_playlist
,
ID_video
,
ID_VersionInfo
,
ID_root_audio
=
0
,
ID_root_input
,
ID_root_log
,
ID_root_playlist
,
ID_root_video
,
ID_root_VersionInfo
,
};
RuntimeNPObject
::
InvokeResult
LibvlcRootNPObject
::
getProperty
(
int
index
,
NPVariant
&
result
)
{
switch
(
index
)
VlcPlugin
*
p_plugin
=
reinterpret_cast
<
VlcPlugin
*>
(
_instance
->
pdata
);
if
(
p_plugin
)
{
case
ID_audio
:
OBJECT_TO_NPVARIANT
(
NPN_RetainObject
(
audioObj
),
result
);
return
INVOKERESULT_NO_ERROR
;
case
ID_input
:
OBJECT_TO_NPVARIANT
(
NPN_RetainObject
(
inputObj
),
result
);
return
INVOKERESULT_NO_ERROR
;
case
ID_playlist
:
OBJECT_TO_NPVARIANT
(
NPN_RetainObject
(
playlistObj
),
result
);
return
INVOKERESULT_NO_ERROR
;
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
;
switch
(
index
)
{
case
ID_root_audio
:
OBJECT_TO_NPVARIANT
(
NPN_RetainObject
(
audioObj
),
result
);
return
INVOKERESULT_NO_ERROR
;
case
ID_root_input
:
OBJECT_TO_NPVARIANT
(
NPN_RetainObject
(
inputObj
),
result
);
return
INVOKERESULT_NO_ERROR
;
case
ID_root_log
:
OBJECT_TO_NPVARIANT
(
NPN_RetainObject
(
logObj
),
result
);
return
INVOKERESULT_NO_ERROR
;
case
ID_root_playlist
:
OBJECT_TO_NPVARIANT
(
NPN_RetainObject
(
playlistObj
),
result
);
return
INVOKERESULT_NO_ERROR
;
case
ID_root_video
:
OBJECT_TO_NPVARIANT
(
NPN_RetainObject
(
videoObj
),
result
);
return
INVOKERESULT_NO_ERROR
;
case
ID_root_VersionInfo
:
{
int
len
=
strlen
(
VLC_Version
());
NPUTF8
*
retval
=
(
NPUTF8
*
)
NPN_MemAlloc
(
len
);
if
(
retval
)
{
memcpy
(
retval
,
VLC_Version
(),
len
);
STRINGN_TO_NPVARIANT
(
retval
,
len
,
result
);
}
else
{
NULL_TO_NPVARIANT
(
result
);
}
return
INVOKERESULT_NO_ERROR
;
}
default:
;
}
}
return
INVOKERESULT_GENERIC_ERROR
;
}
...
...
@@ -115,7 +132,7 @@ const int LibvlcRootNPObject::methodCount = sizeof(LibvlcRootNPObject::methodNam
enum
LibvlcRootNPObjectMethodIds
{
ID_version
,
ID_
root_
version
Info
,
};
RuntimeNPObject
::
InvokeResult
LibvlcRootNPObject
::
invoke
(
int
index
,
const
NPVariant
*
args
,
uint32_t
argCount
,
NPVariant
&
result
)
...
...
@@ -128,21 +145,25 @@ RuntimeNPObject::InvokeResult LibvlcRootNPObject::invoke(int index, const NPVari
switch
(
index
)
{
case
ID_version
:
case
ID_
root_
version
Info
:
if
(
argCount
==
0
)
{
NPUTF8
*
versionStr
=
NULL
;
versionStr
=
strdup
(
VLC_Version
()
);
if
(
!
versionStr
)
return
INVOKERESULT_GENERIC_ERROR
;
STRINGZ_TO_NPVARIANT
(
versionStr
,
result
);
int
len
=
strlen
(
VLC_Version
());
NPUTF8
*
retval
=
(
NPUTF8
*
)
NPN_MemAlloc
(
len
);
if
(
retval
)
{
memcpy
(
retval
,
VLC_Version
(),
len
);
STRINGN_TO_NPVARIANT
(
retval
,
len
,
result
);
}
else
{
NULL_TO_NPVARIANT
(
result
);
}
return
INVOKERESULT_NO_ERROR
;
}
return
INVOKERESULT_NO_SUCH_METHOD
;
default:
return
INVOKERESULT_NO_SUCH_METHOD
;
;
}
}
return
INVOKERESULT_GENERIC_ERROR
;
...
...
@@ -162,8 +183,8 @@ const int LibvlcAudioNPObject::propertyCount = sizeof(LibvlcAudioNPObject::prope
enum
LibvlcAudioNPObjectPropertyIds
{
ID_mute
,
ID_volume
,
ID_
audio_
mute
,
ID_
audio_
volume
,
};
RuntimeNPObject
::
InvokeResult
LibvlcAudioNPObject
::
getProperty
(
int
index
,
NPVariant
&
result
)
...
...
@@ -176,7 +197,7 @@ RuntimeNPObject::InvokeResult LibvlcAudioNPObject::getProperty(int index, NPVari
switch
(
index
)
{
case
ID_mute
:
case
ID_
audio_
mute
:
{
vlc_bool_t
muted
=
libvlc_audio_get_mute
(
p_plugin
->
getVLC
(),
&
ex
);
if
(
libvlc_exception_raised
(
&
ex
)
)
...
...
@@ -188,7 +209,7 @@ RuntimeNPObject::InvokeResult LibvlcAudioNPObject::getProperty(int index, NPVari
BOOLEAN_TO_NPVARIANT
(
muted
,
result
);
return
INVOKERESULT_NO_ERROR
;
}
case
ID_volume
:
case
ID_
audio_
volume
:
{
int
volume
=
libvlc_audio_get_volume
(
p_plugin
->
getVLC
(),
&
ex
);
if
(
libvlc_exception_raised
(
&
ex
)
)
...
...
@@ -200,6 +221,8 @@ RuntimeNPObject::InvokeResult LibvlcAudioNPObject::getProperty(int index, NPVari
INT32_TO_NPVARIANT
(
volume
,
result
);
return
INVOKERESULT_NO_ERROR
;
}
default:
;
}
}
return
INVOKERESULT_GENERIC_ERROR
;
...
...
@@ -215,7 +238,7 @@ RuntimeNPObject::InvokeResult LibvlcAudioNPObject::setProperty(int index, const
switch
(
index
)
{
case
ID_mute
:
case
ID_
audio_
mute
:
if
(
NPVARIANT_IS_BOOLEAN
(
value
)
)
{
libvlc_audio_set_mute
(
p_plugin
->
getVLC
(),
...
...
@@ -229,7 +252,7 @@ RuntimeNPObject::InvokeResult LibvlcAudioNPObject::setProperty(int index, const
return
INVOKERESULT_NO_ERROR
;
}
return
INVOKERESULT_INVALID_VALUE
;
case
ID_volume
:
case
ID_
audio_
volume
:
if
(
isNumberValue
(
value
)
)
{
libvlc_audio_set_volume
(
p_plugin
->
getVLC
(),
...
...
@@ -243,6 +266,8 @@ RuntimeNPObject::InvokeResult LibvlcAudioNPObject::setProperty(int index, const
return
INVOKERESULT_NO_ERROR
;
}
return
INVOKERESULT_INVALID_VALUE
;
default:
;
}
}
return
INVOKERESULT_GENERIC_ERROR
;
...
...
@@ -257,7 +282,7 @@ const int LibvlcAudioNPObject::methodCount = sizeof(LibvlcAudioNPObject::methodN
enum
LibvlcAudioNPObjectMethodIds
{
ID_togglemute
,
ID_
audio_
togglemute
,
};
RuntimeNPObject
::
InvokeResult
LibvlcAudioNPObject
::
invoke
(
int
index
,
const
NPVariant
*
args
,
uint32_t
argCount
,
NPVariant
&
result
)
...
...
@@ -270,7 +295,7 @@ RuntimeNPObject::InvokeResult LibvlcAudioNPObject::invoke(int index, const NPVar
switch
(
index
)
{
case
ID_togglemute
:
case
ID_
audio_
togglemute
:
if
(
argCount
==
0
)
{
libvlc_audio_toggle_mute
(
p_plugin
->
getVLC
(),
&
ex
);
...
...
@@ -288,7 +313,7 @@ RuntimeNPObject::InvokeResult LibvlcAudioNPObject::invoke(int index, const NPVar
}
return
INVOKERESULT_NO_SUCH_METHOD
;
default:
return
INVOKERESULT_NO_SUCH_METHOD
;
;
}
}
return
INVOKERESULT_GENERIC_ERROR
;
...
...
@@ -313,13 +338,13 @@ const int LibvlcInputNPObject::propertyCount = sizeof(LibvlcInputNPObject::prope
enum
LibvlcInputNPObjectPropertyIds
{
ID_length
,
ID_position
,
ID_time
,
ID_state
,
ID_rate
,
ID_fps
,
ID_hasvout
,
ID_
input_
length
,
ID_
input_
position
,
ID_
input_
time
,
ID_
input_
state
,
ID_
input_
rate
,
ID_
input_
fps
,
ID_
input_
hasvout
,
};
RuntimeNPObject
::
InvokeResult
LibvlcInputNPObject
::
getProperty
(
int
index
,
NPVariant
&
result
)
...
...
@@ -333,7 +358,7 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVari
libvlc_input_t
*
p_input
=
libvlc_playlist_get_input
(
p_plugin
->
getVLC
(),
&
ex
);
if
(
libvlc_exception_raised
(
&
ex
)
)
{
if
(
index
!=
ID_state
)
if
(
index
!=
ID_
input_
state
)
{
NPN_SetException
(
this
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
...
...
@@ -349,7 +374,7 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVari
switch
(
index
)
{
case
ID_length
:
case
ID_
input_
length
:
{
double
val
=
(
double
)
libvlc_input_get_length
(
p_input
,
&
ex
);
libvlc_input_free
(
p_input
);
...
...
@@ -362,7 +387,7 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVari
DOUBLE_TO_NPVARIANT
(
val
,
result
);
return
INVOKERESULT_NO_ERROR
;
}
case
ID_position
:
case
ID_
input_
position
:
{
double
val
=
libvlc_input_get_position
(
p_input
,
&
ex
);
libvlc_input_free
(
p_input
);
...
...
@@ -375,7 +400,7 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVari
DOUBLE_TO_NPVARIANT
(
val
,
result
);
return
INVOKERESULT_NO_ERROR
;
}
case
ID_time
:
case
ID_
input_
time
:
{
double
val
=
(
double
)
libvlc_input_get_time
(
p_input
,
&
ex
);
libvlc_input_free
(
p_input
);
...
...
@@ -388,7 +413,7 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVari
DOUBLE_TO_NPVARIANT
(
val
,
result
);
return
INVOKERESULT_NO_ERROR
;
}
case
ID_state
:
case
ID_
input_
state
:
{
int
val
=
libvlc_input_get_state
(
p_input
,
&
ex
);
libvlc_input_free
(
p_input
);
...
...
@@ -401,7 +426,7 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVari
INT32_TO_NPVARIANT
(
val
,
result
);
return
INVOKERESULT_NO_ERROR
;
}
case
ID_rate
:
case
ID_
input_
rate
:
{
float
val
=
libvlc_input_get_rate
(
p_input
,
&
ex
);
libvlc_input_free
(
p_input
);
...
...
@@ -414,7 +439,7 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVari
DOUBLE_TO_NPVARIANT
(
val
,
result
);
return
INVOKERESULT_NO_ERROR
;
}
case
ID_fps
:
case
ID_
input_
fps
:
{
double
val
=
libvlc_input_get_fps
(
p_input
,
&
ex
);
libvlc_input_free
(
p_input
);
...
...
@@ -427,7 +452,7 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVari
DOUBLE_TO_NPVARIANT
(
val
,
result
);
return
INVOKERESULT_NO_ERROR
;
}
case
ID_hasvout
:
case
ID_
input_
hasvout
:
{
vlc_bool_t
val
=
libvlc_input_has_vout
(
p_input
,
&
ex
);
libvlc_input_free
(
p_input
);
...
...
@@ -440,6 +465,8 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVari
BOOLEAN_TO_NPVARIANT
(
val
,
result
);
return
INVOKERESULT_NO_ERROR
;
}
default:
;
}
libvlc_input_free
(
p_input
);
}
...
...
@@ -464,7 +491,7 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::setProperty(int index, const
switch
(
index
)
{
case
ID_position
:
case
ID_
input_
position
:
{
if
(
!
NPVARIANT_IS_DOUBLE
(
value
)
)
{
...
...
@@ -483,7 +510,7 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::setProperty(int index, const
}
return
INVOKERESULT_NO_ERROR
;
}
case
ID_time
:
case
ID_
input_
time
:
{
vlc_int64_t
val
;
if
(
NPVARIANT_IS_INT32
(
value
)
)
...
...
@@ -506,7 +533,7 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::setProperty(int index, const
}
return
INVOKERESULT_NO_ERROR
;
}
case
ID_rate
:
case
ID_
input_
rate
:
{
float
val
;
if
(
NPVARIANT_IS_INT32
(
value
)
)
...
...
@@ -529,6 +556,8 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::setProperty(int index, const
}
return
INVOKERESULT_NO_ERROR
;
}
default:
;
}
libvlc_input_free
(
p_input
);
}
...
...
@@ -559,93 +588,99 @@ const int LibvlcMessageNPObject::propertyCount = sizeof(LibvlcMessageNPObject::p
enum
LibvlcMessageNPObjectPropertyIds
{
ID_severity
,
ID_type
,
ID_name
,
ID_header
,
ID_message
,
ID_
message_
severity
,
ID_
message_
type
,
ID_
message_
name
,
ID_
message_
header
,
ID_message
_message
,
};
RuntimeNPObject
::
InvokeResult
LibvlcMessageNPObject
::
getProperty
(
int
index
,
NPVariant
&
result
)
{
switch
(
index
)
VlcPlugin
*
p_plugin
=
reinterpret_cast
<
VlcPlugin
*>
(
_instance
->
pdata
);
if
(
p_plugin
)
{
case
ID_severity
:
{
INT32_TO_NPVARIANT
(
_msg
.
i_severity
,
result
);
return
INVOKERESULT_NO_ERROR
;
}
case
ID_type
:
switch
(
index
)
{
if
(
_msg
.
psz_type
)
{
int
len
=
strlen
(
_msg
.
psz_type
);
NPUTF8
*
retval
=
(
NPUTF8
*
)
NPN_MemAlloc
(
len
);
if
(
retval
)
{
memcpy
(
retval
,
_msg
.
psz_type
,
len
);
STRINGN_TO_NPVARIANT
(
retval
,
len
,
result
);
}
}
else
case
ID_message_severity
:
{
NULL_TO_NPVARIANT
(
result
);
INT32_TO_NPVARIANT
(
_msg
.
i_severity
,
result
);
return
INVOKERESULT_NO_ERROR
;
}
return
INVOKERESULT_NO_ERROR
;
}
case
ID_name
:
{
if
(
_msg
.
psz_name
)
case
ID_message_type
:
{
int
len
=
strlen
(
_msg
.
psz_name
);
NPUTF8
*
retval
=
(
NPUTF8
*
)
NPN_MemAlloc
(
len
);
if
(
retval
)
if
(
_msg
.
psz_type
)
{
memcpy
(
retval
,
_msg
.
psz_name
,
len
);
STRINGN_TO_NPVARIANT
(
retval
,
len
,
result
);
int
len
=
strlen
(
_msg
.
psz_type
);
NPUTF8
*
retval
=
(
NPUTF8
*
)
NPN_MemAlloc
(
len
);
if
(
retval
)
{
memcpy
(
retval
,
_msg
.
psz_type
,
len
);
STRINGN_TO_NPVARIANT
(
retval
,
len
,
result
);
}
}
}
else
{
NULL_TO_NPVARIANT
(
result
);
}
return
INVOKERESULT_NO_ERROR
;
}
case
ID_header
:
{
if
(
_msg
.
psz_header
)
{
int
len
=
strlen
(
_msg
.
psz_header
);
NPUTF8
*
retval
=
(
NPUTF8
*
)
NPN_MemAlloc
(
len
);
if
(
retval
)
else
{
memcpy
(
retval
,
_msg
.
psz_header
,
len
);
STRINGN_TO_NPVARIANT
(
retval
,
len
,
result
);
NULL_TO_NPVARIANT
(
result
);
}
return
INVOKERESULT_NO_ERROR
;
}
else
case
ID_message_name
:
{
NULL_TO_NPVARIANT
(
result
);
if
(
_msg
.
psz_name
)
{
int
len
=
strlen
(
_msg
.
psz_name
);
NPUTF8
*
retval
=
(
NPUTF8
*
)
NPN_MemAlloc
(
len
);
if
(
retval
)
{
memcpy
(
retval
,
_msg
.
psz_name
,
len
);
STRINGN_TO_NPVARIANT
(
retval
,
len
,
result
);
}
}
else
{
NULL_TO_NPVARIANT
(
result
);
}
return
INVOKERESULT_NO_ERROR
;
}
return
INVOKERESULT_NO_ERROR
;
}
case
ID_message
:
{
if
(
_msg
.
psz_message
)
case
ID_message_header
:
{
int
len
=
strlen
(
_msg
.
psz_message
);
NPUTF8
*
retval
=
(
NPUTF8
*
)
NPN_MemAlloc
(
len
);
if
(
retval
)
if
(
_msg
.
psz_header
)
{
memcpy
(
retval
,
_msg
.
psz_message
,
len
);
STRINGN_TO_NPVARIANT
(
retval
,
len
,
result
);
int
len
=
strlen
(
_msg
.
psz_header
);
NPUTF8
*
retval
=
(
NPUTF8
*
)
NPN_MemAlloc
(
len
);
if
(
retval
)
{
memcpy
(
retval
,
_msg
.
psz_header
,
len
);
STRINGN_TO_NPVARIANT
(
retval
,
len
,
result
);
}
}
else
{
NULL_TO_NPVARIANT
(
result
);
}
return
INVOKERESULT_NO_ERROR
;
}
else
case
ID_message_message
:
{
NULL_TO_NPVARIANT
(
result
);
if
(
_msg
.
psz_message
)
{
int
len
=
strlen
(
_msg
.
psz_message
);
NPUTF8
*
retval
=
(
NPUTF8
*
)
NPN_MemAlloc
(
len
);
if
(
retval
)
{
memcpy
(
retval
,
_msg
.
psz_message
,
len
);
STRINGN_TO_NPVARIANT
(
retval
,
len
,
result
);
}
}
else
{
NULL_TO_NPVARIANT
(
result
);
}
return
INVOKERESULT_NO_ERROR
;
}
return
INVOKERESULT_NO_ERROR
;
default:
;
}
}
return
INVOKERESULT_GENERIC_ERROR
;
...
...
@@ -662,17 +697,27 @@ const int LibvlcMessageNPObject::methodCount = sizeof(LibvlcMessageNPObject::met
** implementation of libvlc message iterator object
*/
void
LibvlcMessageIteratorNPObject
::
setLog
(
LibvlcLogNPObject
*
p_vlclog
)
LibvlcMessageIteratorNPObject
::
LibvlcMessageIteratorNPObject
(
NPP
instance
,
const
NPClass
*
aClass
)
:
RuntimeNPObject
(
instance
,
aClass
),
_p_iter
(
NULL
)
{
_p_vlclog
=
p_vlclog
;
if
(
p_
vlclog
->
_p_log
)
VlcPlugin
*
p_plugin
=
reinterpret_cast
<
VlcPlugin
*>
(
_instance
->
pdata
)
;
if
(
p_
plugin
)
{
_p_iter
=
libvlc_log_get_iterator
(
p_vlclog
->
_p_log
,
NULL
);
libvlc_log_t
*
p_log
=
p_plugin
->
getLog
();
if
(
p_log
)
{
_p_iter
=
libvlc_log_get_iterator
(
p_log
,
NULL
);
}
}
else
_p_iter
=
NULL
;
};
LibvlcMessageIteratorNPObject
::~
LibvlcMessageIteratorNPObject
()
{
if
(
_p_iter
)
libvlc_log_iterator_free
(
_p_iter
,
NULL
);
}
const
NPUTF8
*
const
LibvlcMessageIteratorNPObject
::
propertyNames
[]
=
{
"hasNext"
,
...
...
@@ -682,33 +727,39 @@ const int LibvlcMessageIteratorNPObject::propertyCount = sizeof(LibvlcMessageIte
enum
LibvlcMessageIteratorNPObjectPropertyIds
{
ID_hasNext
,
ID_
messageiterator_
hasNext
,
};
RuntimeNPObject
::
InvokeResult
LibvlcMessageIteratorNPObject
::
getProperty
(
int
index
,
NPVariant
&
result
)
{
switch
(
index
)
VlcPlugin
*
p_plugin
=
reinterpret_cast
<
VlcPlugin
*>
(
_instance
->
pdata
);
if
(
p_plugin
)
{
case
ID_hasNext
:
switch
(
index
)
{
if
(
_p_iter
&&
_p_vlclog
->
_p_log
)
case
ID_messageiterator_hasNext
:
{
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
if
(
_p_iter
&&
p_plugin
->
getLog
()
)
{
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
BOOLEAN_TO_NPVARIANT
(
libvlc_log_iterator_has_next
(
_p_iter
,
&
ex
),
result
);
if
(
libvlc_exception_raised
(
&
ex
)
)
BOOLEAN_TO_NPVARIANT
(
libvlc_log_iterator_has_next
(
_p_iter
,
&
ex
),
result
);
if
(
libvlc_exception_raised
(
&
ex
)
)
{
NPN_SetException
(
this
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
INVOKERESULT_GENERIC_ERROR
;
}
}
else
{
NPN_SetException
(
this
,
libvlc_exception_get_message
(
&
ex
));
libvlc_exception_clear
(
&
ex
);
return
INVOKERESULT_GENERIC_ERROR
;
BOOLEAN_TO_NPVARIANT
(
0
,
result
);
}
return
INVOKERESULT_NO_ERROR
;
}
else
{
BOOLEAN_TO_NPVARIANT
(
0
,
result
);
}
return
INVOKERESULT_NO_ERROR
;
default:
;
}
}
return
INVOKERESULT_GENERIC_ERROR
;
...
...
@@ -728,7 +779,8 @@ enum LibvlcMessageIteratorNPObjectMethodIds
RuntimeNPObject
::
InvokeResult
LibvlcMessageIteratorNPObject
::
invoke
(
int
index
,
const
NPVariant
*
args
,
uint32_t
argCount
,
NPVariant
&
result
)
{
if
(
_p_iter
&&
_p_vlclog
->
_p_log
)
VlcPlugin
*
p_plugin
=
reinterpret_cast
<
VlcPlugin
*>
(
_instance
->
pdata
);
if
(
p_plugin
)
{
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
...
...
@@ -738,32 +790,37 @@ RuntimeNPObject::InvokeResult LibvlcMessageIteratorNPObject::invoke(int index, c
case
ID_messageiterator_next
:
if
(
argCount
==
0
)
{