* demux2 adaptation layer.
*****************************************************************************
* Copyright (C) 2004 VideoLAN
- * $Id: demux2.c,v 1.1 2004/01/04 14:28:11 fenrir Exp $
+ * $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
#include <vlc/vlc.h>
#include <vlc/input.h>
+#include "vlc_playlist.h"
+
/*****************************************************************************
* Module descriptor
*****************************************************************************/
static void Demux2Close ( vlc_object_t * );
vlc_module_begin();
- set_description( _("demux2 adaptation layer" ) );
- set_capability( "demux", 0 );
+ set_description( _("Demux2 adaptation layer" ) );
+ set_capability( "demux", 10 );
set_callbacks( Demux2Open, Demux2Close );
add_shortcut( "demux2" );
+
+ /* Hack */
+ add_shortcut( "nsv" );
+ add_shortcut( "live" );
+ add_shortcut( "ts" );
+ add_shortcut( "ps2" );
+ add_shortcut( "dvdnav" );
+ add_shortcut( "dvdnavsimple" );
+ add_shortcut( "ffmpeg" );
+ add_shortcut( "mp3" );
+ add_shortcut( "mpga" );
+ add_shortcut( "aac" );
+ add_shortcut( "a52" );
+ add_shortcut( "dts" );
+ add_shortcut( "mod" );
+ add_shortcut( "flac" );
+ add_shortcut( "m3u" );
+ add_shortcut( "playlist" );
+ add_shortcut( "m4v" );
+ add_shortcut( "mp4v" );
+ add_shortcut( "mpgv" );
+ add_shortcut( "rawdv" );
+ add_shortcut( "ogg" );
+ add_shortcut( "h264" );
+ add_shortcut( "avi" );
+ add_shortcut( "mjpeg" );
+ add_shortcut( "directory" );
+ add_shortcut( "wav" );
+ add_shortcut( "v4l" );
+ add_shortcut( "dshow" );
vlc_module_end();
/*****************************************************************************
input_thread_t *p_input = (input_thread_t *)p_this;
demux2_sys_t *p_sys = malloc( sizeof( demux2_sys_t ) );
demux_t *p_demux;
+ playlist_t *p_playlist;
if( input_InitStream( p_input, 0 ) )
{
return VLC_EGENERIC;
}
- p_demux = demux2_New( p_input, p_input->psz_source, p_input->s, p_input->p_es_out );
+ p_demux = demux2_New( p_input,
+ p_input->psz_access, p_input->psz_demux,
+ p_input->psz_name,
+ p_input->s, p_input->p_es_out );
if( !p_demux )
{
return VLC_EGENERIC;
}
+ /* Now retreive meta info from demuxer */
+ if( ( p_playlist = vlc_object_find( p_demux, VLC_OBJECT_PLAYLIST,
+ FIND_ANYWHERE ) ) )
+ {
+ int64_t i_length;
+
+ if( !demux2_Control( p_demux, DEMUX_GET_LENGTH, &i_length ) )
+ {
+ playlist_SetDuration( p_playlist, -1, i_length );
+ }
+ vlc_object_release( p_playlist );
+ }
+
p_input->pf_demux = Demux2Demux;
p_input->pf_demux_control = Demux2Control;
p_input->p_demux_data = (demux_sys_t*)p_sys;
*****************************************************************************/
static int Demux2Demux( input_thread_t * p_input )
{
- demux2_sys_t *p_sys = (demux2_sys_t*)p_input->p_demux_data;
+ demux2_sys_t *p_sys = (demux2_sys_t*)p_input->p_demux_data;
+ p_sys->p_demux->b_die = p_input->b_die;
return demux2_Demux( p_sys->p_demux );
}
*****************************************************************************/
static int Demux2Control( input_thread_t *p_input, int i_query, va_list args )
{
- demux2_sys_t *p_sys = (demux2_sys_t*)p_input->p_demux_data;
+ demux2_sys_t *p_sys = (demux2_sys_t*)p_input->p_demux_data;
return demux2_vaControl( p_sys->p_demux, i_query, args );
}