Commit dbbc910f authored by Johan Bilien's avatar Johan Bilien

* Added 2 fields, p_selected_program and p_new_program, to the

  input_thread_t structure, so that we may support multi programs
  streams.
* Modified inputs to take account of this change.
* Modified input_clock.c so that it doesn't refer to pp_programs[0]
  any more.

Now we should not refer to the first program, but to the selected
program. Functions to change the current program are coming.
parent 63e5cfb0
...@@ -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.49 2001/11/25 22:52:21 gbazin Exp $ * $Id: input_ext-intf.h,v 1.50 2001/12/05 03:31:04 jobi Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -207,7 +207,9 @@ typedef struct stream_descriptor_s ...@@ -207,7 +207,9 @@ typedef struct stream_descriptor_s
/* Programs descriptions */ /* Programs descriptions */
int i_pgrm_number; /* size of the following array */ int i_pgrm_number; /* size of the following array */
pgrm_descriptor_t ** pp_programs; /* array of pointers to pgrm */ pgrm_descriptor_t ** pp_programs; /* array of pointers to pgrm */
pgrm_descriptor_t * p_selected_program; /* currently
selected program */
pgrm_descriptor_t * p_new_program; /* Newly selected program */
/* ES descriptions */ /* ES descriptions */
int i_es_number; int i_es_number;
es_descriptor_t ** pp_es; /* carried elementary streams */ es_descriptor_t ** pp_es; /* carried elementary streams */
......
...@@ -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.102 2001/11/28 15:08:05 massiot Exp $ * $Id: input_dvd.c,v 1.103 2001/12/05 03:31:04 jobi Exp $
* *
* Author: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -543,23 +543,25 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -543,23 +543,25 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
} }
free( p_input->stream.pp_selected_es ); free( p_input->stream.pp_selected_es );
input_DelProgram( p_input, p_input->stream.pp_programs[0] ); input_DelProgram( p_input, p_input->stream.p_selected_program );
p_input->stream.pp_selected_es = NULL; p_input->stream.pp_selected_es = NULL;
p_input->stream.i_selected_es_number = 0; p_input->stream.i_selected_es_number = 0;
} }
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.pp_programs[0];
/* No PSM to read in DVD mode, we already have all information */ /* No PSM to read in DVD mode, we already have all information */
p_input->stream.pp_programs[0]->b_is_ok = 1; p_input->stream.p_selected_program->b_is_ok = 1;
p_es = NULL; p_es = NULL;
/* ES 0 -> video MPEG2 */ /* ES 0 -> video MPEG2 */
IfoPrintVideo( p_dvd ); IfoPrintVideo( p_dvd );
p_es = input_AddES( p_input, p_input->stream.pp_programs[0], 0xe0, 0 ); p_es = input_AddES( p_input, p_input->stream.p_selected_program,
0xe0, 0 );
p_es->i_stream_id = 0xe0; p_es->i_stream_id = 0xe0;
p_es->i_type = MPEG2_VIDEO_ES; p_es->i_type = MPEG2_VIDEO_ES;
p_es->i_cat = VIDEO_ES; p_es->i_cat = VIDEO_ES;
...@@ -585,7 +587,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -585,7 +587,7 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
case 0x00: /* AC3 */ case 0x00: /* AC3 */
i_id = ( ( 0x80 + audio_status.i_position ) << 8 ) | 0xbd; i_id = ( ( 0x80 + audio_status.i_position ) << 8 ) | 0xbd;
p_es = input_AddES( p_input, p_es = input_AddES( p_input,
p_input->stream.pp_programs[0], i_id, 0 ); p_input->stream.p_selected_program, i_id, 0 );
p_es->i_stream_id = 0xbd; p_es->i_stream_id = 0xbd;
p_es->i_type = AC3_AUDIO_ES; p_es->i_type = AC3_AUDIO_ES;
p_es->b_audio = 1; p_es->b_audio = 1;
...@@ -599,7 +601,8 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -599,7 +601,8 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
case 0x03: /* MPEG audio */ case 0x03: /* MPEG audio */
i_id = 0xc0 + audio_status.i_position; i_id = 0xc0 + audio_status.i_position;
p_es = input_AddES( p_input, p_es = input_AddES( p_input,
p_input->stream.pp_programs[0], i_id, 0 ); p_input->stream.p_selected_program, i_id
, 0 );
p_es->i_stream_id = i_id; p_es->i_stream_id = i_id;
p_es->i_type = MPEG2_AUDIO_ES; p_es->i_type = MPEG2_AUDIO_ES;
p_es->b_audio = 1; p_es->b_audio = 1;
...@@ -613,7 +616,8 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -613,7 +616,8 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
i_id = ( ( 0xa0 + audio_status.i_position ) << 8 ) | 0xbd; i_id = ( ( 0xa0 + audio_status.i_position ) << 8 ) | 0xbd;
p_es = input_AddES( p_input, p_es = input_AddES( p_input,
p_input->stream.pp_programs[0], i_id, 0 ); p_input->stream.p_selected_program,
i_id, 0 );
p_es->i_stream_id = 0xbd; p_es->i_stream_id = 0xbd;
p_es->i_type = LPCM_AUDIO_ES; p_es->i_type = LPCM_AUDIO_ES;
p_es->b_audio = 1; p_es->b_audio = 1;
...@@ -676,7 +680,8 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area ) ...@@ -676,7 +680,8 @@ static int DVDSetArea( input_thread_t * p_input, input_area_t * p_area )
| 0xbd; | 0xbd;
} }
p_es = input_AddES( p_input, p_es = input_AddES( p_input,
p_input->stream.pp_programs[0], i_id, 0 ); p_input->stream.p_selected_program,
i_id, 0 );
p_es->i_stream_id = 0xbd; p_es->i_stream_id = 0xbd;
p_es->i_type = DVD_SPU_ES; p_es->i_type = DVD_SPU_ES;
p_es->i_cat = SPU_ES; p_es->i_cat = SPU_ES;
......
...@@ -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.41 2001/12/03 17:55:45 massiot Exp $ * $Id: input_ps.c,v 1.42 2001/12/05 03:31:04 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>
...@@ -234,7 +234,12 @@ static void PSInit( input_thread_t * p_input ) ...@@ -234,7 +234,12 @@ static void PSInit( input_thread_t * p_input )
/* FIXME : detect if InitStream failed */ /* FIXME : detect if InitStream failed */
input_InitStream( p_input, sizeof( stream_ps_data_t ) ); input_InitStream( p_input, sizeof( stream_ps_data_t ) );
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.pp_programs[0] ;
p_input->stream.p_new_program =
p_input->stream.pp_programs[0] ;
if( p_input->stream.b_seekable ) if( p_input->stream.b_seekable )
{ {
stream_ps_data_t * p_demux_data = stream_ps_data_t * p_demux_data =
......
...@@ -361,12 +361,13 @@ static void VCDInit( input_thread_t * p_input ) ...@@ -361,12 +361,13 @@ static void VCDInit( input_thread_t * p_input )
/* Set program information. */ /* Set program information. */
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.pp_programs[0];
/* No PSM to read in disc mode, we already have all information */ /* No PSM to read in disc mode, we already have all information */
p_input->stream.pp_programs[0]->b_is_ok = 1; p_input->stream.p_selected_program->b_is_ok = 1;
p_es = input_AddES( p_input, p_input->stream.pp_programs[0], 0xe0, 0 ); p_es = input_AddES( p_input, p_input->stream.p_selected_program, 0xe0, 0 );
p_es->i_stream_id = 0xe0; p_es->i_stream_id = 0xe0;
p_es->i_type = MPEG1_VIDEO_ES; p_es->i_type = MPEG1_VIDEO_ES;
p_es->i_cat = VIDEO_ES; p_es->i_cat = VIDEO_ES;
...@@ -377,7 +378,7 @@ static void VCDInit( input_thread_t * p_input ) ...@@ -377,7 +378,7 @@ static void VCDInit( input_thread_t * p_input )
} }
p_es = input_AddES( p_input, p_es = input_AddES( p_input,
p_input->stream.pp_programs[0], 0xc0, 0 ); p_input->stream.p_selected_program, 0xc0, 0 );
p_es->i_stream_id = 0xc0; p_es->i_stream_id = 0xc0;
p_es->i_type = MPEG1_AUDIO_ES; p_es->i_type = MPEG1_AUDIO_ES;
p_es->b_audio = 1; p_es->b_audio = 1;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_clock.c: Clock/System date convertions, stream management * input_clock.c: Clock/System date convertions, stream management
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: input_clock.c,v 1.24 2001/11/28 15:08:06 massiot Exp $ * $Id: input_clock.c,v 1.25 2001/12/05 03:31:04 jobi Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -232,7 +232,7 @@ void input_ClockManageRef( input_thread_t * p_input, ...@@ -232,7 +232,7 @@ void input_ClockManageRef( input_thread_t * p_input,
p_pgrm->i_synchro_state = SYNCHRO_OK; p_pgrm->i_synchro_state = SYNCHRO_OK;
if( p_input->stream.b_pace_control if( p_input->stream.b_pace_control
&& p_input->stream.pp_programs[0] == p_pgrm ) && p_input->stream.p_selected_program == p_pgrm )
{ {
p_pgrm->last_cr = i_clock; p_pgrm->last_cr = i_clock;
mwait( ClockToSysdate( p_input, p_pgrm, i_clock ) ); mwait( ClockToSysdate( p_input, p_pgrm, i_clock ) );
...@@ -263,7 +263,7 @@ void input_ClockManageRef( input_thread_t * p_input, ...@@ -263,7 +263,7 @@ void input_ClockManageRef( input_thread_t * p_input,
p_pgrm->last_cr = i_clock; p_pgrm->last_cr = i_clock;
if( p_input->stream.b_pace_control if( p_input->stream.b_pace_control
&& p_input->stream.pp_programs[0] == p_pgrm ) && p_input->stream.p_selected_program == p_pgrm )
{ {
/* We remember the last system date to be able to restart /* We remember the last system date to be able to restart
* the synchro we statistically better continuity, after * the synchro we statistically better continuity, after
......
...@@ -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.66 2001/11/28 15:08:06 massiot Exp $ * $Id: input_programs.c,v 1.67 2001/12/05 03:31:04 jobi Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -65,7 +65,9 @@ int input_InitStream( input_thread_t * p_input, size_t i_data_len ) ...@@ -65,7 +65,9 @@ int input_InitStream( input_thread_t * p_input, size_t i_data_len )
p_input->stream.p_removed_es = NULL; p_input->stream.p_removed_es = NULL;
p_input->stream.p_newly_selected_es = NULL; p_input->stream.p_newly_selected_es = NULL;
p_input->stream.pp_programs = NULL; p_input->stream.pp_programs = NULL;
p_input->stream.p_selected_program = NULL;
p_input->stream.p_new_program = NULL;
if( i_data_len ) if( i_data_len )
{ {
if ( (p_input->stream.p_demux_data = malloc( i_data_len )) == NULL ) if ( (p_input->stream.p_demux_data = malloc( i_data_len )) == NULL )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mpeg_system.c: TS, PS and PES management * mpeg_system.c: TS, PS and PES management
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: mpeg_system.c,v 1.67 2001/12/03 17:55:45 massiot Exp $ * $Id: mpeg_system.c,v 1.68 2001/12/05 03:31:04 jobi Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr> * Michel Lespinasse <walken@via.ecp.fr>
...@@ -1378,6 +1378,8 @@ static void input_DecodePAT( input_thread_t * p_input, es_descriptor_t * p_es ) ...@@ -1378,6 +1378,8 @@ static void input_DecodePAT( input_thread_t * p_input, es_descriptor_t * p_es )
} }
#undef p_psi #undef p_psi
/* FIXME This has nothing to do here */
p_input->stream.p_selected_program = p_input->stream.pp_programs[0] ;
} }
......
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