Commit 006ad882 authored by Rémi Duraffort's avatar Rémi Duraffort

fix mozilla plugin compilation.

parent fb64f7ae
......@@ -465,7 +465,7 @@ LibvlcInputNPObject::getProperty(int index, NPVariant &result)
}
case ID_input_state:
{
int val = libvlc_media_player_get_state(p_md, &ex);
int val = libvlc_media_player_get_state(p_md);
RETURN_ON_EXCEPTION(this,ex);
INT32_TO_NPVARIANT(val, result);
return INVOKERESULT_NO_ERROR;
......@@ -616,15 +616,12 @@ LibvlcPlaylistItemsNPObject::getProperty(int index, NPVariant &result)
if( isPluginRunning() )
{
VlcPlugin* p_plugin = getPrivate<VlcPlugin>();
libvlc_exception_t ex;
libvlc_exception_init(&ex);
switch( index )
{
case ID_playlistitems_count:
{
int val = p_plugin->playlist_count(&ex);
RETURN_ON_EXCEPTION(this,ex);
int val = p_plugin->playlist_count();
INT32_TO_NPVARIANT(val, result);
return INVOKERESULT_NO_ERROR;
}
......@@ -719,22 +716,18 @@ LibvlcPlaylistNPObject::getProperty(int index, NPVariant &result)
if( isPluginRunning() )
{
VlcPlugin* p_plugin = getPrivate<VlcPlugin>();
libvlc_exception_t ex;
libvlc_exception_init(&ex);
switch( index )
{
case ID_playlist_itemcount: /* deprecated */
{
int val = p_plugin->playlist_count(&ex);
RETURN_ON_EXCEPTION(this,ex);
int val = p_plugin->playlist_count();
INT32_TO_NPVARIANT(val, result);
return INVOKERESULT_NO_ERROR;
}
case ID_playlist_isplaying:
{
int val = p_plugin->playlist_isplaying(&ex);
RETURN_ON_EXCEPTION(this,ex);
int val = p_plugin->playlist_isplaying();
BOOLEAN_TO_NPVARIANT(val, result);
return INVOKERESULT_NO_ERROR;
}
......@@ -907,8 +900,7 @@ LibvlcPlaylistNPObject::invoke(int index, const NPVariant *args,
case ID_playlist_stop:
if( argCount == 0 )
{
p_plugin->playlist_stop(&ex);
RETURN_ON_EXCEPTION(this,ex);
p_plugin->playlist_stop();
VOID_TO_NPVARIANT(result);
return INVOKERESULT_NO_ERROR;
}
......@@ -1352,10 +1344,12 @@ LibvlcVideoNPObject::getProperty(int index, NPVariant &result)
}
case ID_video_teletext:
{
int i_page = libvlc_video_get_teletext(p_md, &ex);
/* int i_page = libvlc_video_get_teletext(p_md, &ex);
RETURN_ON_EXCEPTION(this,ex);
INT32_TO_NPVARIANT(i_page, result);
return INVOKERESULT_NO_ERROR;
*/
return INVOKERESULT_NO_SUCH_METHOD;
}
case ID_video_marquee:
{
......@@ -1458,10 +1452,13 @@ LibvlcVideoNPObject::setProperty(int index, const NPVariant &value)
{
if( isNumberValue(value) )
{
/*
libvlc_video_set_teletext(p_md, numberValue(value), &ex);
RETURN_ON_EXCEPTION(this,ex);
return INVOKERESULT_NO_ERROR;
*/
return INVOKERESULT_NO_SUCH_METHOD;
}
return INVOKERESULT_INVALID_VALUE;
}
......
......@@ -284,20 +284,18 @@ VlcPlugin::~VlcPlugin()
/*****************************************************************************
* VlcPlugin playlist replacement methods
*****************************************************************************/
void VlcPlugin::set_player_window( libvlc_exception_t *ex )
void VlcPlugin::set_player_window()
{
#ifdef XP_UNIX
libvlc_media_player_set_xwindow(libvlc_media_player,
(libvlc_drawable_t)getVideoWindow(),
ex);
(libvlc_drawable_t)getVideoWindow());
#endif
#ifdef XP_MACOSX
// XXX FIXME insert appropriate call here
#endif
#ifdef XP_WIN
libvlc_media_player_set_hwnd(libvlc_media_player,
getWindow().window,
ex);
getWindow().window);
#endif
}
......@@ -311,7 +309,7 @@ int VlcPlugin::playlist_add( const char *mrl, libvlc_exception_t *ex )
libvlc_media_list_lock(libvlc_media_list);
libvlc_media_list_add_media(libvlc_media_list,p_m,ex);
if( !libvlc_exception_raised(ex) )
item = libvlc_media_list_count(libvlc_media_list,ex)-1;
item = libvlc_media_list_count(libvlc_media_list)-1;
libvlc_media_list_unlock(libvlc_media_list);
libvlc_media_release(p_m);
......@@ -333,7 +331,7 @@ int VlcPlugin::playlist_add_extended_untrusted( const char *mrl, const char *nam
libvlc_media_list_lock(libvlc_media_list);
libvlc_media_list_add_media(libvlc_media_list,p_m,ex);
if( !libvlc_exception_raised(ex) )
item = libvlc_media_list_count(libvlc_media_list,ex)-1;
item = libvlc_media_list_count(libvlc_media_list)-1;
libvlc_media_list_unlock(libvlc_media_list);
libvlc_media_release(p_m);
......@@ -346,9 +344,7 @@ bool VlcPlugin::playlist_select( int idx, libvlc_exception_t *ex )
libvlc_media_list_lock(libvlc_media_list);
int count = libvlc_media_list_count(libvlc_media_list,ex);
if( libvlc_exception_raised(ex) )
goto bad_unlock;
int count = libvlc_media_list_count(libvlc_media_list);
if( idx<0||idx>=count )
goto bad_unlock;
......@@ -369,7 +365,7 @@ bool VlcPlugin::playlist_select( int idx, libvlc_exception_t *ex )
libvlc_media_player = libvlc_media_player_new_from_media(p_m,ex);
if( libvlc_media_player )
set_player_window(ex);
set_player_window();
libvlc_media_release( p_m );
return !libvlc_exception_raised(ex);
......@@ -393,29 +389,29 @@ void VlcPlugin::playlist_clear( libvlc_exception_t *ex )
libvlc_media_list = libvlc_media_list_new(getVLC(),ex);
}
int VlcPlugin::playlist_count( libvlc_exception_t *ex )
int VlcPlugin::playlist_count()
{
int items_count = 0;
libvlc_media_list_lock(libvlc_media_list);
items_count = libvlc_media_list_count(libvlc_media_list,ex);
items_count = libvlc_media_list_count(libvlc_media_list);
libvlc_media_list_unlock(libvlc_media_list);
return items_count;
}
void VlcPlugin::toggle_fullscreen( libvlc_exception_t *ex )
{
if( playlist_isplaying(ex) )
if( playlist_isplaying() )
libvlc_toggle_fullscreen(libvlc_media_player,ex);
}
void VlcPlugin::set_fullscreen( int yes, libvlc_exception_t *ex )
{
if( playlist_isplaying(ex) )
if( playlist_isplaying() )
libvlc_set_fullscreen(libvlc_media_player,yes,ex);
}
int VlcPlugin::get_fullscreen( libvlc_exception_t *ex )
{
int r = 0;
if( playlist_isplaying(ex) )
if( playlist_isplaying() )
r = libvlc_get_fullscreen(libvlc_media_player,ex);
return r;
}
......@@ -423,7 +419,7 @@ int VlcPlugin::get_fullscreen( libvlc_exception_t *ex )
bool VlcPlugin::player_has_vout( libvlc_exception_t *ex )
{
bool r = false;
if( playlist_isplaying(ex) )
if( playlist_isplaying() )
r = libvlc_media_player_has_vout(libvlc_media_player, ex);
return r;
}
......@@ -727,7 +723,6 @@ void VlcPlugin::hideToolbar()
void VlcPlugin::redrawToolbar()
{
libvlc_exception_t ex;
int is_playing = 0;
bool b_mute = false;
unsigned int dst_x, dst_y;
......@@ -745,7 +740,6 @@ void VlcPlugin::redrawToolbar()
getToolbarSize( &i_tb_width, &i_tb_height );
libvlc_exception_init( &ex );
/* get mute info */
b_mute = libvlc_audio_get_mute( getVLC() );
......@@ -814,12 +808,14 @@ void VlcPlugin::redrawToolbar()
(window.width-(dst_x+BTN_SPACE)), p_timeline->height );
/* get movie position in % */
if( playlist_isplaying(&ex) )
if( playlist_isplaying() )
{
libvlc_exception_t ex;
libvlc_exception_init( &ex );
i_last_position = (int)((window.width-(dst_x+BTN_SPACE))*
libvlc_media_player_get_position(libvlc_media_player,&ex));
libvlc_exception_clear( &ex );
}
libvlc_exception_clear( &ex );
if( p_btnTime )
XPutImage( p_display, control, gc, p_btnTime,
......@@ -835,7 +831,6 @@ vlc_toolbar_clicked_t VlcPlugin::getToolbarButtonClicked( int i_xpos, int i_ypos
unsigned int i_dest = BTN_SPACE;
int is_playing = 0;
bool b_mute = false;
libvlc_exception_t ex;
#ifndef NDEBUG
fprintf( stderr, "ToolbarButtonClicked:: "
......@@ -851,9 +846,7 @@ vlc_toolbar_clicked_t VlcPlugin::getToolbarButtonClicked( int i_xpos, int i_ypos
*/
/* get isplaying */
libvlc_exception_init( &ex );
is_playing = playlist_isplaying( &ex );
libvlc_exception_clear( &ex );
is_playing = playlist_isplaying();
/* get mute info */
b_mute = libvlc_audio_get_mute( getVLC() );
......
......@@ -155,10 +155,10 @@ public:
if( playlist_select(idx,ex) )
libvlc_media_player_play(libvlc_media_player,ex);
}
void playlist_stop(libvlc_exception_t *ex)
void playlist_stop()
{
if( libvlc_media_player )
libvlc_media_player_stop(libvlc_media_player,ex);
libvlc_media_player_stop(libvlc_media_player);
}
void playlist_next(libvlc_exception_t *ex)
{
......@@ -175,12 +175,12 @@ public:
if( libvlc_media_player )
libvlc_media_player_pause(libvlc_media_player,ex);
}
int playlist_isplaying(libvlc_exception_t *ex)
int playlist_isplaying()
{
int is_playing = 0;
if( libvlc_media_player )
is_playing = libvlc_media_player_is_playing(
libvlc_media_player, ex );
libvlc_media_player );
return is_playing;
}
......@@ -189,7 +189,7 @@ public:
const char **, libvlc_exception_t * );
void playlist_delete_item( int, libvlc_exception_t * );
void playlist_clear( libvlc_exception_t * );
int playlist_count( libvlc_exception_t * );
int playlist_count();
void toggle_fullscreen( libvlc_exception_t * );
void set_fullscreen( int, libvlc_exception_t * );
......@@ -199,7 +199,7 @@ public:
private:
bool playlist_select(int,libvlc_exception_t *);
void set_player_window( libvlc_exception_t * );
void set_player_window();
/* VLC reference */
int playlist_index;
......
......@@ -340,15 +340,8 @@ NPError NPP_Destroy( NPP instance, NPSavedData** save )
}
#endif
libvlc_exception_t ex;
libvlc_exception_init(&ex);
int val = p_plugin->playlist_isplaying(&ex);
libvlc_exception_clear(&ex);
if(val)
{
p_plugin->playlist_stop(&ex);
libvlc_exception_clear(&ex);
}
if( p_plugin->playlist_isplaying() )
p_plugin->playlist_stop();
delete p_plugin;
......@@ -819,8 +812,7 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
libvlc_media_player_t *p_md = p_plugin->getMD(&ex);
libvlc_exception_clear( &ex );
i_playing = p_plugin->playlist_isplaying( &ex );
libvlc_exception_clear( &ex );
i_playing = p_plugin->playlist_isplaying();
vlc_toolbar_clicked_t clicked;
clicked = p_plugin->getToolbarButtonClicked( i_xPos, i_yPos );
......@@ -840,8 +832,7 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
case clicked_Stop:
{
p_plugin->playlist_stop(&ex);
libvlc_exception_clear( &ex );
p_plugin->playlist_stop();
}
break;
......
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