Commit 7917d2ef authored by Johan Bilien's avatar Johan Bilien

* added functions in inputs to change the current program (most of

  them do nothing)

All inputs should now have a pf_setprogram function. A default one is
provided in input_programs.c.
parent 6982da21
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* control the pace of reading. * control the pace of reading.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.50 2001/12/05 03:31:04 jobi Exp $ * $Id: input_ext-intf.h,v 1.51 2001/12/07 16:47:47 jobi Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -275,6 +275,8 @@ typedef struct input_thread_s ...@@ -275,6 +275,8 @@ typedef struct input_thread_s
void (* pf_delete_pes)( void *, struct pes_packet_s * ); void (* pf_delete_pes)( void *, struct pes_packet_s * );
/* Stream control capabilities */ /* Stream control capabilities */
int (* pf_set_program)( struct input_thread_s *,
struct pgrm_descriptor_s * );
int (* pf_set_area)( struct input_thread_s *, int (* pf_set_area)( struct input_thread_s *,
struct input_area_s * ); struct input_area_s * );
int (* pf_rewind)( struct input_thread_s * ); int (* pf_rewind)( struct input_thread_s * );
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* but exported to plug-ins * but exported to plug-ins
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: input_ext-plugins.h,v 1.6 2001/11/25 22:52:21 gbazin Exp $ * $Id: input_ext-plugins.h,v 1.7 2001/12/07 16:47:47 jobi Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -58,6 +58,7 @@ struct pgrm_descriptor_s * input_FindProgram( struct input_thread_s *, u16 ); ...@@ -58,6 +58,7 @@ struct pgrm_descriptor_s * input_FindProgram( struct input_thread_s *, u16 );
struct pgrm_descriptor_s * input_AddProgram ( struct input_thread_s *, struct pgrm_descriptor_s * input_AddProgram ( struct input_thread_s *,
u16, size_t ); u16, size_t );
void input_DelProgram( struct input_thread_s *, struct pgrm_descriptor_s * ); void input_DelProgram( struct input_thread_s *, struct pgrm_descriptor_s * );
int input_SetProgram( struct input_thread_s *, struct pgrm_descriptor_s * );
struct input_area_s * input_AddArea( struct input_thread_s * ); struct input_area_s * input_AddArea( struct input_thread_s * );
void input_DelArea ( struct input_thread_s *, struct input_area_s * ); void input_DelArea ( struct input_thread_s *, struct input_area_s * );
struct es_descriptor_s * input_FindES( struct input_thread_s *, u16 ); struct es_descriptor_s * input_FindES( struct input_thread_s *, u16 );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* modules.h : Module management functions. * modules.h : Module management functions.
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: modules.h,v 1.33 2001/12/03 16:18:37 sam Exp $ * $Id: modules.h,v 1.34 2001/12/07 16:47:47 jobi Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -128,6 +128,8 @@ typedef struct function_list_s ...@@ -128,6 +128,8 @@ typedef struct function_list_s
void ( * pf_delete_packet ) ( void *, struct data_packet_s * ); void ( * pf_delete_packet ) ( void *, struct data_packet_s * );
void ( * pf_delete_pes ) ( void *, struct pes_packet_s * ); void ( * pf_delete_pes ) ( void *, struct pes_packet_s * );
int ( * pf_set_program ) ( struct input_thread_s *,
struct pgrm_descriptor_s * );
int ( * pf_set_area ) ( struct input_thread_s *, int ( * pf_set_area ) ( struct input_thread_s *,
struct input_area_s * ); struct input_area_s * );
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* -dvd_udf to find files * -dvd_udf to find files
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.103 2001/12/05 03:31:04 jobi Exp $ * $Id: input_dvd.c,v 1.104 2001/12/07 16:47:47 jobi Exp $
* *
* Author: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -105,15 +105,16 @@ ...@@ -105,15 +105,16 @@
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
/* called from outside */ /* called from outside */
static int DVDProbe ( probedata_t *p_data ); static int DVDProbe ( probedata_t *p_data );
static void DVDInit ( struct input_thread_s * ); static void DVDInit ( struct input_thread_s * );
static void DVDEnd ( struct input_thread_s * ); static void DVDEnd ( struct input_thread_s * );
static void DVDOpen ( struct input_thread_s * ); static void DVDOpen ( struct input_thread_s * );
static void DVDClose ( struct input_thread_s * ); static void DVDClose ( struct input_thread_s * );
static int DVDSetArea ( struct input_thread_s *, struct input_area_s * ); static int DVDSetArea ( struct input_thread_s *, struct input_area_s * );
static int DVDRead ( struct input_thread_s *, data_packet_t ** ); static int DVDSetProgram ( struct input_thread_s *, pgrm_descriptor_t * );
static void DVDSeek ( struct input_thread_s *, off_t ); static int DVDRead ( struct input_thread_s *, data_packet_t ** );
static int DVDRewind ( struct input_thread_s * ); static void DVDSeek ( struct input_thread_s *, off_t );
static int DVDRewind ( struct input_thread_s * );
/* called only inside */ /* called only inside */
static int DVDChooseAngle( thread_dvd_data_t * ); static int DVDChooseAngle( thread_dvd_data_t * );
...@@ -136,6 +137,7 @@ void _M( input_getfunctions )( function_list_t * p_function_list ) ...@@ -136,6 +137,7 @@ void _M( input_getfunctions )( function_list_t * p_function_list )
input.pf_init_bit_stream = InitBitstream; input.pf_init_bit_stream = InitBitstream;
input.pf_read = DVDRead; input.pf_read = DVDRead;
input.pf_set_area = DVDSetArea; input.pf_set_area = DVDSetArea;
input.pf_set_program = DVDSetProgram;
input.pf_demux = input_DemuxPS; input.pf_demux = input_DemuxPS;
input.pf_new_packet = input_NetlistNewPacket; input.pf_new_packet = input_NetlistNewPacket;
input.pf_new_pes = input_NetlistNewPES; input.pf_new_pes = input_NetlistNewPES;
...@@ -389,6 +391,15 @@ static void DVDEnd( input_thread_t * p_input ) ...@@ -389,6 +391,15 @@ static void DVDEnd( input_thread_t * p_input )
input_NetlistEnd( p_input ); input_NetlistEnd( p_input );
} }
/*****************************************************************************
* DVDSetProgram: Does nothing, a DVD is mono-program
*****************************************************************************/
static int DVDSetProgram( input_thread_t * p_input,
pgrm_descriptor_t * p_program )
{
return 0;
}
/***************************************************************************** /*****************************************************************************
* DVDSetArea: initialize input data for title x, chapter y. * DVDSetArea: initialize input data for title x, chapter y.
* It should be called for each user navigation request. * It should be called for each user navigation request.
...@@ -504,7 +515,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -504,7 +515,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
* decrypted disc key are fast enough to check the key at each seek */ * decrypted disc key are fast enough to check the key at each seek */
if( dvdcss_seek( p_dvd->dvdhandle, p_dvd->i_start, if( dvdcss_seek( p_dvd->dvdhandle, p_dvd->i_start,
DVDCSS_SEEK_KEY ) < 0 ) DVDCSS_SEEK_KEY ) < 0 )
{ {
intf_ErrMsg( "dvd error: %s", dvdcss_error( p_dvd->dvdhandle ) ); intf_ErrMsg( "dvd error: %s", dvdcss_error( p_dvd->dvdhandle ) );
return -1; return -1;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_es.c: Elementary Stream demux and packet management * input_es.c: Elementary Stream demux and packet management
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: input_es.c,v 1.14 2001/11/28 15:08:05 massiot Exp $ * $Id: input_es.c,v 1.15 2001/12/07 16:47:47 jobi Exp $
* *
* Author: Christophe Massiot <massiot@via.ecp.fr> * Author: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -79,10 +79,12 @@ ...@@ -79,10 +79,12 @@
static int ESProbe ( probedata_t * ); static int ESProbe ( probedata_t * );
static int ESRead ( struct input_thread_s *, static int ESRead ( struct input_thread_s *,
data_packet_t * p_packets[INPUT_READ_ONCE] ); data_packet_t * p_packets[INPUT_READ_ONCE] );
static void ESInit ( struct input_thread_s * ); static void ESInit ( struct input_thread_s * );
static void ESEnd ( struct input_thread_s * ); static void ESEnd ( struct input_thread_s * );
static void ESSeek ( struct input_thread_s *, off_t ); static void ESSeek ( struct input_thread_s *, off_t );
static void ESDemux ( struct input_thread_s *, struct data_packet_s * ); static int ESSetProgram ( struct input_thread_s *, pgrm_descriptor_t * );
static void ESDemux ( struct input_thread_s *,
struct data_packet_s * );
static void ESNextDataPacket( struct bit_stream_s * ); static void ESNextDataPacket( struct bit_stream_s * );
static void ESInitBitstream( struct bit_stream_s *, struct decoder_fifo_s *, static void ESInitBitstream( struct bit_stream_s *, struct decoder_fifo_s *,
void (* pf_bitstream_callback)( struct bit_stream_s *, void (* pf_bitstream_callback)( struct bit_stream_s *,
...@@ -104,6 +106,7 @@ void _M( input_getfunctions )( function_list_t * p_function_list ) ...@@ -104,6 +106,7 @@ void _M( input_getfunctions )( function_list_t * p_function_list )
input.pf_end = ESEnd; input.pf_end = ESEnd;
input.pf_init_bit_stream = ESInitBitstream; input.pf_init_bit_stream = ESInitBitstream;
input.pf_set_area = NULL; input.pf_set_area = NULL;
input.pf_set_program = ESSetProgram;
input.pf_read = ESRead; input.pf_read = ESRead;
input.pf_demux = ESDemux; input.pf_demux = ESDemux;
input.pf_new_packet = input_NetlistNewPacket; input.pf_new_packet = input_NetlistNewPacket;
...@@ -219,6 +222,15 @@ static void ESSeek( input_thread_t * p_input, off_t i_position ) ...@@ -219,6 +222,15 @@ static void ESSeek( input_thread_t * p_input, off_t i_position )
p_input->stream.p_selected_area->i_tell = i_position; p_input->stream.p_selected_area->i_tell = i_position;
} }
/*****************************************************************************
* ESSetProgram: Does nothing
*****************************************************************************/
static int ESSetProgram( input_thread_t * p_input, pgrm_descriptor_t * p_pgrm )
{
return( 0 );
}
/***************************************************************************** /*****************************************************************************
* ESDemux: fakes a demultiplexer * ESDemux: fakes a demultiplexer
*****************************************************************************/ *****************************************************************************/
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_ps.c: PS demux and packet management * input_ps.c: PS demux and packet management
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: input_ps.c,v 1.42 2001/12/05 03:31:04 jobi Exp $ * $Id: input_ps.c,v 1.43 2001/12/07 16:47:47 jobi Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr> * Cyril Deguet <asmax@via.ecp.fr>
...@@ -87,16 +87,17 @@ static __inline__ off_t fseeko( FILE *p_file, off_t i_offset, int i_pos ) ...@@ -87,16 +87,17 @@ static __inline__ off_t fseeko( FILE *p_file, off_t i_offset, int i_pos )
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
static int PSProbe ( probedata_t * ); static int PSProbe ( probedata_t * );
static int PSRead ( struct input_thread_s *, static int PSRead ( struct input_thread_s *,
data_packet_t * p_packets[INPUT_READ_ONCE] ); data_packet_t * p_packets[INPUT_READ_ONCE] );
static void PSInit ( struct input_thread_s * ); static void PSInit ( struct input_thread_s * );
static void PSEnd ( struct input_thread_s * ); static void PSEnd ( struct input_thread_s * );
static void PSSeek ( struct input_thread_s *, off_t ); static int PSSetProgram ( struct input_thread_s * , pgrm_descriptor_t * );
static void PSSeek ( struct input_thread_s *, off_t );
static struct pes_packet_s * NewPES ( void * ); static struct pes_packet_s * NewPES ( void * );
static struct data_packet_s * NewPacket ( void *, size_t ); static struct data_packet_s * NewPacket ( void *, size_t );
static void DeletePacket( void *, struct data_packet_s * ); static void DeletePacket ( void *, struct data_packet_s * );
static void DeletePES ( void *, struct pes_packet_s * ); static void DeletePES ( void *, struct pes_packet_s * );
/***************************************************************************** /*****************************************************************************
* Functions exported as capabilities. They are declared as static so that * Functions exported as capabilities. They are declared as static so that
...@@ -112,6 +113,7 @@ void _M( input_getfunctions )( function_list_t * p_function_list ) ...@@ -112,6 +113,7 @@ void _M( input_getfunctions )( function_list_t * p_function_list )
input.pf_end = PSEnd; input.pf_end = PSEnd;
input.pf_init_bit_stream = InitBitstream; input.pf_init_bit_stream = InitBitstream;
input.pf_set_area = NULL; input.pf_set_area = NULL;
input.pf_set_program = PSSetProgram;
input.pf_read = PSRead; input.pf_read = PSRead;
input.pf_demux = input_DemuxPS; input.pf_demux = input_DemuxPS;
input.pf_new_packet = NewPacket; input.pf_new_packet = NewPacket;
...@@ -236,9 +238,9 @@ static void PSInit( input_thread_t * p_input ) ...@@ -236,9 +238,9 @@ static void PSInit( input_thread_t * p_input )
input_AddProgram( p_input, 0, sizeof( stream_ps_data_t ) ); input_AddProgram( p_input, 0, sizeof( stream_ps_data_t ) );
p_input->stream.p_selected_program = p_input->stream.p_selected_program =
p_input->stream.pp_programs[0] ; p_input->stream.pp_programs[0] ;
p_input->stream.p_new_program = p_input->stream.p_new_program =
p_input->stream.pp_programs[0] ; p_input->stream.pp_programs[0] ;
if( p_input->stream.b_seekable ) if( p_input->stream.b_seekable )
{ {
...@@ -576,6 +578,14 @@ static int PSRead( input_thread_t * p_input, ...@@ -576,6 +578,14 @@ static int PSRead( input_thread_t * p_input,
return( 0 ); return( 0 );
} }
/*****************************************************************************
* PSSetProgram: Does nothing since a PS Stream is mono-program
*****************************************************************************/
static int PSSetProgram( input_thread_t * p_input,
pgrm_descriptor_t * p_program)
{
return( 0 );
}
/***************************************************************************** /*****************************************************************************
* PSSeek: changes the stream position indicator * PSSeek: changes the stream position indicator
*****************************************************************************/ *****************************************************************************/
...@@ -776,7 +786,7 @@ static pes_packet_t * NewPES( void * p_packet_cache ) ...@@ -776,7 +786,7 @@ static pes_packet_t * NewPES( void * p_packet_cache )
} }
#endif #endif
vlc_mutex_lock( &p_cache->lock ); vlc_mutex_lock( &p_cache->lock );
/* Checks whether the PES cache is empty */ /* Checks whether the PES cache is empty */
if( p_cache->pes.l_index == 0 ) if( p_cache->pes.l_index == 0 )
...@@ -786,7 +796,7 @@ static pes_packet_t * NewPES( void * p_packet_cache ) ...@@ -786,7 +796,7 @@ static pes_packet_t * NewPES( void * p_packet_cache )
if( p_pes == NULL ) if( p_pes == NULL )
{ {
intf_DbgMsg( "Out of memory" ); intf_DbgMsg( "Out of memory" );
vlc_mutex_unlock( &p_cache->lock ); vlc_mutex_unlock( &p_cache->lock );
return NULL; return NULL;
} }
#ifdef TRACE_INPUT #ifdef TRACE_INPUT
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_ts.c: TS demux and netlist management * input_ts.c: TS demux and netlist management
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: input_ts.c,v 1.40 2001/12/03 17:34:08 stef Exp $ * $Id: input_ts.c,v 1.41 2001/12/07 16:47:47 jobi Exp $
* *
* Authors: Henri Fallon <henri@videolan.org> * Authors: Henri Fallon <henri@videolan.org>
* *
...@@ -106,6 +106,7 @@ void _M( input_getfunctions )( function_list_t * p_function_list ) ...@@ -106,6 +106,7 @@ void _M( input_getfunctions )( function_list_t * p_function_list )
input.pf_end = TSEnd; input.pf_end = TSEnd;
input.pf_init_bit_stream = InitBitstream; input.pf_init_bit_stream = InitBitstream;
input.pf_set_area = NULL; input.pf_set_area = NULL;
input.pf_set_area = input_SetProgram;
input.pf_read = TSRead; input.pf_read = TSRead;
input.pf_demux = input_DemuxTS; input.pf_demux = input_DemuxTS;
input.pf_new_packet = input_NetlistNewPacket; input.pf_new_packet = input_NetlistNewPacket;
......
...@@ -89,19 +89,20 @@ ...@@ -89,19 +89,20 @@
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
/* called from outside */ /* called from outside */
static int VCDProbe ( probedata_t *p_data ); static int VCDProbe ( probedata_t *p_data );
static void VCDInit ( struct input_thread_s * ); static void VCDInit ( struct input_thread_s * );
static int VCDRead ( struct input_thread_s *, data_packet_t ** ); static int VCDRead ( struct input_thread_s *, data_packet_t ** );
static int VCDSetArea ( struct input_thread_s *, struct input_area_s * ); static int VCDSetArea ( struct input_thread_s *, struct input_area_s * );
static void VCDOpen ( struct input_thread_s *); static int VCDSetProgram ( struct input_thread_s *, pgrm_descriptor_t * );
static void VCDClose ( struct input_thread_s *); static void VCDOpen ( struct input_thread_s *);
static void VCDEnd ( struct input_thread_s *); static void VCDClose ( struct input_thread_s *);
static void VCDSeek ( struct input_thread_s *, off_t ); static void VCDEnd ( struct input_thread_s *);
static int VCDRewind ( struct input_thread_s * ); static void VCDSeek ( struct input_thread_s *, off_t );
static int VCDRewind ( struct input_thread_s * );
static struct data_packet_s * NewPacket( void *, size_t ); static struct data_packet_s * NewPacket( void *, size_t );
static pes_packet_t * NewPES ( void * ); static pes_packet_t * NewPES ( void * );
static void DeletePacket ( void *, data_packet_t * ); static void DeletePacket ( void *, data_packet_t * );
static void DeletePES ( void *, pes_packet_t *); static void DeletePES ( void *, pes_packet_t *);
...@@ -112,21 +113,22 @@ static void DeletePES ( void *, pes_packet_t *); ...@@ -112,21 +113,22 @@ static void DeletePES ( void *, pes_packet_t *);
void _M( input_getfunctions )( function_list_t * p_function_list ) void _M( input_getfunctions )( function_list_t * p_function_list )
{ {
#define input p_function_list->functions.input #define input p_function_list->functions.input
p_function_list->pf_probe = VCDProbe ; p_function_list->pf_probe = VCDProbe;
input.pf_init = VCDInit ; input.pf_init = VCDInit;
input.pf_open = VCDOpen ; input.pf_open = VCDOpen;
input.pf_close = VCDClose ; input.pf_close = VCDClose;
input.pf_end = VCDEnd ; input.pf_end = VCDEnd;
input.pf_init_bit_stream = InitBitstream; input.pf_init_bit_stream = InitBitstream;
input.pf_read = VCDRead ; input.pf_read = VCDRead;
input.pf_set_area = VCDSetArea ; input.pf_set_area = VCDSetArea;
input.pf_set_program = VCDSetProgram;
input.pf_demux = input_DemuxPS; input.pf_demux = input_DemuxPS;
input.pf_new_packet = NewPacket; input.pf_new_packet = NewPacket;
input.pf_new_pes = NewPES; input.pf_new_pes = NewPES;
input.pf_delete_packet = DeletePacket; input.pf_delete_packet = DeletePacket;
input.pf_delete_pes = DeletePES; input.pf_delete_pes = DeletePES;
input.pf_rewind = VCDRewind ; input.pf_rewind = VCDRewind;
input.pf_seek = VCDSeek ; input.pf_seek = VCDSeek;
#undef input #undef input
} }
...@@ -409,6 +411,16 @@ static void VCDEnd( input_thread_t * p_input ) ...@@ -409,6 +411,16 @@ static void VCDEnd( input_thread_t * p_input )
} }
/*****************************************************************************
* VCDSetProgram: Does nothing since a VCD is mono_program
*****************************************************************************/
static int VCDSetProgram( input_thread_t * p_input,
pgrm_descriptor_t * p_program)
{
return 0;
}
/***************************************************************************** /*****************************************************************************
* VCDSetArea: initialize input data for title x, chapter y. * VCDSetArea: initialize input data for title x, chapter y.
* It should be called for each user navigation request. * It should be called for each user navigation request.
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* decoders. * decoders.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: input.c,v 1.161 2001/11/28 15:08:06 massiot Exp $ * $Id: input.c,v 1.162 2001/12/07 16:47:47 jobi Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -265,6 +265,29 @@ static void RunThread( input_thread_t *p_input ) ...@@ -265,6 +265,29 @@ static void RunThread( input_thread_t *p_input )
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
if( p_input->stream.p_new_program )
{
if( p_input->pf_set_program != NULL )
{
p_input->pf_set_program( p_input,
p_input->stream.p_new_program );
for( i = 0; i < p_input->stream.i_pgrm_number; i++ )
{
pgrm_descriptor_t * p_pgrm
= p_input->stream.pp_programs[i];
/* Escape all decoders for the stream discontinuity they
* will encounter. */
input_EscapeDiscontinuity( p_input, p_pgrm );
/* Reinitialize synchro. */
p_pgrm->i_synchro_state = SYNCHRO_REINIT;
}
}
p_input->stream.p_new_program = NULL;
}
if( p_input->stream.p_new_area ) if( p_input->stream.p_new_area )
{ {
if( p_input->stream.b_seekable && p_input->pf_set_area != NULL ) if( p_input->stream.b_seekable && p_input->pf_set_area != NULL )
...@@ -410,6 +433,7 @@ static int InitThread( input_thread_t * p_input ) ...@@ -410,6 +433,7 @@ static int InitThread( input_thread_t * p_input )
p_input->pf_init_bit_stream= f.pf_init_bit_stream; p_input->pf_init_bit_stream= f.pf_init_bit_stream;
p_input->pf_read = f.pf_read; p_input->pf_read = f.pf_read;
p_input->pf_set_area = f.pf_set_area; p_input->pf_set_area = f.pf_set_area;
p_input->pf_set_program = f.pf_set_program;
p_input->pf_demux = f.pf_demux; p_input->pf_demux = f.pf_demux;
p_input->pf_new_packet = f.pf_new_packet; p_input->pf_new_packet = f.pf_new_packet;
p_input->pf_new_pes = f.pf_new_pes; p_input->pf_new_pes = f.pf_new_pes;
...@@ -653,7 +677,7 @@ static void FileOpen( input_thread_t * p_input ) ...@@ -653,7 +677,7 @@ static void FileOpen( input_thread_t * p_input )
psz_name += 8; psz_name += 8;
i_stat = stat( psz_name, &stat_info ); i_stat = stat( psz_name, &stat_info );
} }
else if( ( i_size > 4 ) else if( ( i_size > 4 )
&& !strncasecmp( psz_name, "dvd:", 4 ) ) && !strncasecmp( psz_name, "dvd:", 4 ) )
{ {
/* get rid of the 'dvd:' stuff and try again */ /* get rid of the 'dvd:' stuff and try again */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_ext-intf.c: services to the interface * input_ext-intf.c: services to the interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: input_ext-intf.c,v 1.29 2001/11/28 15:08:06 massiot Exp $ * $Id: input_ext-intf.c,v 1.30 2001/12/07 16:47:47 jobi Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -333,6 +333,21 @@ int input_ChangeArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -333,6 +333,21 @@ int input_ChangeArea( input_thread_t * p_input, input_area_t * p_area )
return 0; return 0;
} }
/****************************************************************************
* input_ChangeProgram: interface request an area change
****************************************************************************/
int input_ChangeProgram( input_thread_t * p_input,
pgrm_descriptor_t * p_program )
{
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.p_new_program = p_program;
vlc_mutex_unlock( &p_input->stream.stream_lock );
return 0;
}
/**************************************************************************** /****************************************************************************
* input_ToggleGrayscale: change to grayscale or color output * input_ToggleGrayscale: change to grayscale or color output
****************************************************************************/ ****************************************************************************/
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management * input_programs.c: es_descriptor_t, pgrm_descriptor_t management
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: input_programs.c,v 1.67 2001/12/05 03:31:04 jobi Exp $ * $Id: input_programs.c,v 1.68 2001/12/07 16:47:47 jobi Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -302,6 +302,29 @@ input_area_t * input_AddArea( input_thread_t * p_input ) ...@@ -302,6 +302,29 @@ input_area_t * input_AddArea( input_thread_t * p_input )
return p_input->stream.pp_areas[i_area_index]; return p_input->stream.pp_areas[i_area_index];
} }
/*****************************************************************************
* input_SetProgram: changes the current program
*****************************************************************************/
int input_SetProgram( input_thread_t * p_input, pgrm_descriptor_t * p_new_prg )
{
int i_es_index;
#define old_prg p_input->stream.p_selected_program
for ( i_es_index = 0 ; i_es_index < old_prg->i_es_number ; i_es_index ++ )
{
input_UnselectES( p_input , old_prg->pp_es[i_es_index] );
}
#undef old_prg
for (i_es_index = 0 ; i_es_index < p_new_prg->i_es_number ; i_es_index ++ )
{
input_SelectES( p_input , p_new_prg->pp_es[i_es_index] );
}
p_input->stream.p_selected_program = p_new_prg;
return( 0 );
}
/***************************************************************************** /*****************************************************************************
* input_DelArea: destroy a area descriptor * input_DelArea: destroy a area descriptor
***************************************************************************** *****************************************************************************
......
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