Commit 79d1e54c authored by Jean-Philippe André's avatar Jean-Philippe André

Skins2: remove skins demux

As pointed by Rémi, only medias should be "openable" in VLC.
parent 035a3f5e
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_input.h> #include <vlc_input.h>
#include <vlc_demux.h>
#include <vlc_playlist.h> #include <vlc_playlist.h>
#include <vlc_threads.h> #include <vlc_threads.h>
#include <vlc_vout_window.h> #include <vlc_vout_window.h>
...@@ -67,10 +66,6 @@ static int Open ( vlc_object_t * ); ...@@ -67,10 +66,6 @@ static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * ); static void Close ( vlc_object_t * );
static void *Run ( void * ); static void *Run ( void * );
static int DemuxOpen( vlc_object_t * );
static int Demux( demux_t * );
static int DemuxControl( demux_t *, int, va_list );
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Prototypes for configuration callbacks // Prototypes for configuration callbacks
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -122,9 +117,6 @@ static int Open( vlc_object_t *p_this ) ...@@ -122,9 +117,6 @@ static int Open( vlc_object_t *p_this )
// No theme yet // No theme yet
p_intf->p_sys->p_theme = NULL; p_intf->p_sys->p_theme = NULL;
// Create a variable to be notified of skins to be loaded
var_Create( p_intf, "skin-to-load", VLC_VAR_STRING );
vlc_mutex_init( &p_intf->p_sys->vout_lock ); vlc_mutex_init( &p_intf->p_sys->vout_lock );
vlc_cond_init( &p_intf->p_sys->vout_wait ); vlc_cond_init( &p_intf->p_sys->vout_wait );
...@@ -377,83 +369,6 @@ static void WindowClose( vlc_object_t *p_this ) ...@@ -377,83 +369,6 @@ static void WindowClose( vlc_object_t *p_this )
vlc_object_release( pIntf ); vlc_object_release( pIntf );
} }
//---------------------------------------------------------------------------
// DemuxOpen: initialize demux
//---------------------------------------------------------------------------
static int DemuxOpen( vlc_object_t *p_this )
{
demux_t *p_demux = (demux_t*)p_this;
intf_thread_t *p_intf;
char *ext;
// Needed callbacks
p_demux->pf_demux = Demux;
p_demux->pf_control = DemuxControl;
// Test that we have a valid .vlt or .wsz file, based on the extension
if( ( ext = strrchr( p_demux->psz_path, '.' ) ) == NULL ||
( strcasecmp( ext, ".vlt" ) && strcasecmp( ext, ".wsz" ) ) )
{
return VLC_EGENERIC;
}
vlc_mutex_lock( &skin_load.mutex );
p_intf = skin_load.intf;
if( p_intf )
vlc_object_hold( p_intf );
vlc_mutex_unlock( &skin_load.mutex );
if( p_intf != NULL )
{
playlist_t *p_playlist = pl_Get( p_this );
PL_LOCK;
// Make sure the item is deleted afterwards
/// \bug does not always work
playlist_CurrentPlayingItem( p_playlist )->i_flags |= PLAYLIST_REMOVE_FLAG;
PL_UNLOCK;
var_SetString( p_intf, "skin-to-load", p_demux->psz_path );
vlc_object_release( p_intf );
}
else
{
msg_Warn( p_this,
"skin could not be loaded (not using skins2 intf)" );
}
return VLC_SUCCESS;
}
//---------------------------------------------------------------------------
// Demux: return EOF
//---------------------------------------------------------------------------
static int Demux( demux_t *p_demux )
{
return 0;
}
//---------------------------------------------------------------------------
// DemuxControl
//---------------------------------------------------------------------------
static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
{
switch( i_query )
{
case DEMUX_GET_PTS_DELAY:
{
int64_t *pi_pts_delay = va_arg( args, int64_t * );
*pi_pts_delay = 10;
return VLC_SUCCESS;
}
default:
return VLC_EGENERIC;
}
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Callbacks // Callbacks
...@@ -589,10 +504,4 @@ vlc_module_begin () ...@@ -589,10 +504,4 @@ vlc_module_begin ()
#endif #endif
set_callbacks( WindowOpen, WindowClose ) set_callbacks( WindowOpen, WindowClose )
add_submodule ()
set_description( N_("Skins loader demux") )
set_capability( "access_demux", 5 )
set_callbacks( DemuxOpen, NULL )
add_shortcut( "skins" )
vlc_module_end () vlc_module_end ()
...@@ -172,8 +172,6 @@ VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ), ...@@ -172,8 +172,6 @@ VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
// Called when a playlist item changed // Called when a playlist item changed
var_AddCallback( pIntf->p_sys->p_playlist, "item-change", var_AddCallback( pIntf->p_sys->p_playlist, "item-change",
onItemChange, this ); onItemChange, this );
// Called when our skins2 demux wants us to load a new skin
var_AddCallback( pIntf, "skin-to-load", onSkinToLoad, this );
// Called when we have an interaction dialog to display // Called when we have an interaction dialog to display
var_Create( pIntf, "interaction", VLC_VAR_ADDRESS ); var_Create( pIntf, "interaction", VLC_VAR_ADDRESS );
...@@ -225,7 +223,6 @@ VlcProc::~VlcProc() ...@@ -225,7 +223,6 @@ VlcProc::~VlcProc()
onInputNew, this ); onInputNew, this );
var_DelCallback( getIntf()->p_sys->p_playlist, "item-change", var_DelCallback( getIntf()->p_sys->p_playlist, "item-change",
onItemChange, this ); onItemChange, this );
var_DelCallback( getIntf(), "skin-to-load", onSkinToLoad, this );
var_DelCallback( getIntf(), "interaction", onInteraction, this ); var_DelCallback( getIntf(), "interaction", onInteraction, this );
} }
...@@ -324,24 +321,6 @@ int VlcProc::onItemDelete( vlc_object_t *pObj, const char *pVariable, ...@@ -324,24 +321,6 @@ int VlcProc::onItemDelete( vlc_object_t *pObj, const char *pVariable,
return VLC_SUCCESS; return VLC_SUCCESS;
} }
int VlcProc::onSkinToLoad( vlc_object_t *pObj, const char *pVariable,
vlc_value_t oldVal, vlc_value_t newVal,
void *pParam )
{
VlcProc *pThis = (VlcProc*)pParam;
// Create a playlist notify command
CmdChangeSkin *pCmd =
new CmdChangeSkin( pThis->getIntf(), newVal.psz_string );
// Push the command in the asynchronous command queue
AsyncQueue *pQueue = AsyncQueue::instance( pThis->getIntf() );
pQueue->push( CmdGenericPtr( pCmd ) );
return VLC_SUCCESS;
}
int VlcProc::onInteraction( vlc_object_t *pObj, const char *pVariable, int VlcProc::onInteraction( vlc_object_t *pObj, const char *pVariable,
vlc_value_t oldVal, vlc_value_t newVal, vlc_value_t oldVal, vlc_value_t newVal,
void *pParam ) void *pParam )
......
...@@ -204,11 +204,6 @@ private: ...@@ -204,11 +204,6 @@ private:
vlc_value_t oldVal, vlc_value_t newVal, vlc_value_t oldVal, vlc_value_t newVal,
void *pParam ); void *pParam );
/// Callback for skins2-to-load variable
static int onSkinToLoad( vlc_object_t *pObj, const char *pVariable,
vlc_value_t oldVal, vlc_value_t newVal,
void *pParam );
static int onInteraction( vlc_object_t *pObj, const char *pVariable, static int onInteraction( vlc_object_t *pObj, const char *pVariable,
vlc_value_t oldVal, vlc_value_t newVal, vlc_value_t oldVal, vlc_value_t newVal,
void *pParam ); void *pParam );
......
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