* modules/gui/wxwindows/menus.cpp: use the "foo-es" object variables.
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_ext-intf.h,v 1.88 2003/04/13 20:00:20 fenrir Exp $
+ * $Id: input_ext-intf.h,v 1.89 2003/05/05 22:23:31 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
uint8_t i_cat; /* stream category (audio, video, spu) */
int i_demux_fd; /* used to store demux device
file handle */
- char psz_desc[20]; /* description of ES: audio language
+ char *psz_desc; /* description of ES: audio language
* for instance ; NULL if not
* available */
* but exported to plug-ins
*****************************************************************************
* Copyright (C) 1999-2002 VideoLAN
- * $Id: input_ext-plugins.h,v 1.41 2003/03/11 23:56:53 gbazin Exp $
+ * $Id: input_ext-plugins.h,v 1.42 2003/05/05 22:23:31 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
VLC_EXPORT( input_area_t *, input_AddArea,( input_thread_t *, uint16_t, uint16_t ) );
VLC_EXPORT( void, input_DelArea, ( input_thread_t *, input_area_t * ) );
VLC_EXPORT( es_descriptor_t *, input_FindES,( input_thread_t *, uint16_t ) );
-VLC_EXPORT( es_descriptor_t *, input_AddES, ( input_thread_t *, pgrm_descriptor_t *, uint16_t, size_t ) );
+VLC_EXPORT( es_descriptor_t *, input_AddES, ( input_thread_t *, pgrm_descriptor_t *, uint16_t, int, char const *, size_t ) );
VLC_EXPORT( void, input_DelES, ( input_thread_t *, es_descriptor_t * ) );
VLC_EXPORT( int, input_SelectES, ( input_thread_t *, es_descriptor_t * ) );
VLC_EXPORT( int, input_UnselectES,( input_thread_t *, es_descriptor_t * ) );
/* es.c: functions to find and select ES
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: es.c,v 1.4 2002/12/06 16:34:04 sam Exp $
+ * $Id: es.c,v 1.5 2003/05/05 22:23:32 gbazin Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
#define vmg p_dvd->p_ifo->vmg
#define vts p_dvd->p_ifo->vts
-#define ADDES( stream_id, private_id, fourcc, cat, lang, size ) \
+#define ADDES( stream_id, private_id, fourcc, cat, lang, descr, size ) \
i_id = ( (private_id) << 8 ) | (stream_id); \
- p_es = input_AddES( p_input, NULL, i_id, size ); \
- p_es->i_stream_id = (stream_id); \
- p_es->i_fourcc = (fourcc); \
- p_es->i_cat = (cat); \
- if( lang ) \
{ \
- strcpy( p_es->psz_desc, DecodeLanguage( lang ) ); \
- }
+ char *psz_descr; \
+ psz_descr = malloc( strlen(DecodeLanguage( lang )) + \
+ strlen(descr) + 1 ); \
+ if( psz_descr ) {strcpy( psz_descr, DecodeLanguage( lang ) ); \
+ strcat( psz_descr, descr );} \
+ p_es = input_AddES( p_input, NULL, i_id, cat, \
+ psz_descr, size ); \
+ if( psz_descr ) free( psz_descr ); \
+ } \
+ p_es->i_stream_id = (stream_id); \
+ p_es->i_fourcc = (fourcc);
/*****************************************************************************
if( i_ratio )
{
- ADDES( 0xe0, 0, VLC_FOURCC('m','p','g','v'), VIDEO_ES, 0, sizeof(int) );
+ ADDES( 0xe0, 0, VLC_FOURCC('m','p','g','v'), VIDEO_ES, 0,
+ "", sizeof(int) );
*(int*)(p_es->p_demux_data) = i_ratio;
}
else
{
- ADDES( 0xe0, 0, VLC_FOURCC('m','p','g','v'), VIDEO_ES, 0, 0 );
+ ADDES( 0xe0, 0, VLC_FOURCC('m','p','g','v'), VIDEO_ES, 0, "", 0 );
}
}
{
case 0x00: /* A52 */
ADDES( 0xbd, 0x80 + audio_status.i_position,
- VLC_FOURCC('a','5','2','b'), AUDIO_ES, i_lang, 0 );
- strcat( p_es->psz_desc, " (A52)" );
+ VLC_FOURCC('a','5','2','b'), AUDIO_ES, i_lang,
+ " (A52)", 0 );
break;
case 0x02:
case 0x03: /* MPEG audio */
ADDES( 0xc0 + audio_status.i_position, 0,
- VLC_FOURCC('m','p','g','a'), AUDIO_ES, i_lang, 0 );
- strcat( p_es->psz_desc, " (mpeg)" );
+ VLC_FOURCC('m','p','g','a'), AUDIO_ES, i_lang,
+ " (mpeg)", 0 );
break;
case 0x04: /* LPCM */
ADDES( 0xbd, 0xa0 + audio_status.i_position,
- VLC_FOURCC('l','p','c','b'), AUDIO_ES, i_lang, 0 );
- strcat( p_es->psz_desc, " (lpcm)" );
+ VLC_FOURCC('l','p','c','b'), AUDIO_ES, i_lang,
+ " (lpcm)", 0 );
break;
case 0x06: /* DTS */
ADDES( 0xbd, 0x88 + audio_status.i_position,
- VLC_FOURCC('d','t','s','b'), AUDIO_ES, i_lang, 0 );
- strcat( p_es->psz_desc, " (dts)" );
+ VLC_FOURCC('d','t','s','b'), AUDIO_ES, i_lang,
+ " (dts)", 0 );
break;
default:
if( vmg.title.pi_yuv_color )
{
ADDES( 0xbd, 0x20 + i_id, VLC_FOURCC('s','p','u','b'), SPU_ES,
- vts.manager_inf.p_spu_attr[i-1].i_lang_code,
+ vts.manager_inf.p_spu_attr[i-1].i_lang_code, "",
sizeof(int) + 16*sizeof(u32) );
*(int*)p_es->p_demux_data = 0xBeeF;
memcpy( (char*)p_es->p_demux_data + sizeof(int),
else
{
ADDES( 0xbd, 0x20 + i_id, VLC_FOURCC('s','p','u','b'), SPU_ES,
- vts.manager_inf.p_spu_attr[i-1].i_lang_code, 0 );
+ vts.manager_inf.p_spu_attr[i-1].i_lang_code, "", 0 );
}
}
}
* es.c: functions to handle elementary streams.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: es.c,v 1.5 2003/01/29 11:17:44 gbazin Exp $
+ * $Id: es.c,v 1.6 2003/05/05 22:23:32 gbazin Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
}
-#define ADDES( id, fourcc, cat, lang, size ) \
+#define ADDES( id, fourcc, cat, lang, descr, size ) \
msg_Dbg( p_input, "new es 0x%x", i_id ); \
- p_es = input_AddES( p_input, NULL, id, size ); \
- p_es->i_stream_id = i_id & 0xff; \
- p_es->i_fourcc = (fourcc); \
- p_es->i_cat = (cat); \
- if( lang ) \
{ \
- strcpy( p_es->psz_desc, DecodeLanguage( lang ) ); \
- }
+ char *psz_descr; \
+ psz_descr = malloc( strlen(DecodeLanguage( lang )) + \
+ strlen(descr) + 1 ); \
+ if( psz_descr ) {strcpy( psz_descr, DecodeLanguage( lang ) ); \
+ strcat( psz_descr, descr );} \
+ p_es = input_AddES( p_input, NULL, id, cat, \
+ psz_descr, size ); \
+ if( psz_descr ) free( psz_descr ); \
+ } \
+ p_es->i_stream_id = i_id & 0xff; \
+ p_es->i_fourcc = (fourcc);
/*****************************************************************************
* dvdplay_Video: read video ES
if( p_attr->display_aspect_ratio )
{
- ADDES( 0xe0, VLC_FOURCC('m','p','g','v'), VIDEO_ES, 0, sizeof(int) );
+ ADDES( 0xe0, VLC_FOURCC('m','p','g','v'), VIDEO_ES, 0,
+ "", sizeof(int) );
*(int*)(p_es->p_demux_data) = p_attr->display_aspect_ratio;
}
else
{
- ADDES( 0xe0, VLC_FOURCC('m','p','g','v'), VIDEO_ES, 0, 0 );
+ ADDES( 0xe0, VLC_FOURCC('m','p','g','v'), VIDEO_ES, 0, "", 0 );
}
}
switch( p_attr->audio_format )
{
case 0x00: /* A52 */
- ADDES( i_id, VLC_FOURCC('a','5','2','b'), AUDIO_ES, i_lang, 0 );
- strcat( p_es->psz_desc, " (A52)" );
+ ADDES( i_id, VLC_FOURCC('a','5','2','b'), AUDIO_ES, i_lang,
+ " (A52)", 0 );
break;
case 0x02:
case 0x03: /* MPEG audio */
- ADDES( i_id, VLC_FOURCC('m','p','g','a'), AUDIO_ES, i_lang, 0 );
- strcat( p_es->psz_desc, " (mpeg)" );
+ ADDES( i_id, VLC_FOURCC('m','p','g','a'), AUDIO_ES, i_lang,
+ " (mpeg)", 0 );
break;
case 0x04: /* LPCM */
- ADDES( i_id, VLC_FOURCC('l','p','c','b'), AUDIO_ES, i_lang, 0 );
- strcat( p_es->psz_desc, " (lpcm)" );
+ ADDES( i_id, VLC_FOURCC('l','p','c','b'), AUDIO_ES, i_lang,
+ " (lpcm)", 0 );
break;
case 0x05: /* SDDS */
- ADDES( i_id, VLC_FOURCC('s','d','d','b'), AUDIO_ES, i_lang, 0 );
- strcat( p_es->psz_desc, " (sdds)" );
+ ADDES( i_id, VLC_FOURCC('s','d','d','b'), AUDIO_ES, i_lang,
+ " (sdds)", 0 );
break;
case 0x06: /* DTS */
- ADDES( i_id, VLC_FOURCC('d','t','s','b'), AUDIO_ES, i_lang, 0 );
- strcat( p_es->psz_desc, " (dts)" );
+ ADDES( i_id, VLC_FOURCC('d','t','s','b'), AUDIO_ES, i_lang,
+ " (dts)", 0 );
break;
default:
if( pi_palette )
{
ADDES( i_id, VLC_FOURCC('s','p','u','b'), SPU_ES,
- p_attr->lang_code, sizeof(int) + 16*sizeof(u32) );
+ p_attr->lang_code, "", sizeof(int) + 16*sizeof(u32) );
*(int*)p_es->p_demux_data = 0xBeeF;
memcpy( (void*)p_es->p_demux_data + sizeof(int),
pi_palette, 16*sizeof(u32) );
else
{
ADDES( i_id, VLC_FOURCC('s','p','u','b'), SPU_ES,
- p_attr->lang_code, 0 );
+ p_attr->lang_code, "", 0 );
}
}
}
* It depends on: libdvdread for ifo files and block reading.
*****************************************************************************
* Copyright (C) 2001, 2003 VideoLAN
- * $Id: input.c,v 1.20 2003/05/04 22:42:14 gbazin Exp $
+ * $Id: input.c,v 1.21 2003/05/05 22:23:33 gbazin Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
/* ES 0 -> video MPEG2 */
// IfoPrintVideo( p_dvd );
- p_es = input_AddES( p_input, NULL, 0xe0, 0 );
+ p_es = input_AddES( p_input, NULL, 0xe0, VIDEO_ES, NULL, 0 );
p_es->i_stream_id = 0xe0;
p_es->i_fourcc = VLC_FOURCC('m','p','g','v');
- p_es->i_cat = VIDEO_ES;
#define audio_control \
p_dvd->p_vts_file->vts_pgcit->pgci_srp[pgc_id-1].pgc->audio_control[i-1]
i_audio_nb++;
i_position = ( audio_control & 0x7F00 ) >> 8;
- msg_Dbg( p_input, "audio position %d", i_position );
+ msg_Dbg( p_input, "audio position %d", i_position );
switch( p_vts->vtsi_mat->vts_audio_attr[i-1].audio_format )
{
case 0x00: /* A52 */
i_id = ( ( 0x80 + i_position ) << 8 ) | 0xbd;
- p_es = input_AddES( p_input, NULL, i_id, 0 );
+ p_es = input_AddES( p_input, NULL, i_id, AUDIO_ES,
+ DecodeLanguage(
+ p_vts->vtsi_mat->vts_audio_attr[i-1].lang_code ), 0 );
p_es->i_stream_id = 0xbd;
p_es->i_fourcc = VLC_FOURCC('a','5','2','b');
- p_es->i_cat = AUDIO_ES;
- strcpy( p_es->psz_desc, DecodeLanguage(
- p_vts->vtsi_mat->vts_audio_attr[i-1].lang_code ) );
- strcat( p_es->psz_desc, " (A52)" );
break;
case 0x02:
case 0x03: /* MPEG audio */
i_id = 0xc0 + i_position;
- p_es = input_AddES( p_input, NULL, i_id, 0 );
+ p_es = input_AddES( p_input, NULL, i_id, AUDIO_ES,
+ DecodeLanguage(
+ p_vts->vtsi_mat->vts_audio_attr[i-1].lang_code ), 0 );
p_es->i_stream_id = i_id;
p_es->i_fourcc = VLC_FOURCC('m','p','g','a');
- p_es->i_cat = AUDIO_ES;
- strcpy( p_es->psz_desc, DecodeLanguage(
- p_vts->vtsi_mat->vts_audio_attr[i-1].lang_code ) );
- strcat( p_es->psz_desc, " (mpeg)" );
break;
case 0x04: /* LPCM */
i_id = ( ( 0xa0 + i_position ) << 8 ) | 0xbd;
- p_es = input_AddES( p_input, NULL, i_id, 0 );
+ p_es = input_AddES( p_input, NULL, i_id, AUDIO_ES,
+ DecodeLanguage(
+ p_vts->vtsi_mat->vts_audio_attr[i-1].lang_code ), 0 );
p_es->i_stream_id = i_id;
p_es->i_fourcc = VLC_FOURCC('l','p','c','b');
- p_es->i_cat = AUDIO_ES;
- strcpy( p_es->psz_desc, DecodeLanguage(
- p_vts->vtsi_mat->vts_audio_attr[i-1].lang_code ) );
- strcat( p_es->psz_desc, " (lpcm)" );
break;
case 0x06: /* DTS */
}
i_id = ( ( 0x20 + i_position ) << 8 ) | 0xbd;
- p_es = input_AddES( p_input, NULL, i_id, 0 );
+ p_es = input_AddES( p_input, NULL, i_id, SPU_ES,
+ DecodeLanguage(
+ p_vts->vtsi_mat->vts_subp_attr[i-1].lang_code ), 0 );
p_es->i_stream_id = 0xbd;
p_es->i_fourcc = VLC_FOURCC('s','p','u','b');
- p_es->i_cat = SPU_ES;
- strcpy( p_es->psz_desc, DecodeLanguage(
- p_vts->vtsi_mat->vts_subp_attr[i-1].lang_code ) );
}
}
#undef spu_control
* v4l.c : Video4Linux input module for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: v4l.c,v 1.12 2003/05/03 12:36:17 fenrir Exp $
+ * $Id: v4l.c,v 1.13 2003/05/05 22:23:33 gbazin Exp $
*
* Author: Samuel Hocevar <sam@zoy.org>
*
{
es_descriptor_t *p_es;
- p_es = input_AddES( p_input,
- p_input->stream.pp_programs[0], i + 1, 0 );
- p_es->i_stream_id = i + 1;
if( !strncmp( p_peek, "auds", 4 ) )
{
#define wf ((WAVEFORMATEX*)p_es->p_waveformatex)
- p_es->i_cat = AUDIO_ES;
+ p_es = input_AddES( p_input, p_input->stream.pp_programs[0],
+ i + 1, AUDIO_ES, NULL, 0 );
+ p_es->i_stream_id = i + 1;
p_es->i_fourcc =
VLC_FOURCC( p_peek[4], p_peek[5], p_peek[6], p_peek[7] );
else if( !strncmp( p_peek, "vids", 4 ) )
{
#define bih ((BITMAPINFOHEADER*)p_es->p_bitmapinfoheader)
- p_es->i_cat = VIDEO_ES;
+ p_es = input_AddES( p_input, p_input->stream.pp_programs[0],
+ i + 1, VIDEO_ES, NULL, 0 );
+ p_es->i_stream_id = i + 1;
p_es->i_fourcc =
VLC_FOURCC( p_peek[4], p_peek[5], p_peek[6], p_peek[7] );
* rc.c : remote control stdin/stdout plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: rc.c,v 1.31 2003/05/04 22:42:15 gbazin Exp $
+ * $Id: rc.c,v 1.32 2003/05/05 22:23:34 gbazin Exp $
*
* Authors: Peter Surda <shurdeek@panorama.sth.ac.at>
*
text.p_list->p_values[i].psz_string );
}
var_Change( (vlc_object_t *)p_aout, psz_variable, VLC_VAR_FREELIST,
- &val, NULL );
+ &val, &text );
printf( "+----[ end of %s ]\n", val_name.psz_string );
if( val_name.psz_string ) free( val_name.psz_string );
* a52sys.c : A/52 input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: a52sys.c,v 1.2 2003/02/27 13:19:43 gbazin Exp $
+ * $Id: a52sys.c,v 1.3 2003/05/05 22:23:34 gbazin Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
input_AddProgram( p_input, 0, 0 );
p_input->stream.p_selected_program = p_input->stream.pp_programs[0];
vlc_mutex_lock( &p_input->stream.stream_lock );
- p_es = input_AddES( p_input, p_input->stream.p_selected_program, 0xBD, 0 );
+ p_es = input_AddES( p_input, p_input->stream.p_selected_program, 0xBD,
+ AUDIO_ES, NULL, 0 );
p_es->i_stream_id = 0xBD;
p_es->i_fourcc = VLC_FOURCC('a','5','2',' ');
- p_es->i_cat = AUDIO_ES;
input_SelectES( p_input, p_es );
p_input->stream.p_selected_area->i_tell = 0;
p_input->stream.p_selected_program->b_is_ok = 1;
* demux.c : Raw aac Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: demux.c,v 1.7 2003/03/30 18:14:37 gbazin Exp $
+ * $Id: demux.c,v 1.8 2003/05/05 22:23:34 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
p_input->stream.p_selected_program = p_input->stream.pp_programs[0];
/* create our ES */
- p_aac->p_es = input_AddES( p_input,
- p_input->stream.p_selected_program,
- 1, /* id */
- 0 );
+ p_aac->p_es = input_AddES( p_input, p_input->stream.p_selected_program,
+ 1 /* id */, AUDIO_ES, NULL, 0 );
if( !p_aac->p_es )
{
vlc_mutex_unlock( &p_input->stream.stream_lock );
p_aac->p_es->i_stream_id = 1;
p_aac->p_es->i_fourcc = VLC_FOURCC( 'm', 'p', '4', 'a' );
- p_aac->p_es->i_cat = AUDIO_ES;
input_SelectES( p_input, p_aac->p_es );
p_input->stream.p_selected_program->b_is_ok = 1;
* asf.c : ASFv01 file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: asf.c,v 1.27 2003/04/24 20:26:32 fenrir Exp $
+ * $Id: asf.c,v 1.28 2003/05/05 22:23:35 gbazin Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
p_stream->p_sp = p_sp;
vlc_mutex_lock( &p_input->stream.stream_lock );
- p_stream->p_es =
- input_AddES( p_input,
- p_input->stream.p_selected_program,
- p_sp->i_stream_number,
- 0 );
+ p_stream->p_es = NULL;
vlc_mutex_unlock( &p_input->stream.stream_lock );
if( CmpGUID( &p_sp->i_stream_type, &asf_object_stream_type_audio ) )
}
p_stream->i_cat = AUDIO_ES;
+ p_stream->p_es = input_AddES( p_input,
+ p_input->stream.p_selected_program,
+ p_sp->i_stream_number, AUDIO_ES, NULL, 0 );
+
input_AddInfo( p_cat, _("Type"), _("Audio") );
msg_Dbg( p_input,
"adding new audio stream(codec:0x%x,ID:%d)",
if( CmpGUID( &p_sp->i_stream_type, &asf_object_stream_type_video ) )
{
p_stream->i_cat = VIDEO_ES;
+ p_stream->p_es = input_AddES( p_input,
+ p_input->stream.p_selected_program,
+ p_sp->i_stream_number, VIDEO_ES, NULL, 0 );
+
input_AddInfo( p_cat, _("Type"), _("Video") );
- msg_Dbg( p_input,
- "adding new video stream(ID:%d)",
- p_sp->i_stream_number );
+ msg_Dbg( p_input, "adding new video stream(ID:%d)",
+ p_sp->i_stream_number );
if( p_sp->p_type_specific_data )
{
p_stream->p_es->i_fourcc =
else
{
p_stream->i_cat = UNKNOWN_ES;
- msg_Dbg( p_input,
- "ignoring unknown stream(ID:%d)",
- p_sp->i_stream_number );
- p_stream->p_es->i_fourcc = VLC_FOURCC( 'u','n','d','f' );
+ msg_Dbg( p_input, "ignoring unknown stream(ID:%d)",
+ p_sp->i_stream_number );
}
- p_stream->p_es->i_cat = p_stream->i_cat;
vlc_mutex_lock( &p_input->stream.stream_lock );
- if( p_stream->p_es->i_fourcc != VLC_FOURCC( 'u','n','d','f' ) )
+ if( p_stream->p_es )
{
input_SelectES( p_input, p_stream->p_es );
}
* au.c : au file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: au.c,v 1.1 2003/03/11 07:03:16 fenrir Exp $
+ * $Id: au.c,v 1.2 2003/05/05 22:23:34 gbazin Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
p_input->stream.p_selected_program = p_input->stream.pp_programs[0];
p_input->stream.i_mux_rate = wf.nAvgBytesPerSec / 50;
- p_es = input_AddES( p_input,
- p_input->stream.p_selected_program,
- 0x01,
- 0 );
+ p_es = input_AddES( p_input, p_input->stream.p_selected_program,
+ 0x01, AUDIO_ES, NULL, 0 );
p_es->i_stream_id = 0x01;
- p_es->i_cat = AUDIO_ES;
p_es->i_fourcc = i_codec;
p_es->p_waveformatex= malloc( sizeof( WAVEFORMATEX ) );
memcpy( p_es->p_waveformatex,
* avi.c : AVI file Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: avi.c,v 1.46 2003/05/03 01:12:13 fenrir Exp $
+ * $Id: avi.c,v 1.47 2003/05/05 22:23:35 gbazin Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
/* add one ES */
vlc_mutex_lock( &p_input->stream.stream_lock );
p_info->p_es =
- p_es = input_AddES( p_input,
- p_input->stream.p_selected_program, 1+i,
- 0 );
+ p_es = input_AddES( p_input, p_input->stream.p_selected_program,
+ 1+i, p_info->i_cat, NULL, 0 );
vlc_mutex_unlock( &p_input->stream.stream_lock );
p_es->i_stream_id =i; /* XXX: i don't use it */
p_es->i_fourcc = p_info->i_fourcc;
- p_es->i_cat = p_info->i_cat;
if( p_es->i_cat == AUDIO_ES )
{
if( i_init_size < sizeof( WAVEFORMATEX ) )
* a52sys.c : A/52 input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: flac.c,v 1.2 2003/02/27 13:19:43 gbazin Exp $
+ * $Id: flac.c,v 1.3 2003/05/05 22:23:34 gbazin Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
input_AddProgram( p_input, 0, 0 );
p_input->stream.p_selected_program = p_input->stream.pp_programs[0];
vlc_mutex_lock( &p_input->stream.stream_lock );
- p_es = input_AddES( p_input, p_input->stream.p_selected_program, 0xBD, 0 );
+ p_es = input_AddES( p_input, p_input->stream.p_selected_program, 0xBD,
+ AUDIO_ES, NULL, 0 );
p_es->i_stream_id = 0xBD;
p_es->i_fourcc = VLC_FOURCC('f','l','a','c');
- p_es->i_cat = AUDIO_ES;
input_SelectES( p_input, p_es );
p_input->stream.p_selected_area->i_tell = 0;
p_input->stream.p_selected_program->b_is_ok = 1;
* mp4.c : MP4 file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: mp4.c,v 1.27 2003/04/30 21:45:52 fenrir Exp $
+ * $Id: mp4.c,v 1.28 2003/05/05 22:23:36 gbazin Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
{
MP4_Box_t * p_sample;
unsigned int i;
+ char psz_lang[4];
unsigned int i_decoder_specific_info_len;
uint8_t * p_decoder_specific_info;
}
}
-
- vlc_mutex_lock( &p_input->stream.stream_lock );
- p_es = input_AddES( p_input,
- p_input->stream.p_selected_program,
- p_track->i_track_ID,
- 0 );
- vlc_mutex_unlock( &p_input->stream.stream_lock );
/* Initialise ES, first language as description */
for( i = 0; i < 3; i++ )
{
- p_es->psz_desc[i] = p_track->i_language[i];
+ psz_lang[i] = p_track->i_language[i];
}
- p_es->psz_desc[3] = '\0';
+ psz_lang[3] = '\0';
+
+ vlc_mutex_lock( &p_input->stream.stream_lock );
+ p_es = input_AddES( p_input, p_input->stream.p_selected_program,
+ p_track->i_track_ID, p_track->i_cat, psz_lang, 0 );
+ vlc_mutex_unlock( &p_input->stream.stream_lock );
p_es->i_stream_id = p_track->i_track_ID;
break;
}
- p_es->i_cat = p_track->i_cat;
-
i_decoder_specific_info_len = 0;
p_decoder_specific_info = NULL;
p_pes_init = NULL;
* audio.c : mpeg audio Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: audio.c,v 1.17 2003/04/26 20:51:54 fenrir Exp $
+ * $Id: audio.c,v 1.18 2003/05/05 22:23:36 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
p_input->stream.p_selected_program = p_input->stream.pp_programs[0];
/* create our ES */
- p_demux->p_es = input_AddES( p_input,
- p_input->stream.p_selected_program,
- 1, /* id */
- 0 );
+ p_demux->p_es = input_AddES( p_input, p_input->stream.p_selected_program,
+ 1 /* id */, AUDIO_ES, NULL, 0 );
if( !p_demux->p_es )
{
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
p_demux->p_es->i_stream_id = 1;
p_demux->p_es->i_fourcc = VLC_FOURCC('m','p','g','a');
- p_demux->p_es->i_cat = AUDIO_ES;
input_SelectES( p_input, p_demux->p_es );
* mpeg_es.c : Elementary Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: es.c,v 1.2 2002/11/20 13:37:36 sam Exp $
+ * $Id: es.c,v 1.3 2003/05/05 22:23:36 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
input_AddProgram( p_input, 0, 0 );
p_input->stream.p_selected_program = p_input->stream.pp_programs[0];
vlc_mutex_lock( &p_input->stream.stream_lock );
- p_es = input_AddES( p_input, p_input->stream.p_selected_program, 0xE0, 0 );
+ p_es = input_AddES( p_input, p_input->stream.p_selected_program, 0xE0,
+ VIDEO_ES, NULL, 0 );
p_es->i_stream_id = 0xE0;
p_es->i_fourcc = VLC_FOURCC('m','p','g','v');
- p_es->i_cat = VIDEO_ES;
input_SelectES( p_input, p_es );
p_input->stream.p_selected_area->i_tell = 0;
p_input->stream.p_selected_program->b_is_ok = 1;
* m4v.c : MPEG-4 video Stream input module for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: m4v.c,v 1.4 2003/03/30 18:14:37 gbazin Exp $
+ * $Id: m4v.c,v 1.5 2003/05/05 22:23:36 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
/* create our ES */
p_demux->p_es = input_AddES( p_input,
p_input->stream.p_selected_program,
- 1, /* id */
- 0 );
+ 1 /* id */, VIDEO_ES, NULL, 0 );
if( !p_demux->p_es )
{
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
p_demux->p_es->i_stream_id = 1;
p_demux->p_es->i_fourcc = VLC_FOURCC('m','p','4','v');
- p_demux->p_es->i_cat = VIDEO_ES;
input_SelectES( p_input, p_demux->p_es );
* system.c: helper module for TS, PS and PES management
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: system.c,v 1.13 2003/04/01 10:46:35 massiot Exp $
+ * $Id: system.c,v 1.14 2003/05/05 22:23:36 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
* so that we can close them more easily at the end. */
if( p_es == NULL )
{
- p_es = input_AddES( p_input, p_input->stream.pp_programs[0],
- i_stream_id, 0 );
+ int i_fourcc, i_cat;
+
switch( p_byte[0] )
{
case MPEG1_VIDEO_ES:
case MPEG2_VIDEO_ES:
case MPEG2_MOTO_VIDEO_ES:
- p_es->i_fourcc = VLC_FOURCC('m','p','g','v');
- p_es->i_cat = VIDEO_ES;
+ i_fourcc = VLC_FOURCC('m','p','g','v');
+ i_cat = VIDEO_ES;
break;
case DVD_SPU_ES:
- p_es->i_fourcc = VLC_FOURCC('s','p','u','b');
- p_es->i_cat = SPU_ES;
+ i_fourcc = VLC_FOURCC('s','p','u','b');
+ i_cat = SPU_ES;
break;
case MPEG1_AUDIO_ES:
case MPEG2_AUDIO_ES:
- p_es->i_fourcc = VLC_FOURCC('m','p','g','a');
- p_es->i_cat = AUDIO_ES;
+ i_fourcc = VLC_FOURCC('m','p','g','a');
+ i_cat = AUDIO_ES;
break;
case A52_AUDIO_ES:
case A52DVB_AUDIO_ES:
- p_es->i_fourcc = VLC_FOURCC('a','5','2','b');
- p_es->i_cat = AUDIO_ES;
+ i_fourcc = VLC_FOURCC('a','5','2','b');
+ i_cat = AUDIO_ES;
break;
case LPCM_AUDIO_ES:
- p_es->i_fourcc = VLC_FOURCC('l','p','c','b');
- p_es->i_cat = AUDIO_ES;
+ i_fourcc = VLC_FOURCC('l','p','c','b');
+ i_cat = AUDIO_ES;
break;
default:
- p_es->i_fourcc = 0;
+ i_cat = UNKNOWN_ES;
+ i_fourcc = 0;
break;
}
+ p_es = input_AddES( p_input, p_input->stream.pp_programs[0],
+ i_stream_id, i_cat, NULL, 0 );
+ p_es->i_fourcc = i_fourcc;
+
/* input_AddES has inserted the new element at the end. */
p_input->stream.pp_programs[0]->pp_es[
p_input->stream.pp_programs[0]->i_es_number ]
}
else
{
+ vlc_bool_t b_auto_spawn = VLC_FALSE;
stream_ps_data_t * p_demux =
(stream_ps_data_t *)p_input->stream.pp_programs[0]->p_demux_data;
if( p_es == NULL && !p_demux->b_has_PSM )
{
- p_es = input_AddES( p_input, p_input->stream.pp_programs[0],
- i_id, 0 );
- if( p_es != NULL )
- {
- p_es->i_stream_id = p_data->p_demux_start[3];
+ int i_fourcc, i_cat;
- /* Set stream type and auto-spawn. */
- if( (i_id & 0xF0) == 0xE0 )
- {
- /* MPEG video */
- p_es->i_fourcc = VLC_FOURCC('m','p','g','v');
- p_es->i_cat = VIDEO_ES;
+ /* Set stream type and auto-spawn. */
+ if( (i_id & 0xF0) == 0xE0 )
+ {
+ /* MPEG video */
+ i_fourcc = VLC_FOURCC('m','p','g','v');
+ i_cat = VIDEO_ES;
#ifdef AUTO_SPAWN
- if( !p_input->stream.b_seekable )
- input_SelectES( p_input, p_es );
+ if( !p_input->stream.b_seekable ) b_auto_spawn = VLC_TRUE;
#endif
- }
- else if( (i_id & 0xE0) == 0xC0 )
- {
- /* MPEG audio */
- p_es->i_fourcc = VLC_FOURCC('m','p','g','a');
- p_es->i_cat = AUDIO_ES;
+ }
+ else if( (i_id & 0xE0) == 0xC0 )
+ {
+ /* MPEG audio */
+ i_fourcc = VLC_FOURCC('m','p','g','a');
+ i_cat = AUDIO_ES;
#ifdef AUTO_SPAWN
- if( !p_input->stream.b_seekable )
- if( config_GetInt( p_input, "audio-channel" )
- == (p_es->i_id & 0x1F) ||
- ( config_GetInt( p_input, "audio-channel" ) < 0
- && !(p_es->i_id & 0x1F) ) )
- switch( config_GetInt( p_input, "audio-type" ) )
- {
- case -1:
- case REQUESTED_MPEG:
- input_SelectES( p_input, p_es );
- }
-#endif
- }
- else if( (i_id & 0xF8FF) == 0x88BD )
+ if( !p_input->stream.b_seekable )
+ if( config_GetInt( p_input, "audio-channel" )
+ == (i_id & 0x1F) ||
+ ( config_GetInt( p_input, "audio-channel" ) < 0
+ && !(i_id & 0x1F) ) )
+ switch( config_GetInt( p_input, "audio-type" ) )
{
- p_es->i_fourcc = VLC_FOURCC('d','t','s','b');
- p_es->i_cat = AUDIO_ES;
-#ifdef AUTO_SPAWN
- if( !p_input->stream.b_seekable )
- if( config_GetInt( p_input, "audio-channel" )
- == ((p_es->i_id & 0x700) >> 8) ||
- ( config_GetInt( p_input, "audio-channel" ) < 0
- && !((p_es->i_id & 0x700) >> 8)) )
- switch( config_GetInt( p_input, "audio-type" ) )
- {
- case -1:
- case REQUESTED_DTS:
- input_SelectES( p_input, p_es );
- }
-#endif
+ case -1:
+ case REQUESTED_MPEG:
+ b_auto_spawn = VLC_TRUE;
}
- else if( (i_id & 0xF0FF) == 0x80BD )
- {
- /* A52 audio (0x80->0x8F) */
- p_es->i_fourcc = VLC_FOURCC('a','5','2','b');
- p_es->i_cat = AUDIO_ES;
-#ifdef AUTO_SPAWN
- if( !p_input->stream.b_seekable )
- if( config_GetInt( p_input, "audio-channel" )
- == ((p_es->i_id & 0xF00) >> 8) ||
- ( config_GetInt( p_input, "audio-channel" ) < 0
- && !((p_es->i_id & 0xF00) >> 8)) )
- switch( config_GetInt( p_input, "audio-type" ) )
- {
- case -1:
- case REQUESTED_A52:
- input_SelectES( p_input, p_es );
- }
#endif
- }
- else if( (i_id & 0xE0FF) == 0x20BD )
- {
- /* Subtitles video (0x20->0x3F) */
- p_es->i_fourcc = VLC_FOURCC('s','p','u','b');
- p_es->i_cat = SPU_ES;
+ }
+ else if( (i_id & 0xF8FF) == 0x88BD )
+ {
+ i_fourcc = VLC_FOURCC('d','t','s','b');
+ i_cat = AUDIO_ES;
#ifdef AUTO_SPAWN
- if( config_GetInt( p_input, "spu-channel" )
- == ((p_es->i_id & 0x1F00) >> 8) )
- {
- if( !p_input->stream.b_seekable )
- input_SelectES( p_input, p_es );
- }
-#endif
+ if( !p_input->stream.b_seekable )
+ if( config_GetInt( p_input, "audio-channel" )
+ == ((i_id & 0x700) >> 8) ||
+ ( config_GetInt( p_input, "audio-channel" ) < 0
+ && !((i_id & 0x700) >> 8)) )
+ switch( config_GetInt( p_input, "audio-type" ) )
+ {
+ case -1:
+ case REQUESTED_DTS:
+ b_auto_spawn = VLC_TRUE;
}
- else if( (i_id & 0xF0FF) == 0xA0BD )
+#endif
+ }
+ else if( (i_id & 0xF0FF) == 0x80BD )
+ {
+ /* A52 audio (0x80->0x8F) */
+ i_fourcc = VLC_FOURCC('a','5','2','b');
+ i_cat = AUDIO_ES;
+#ifdef AUTO_SPAWN
+ if( !p_input->stream.b_seekable )
+ if( config_GetInt( p_input, "audio-channel" )
+ == ((i_id & 0xF00) >> 8) ||
+ ( config_GetInt( p_input, "audio-channel" ) < 0
+ && !((i_id & 0xF00) >> 8)) )
+ switch( config_GetInt( p_input, "audio-type" ) )
{
- /* LPCM audio (0xA0->0xAF) */
- p_es->i_fourcc = VLC_FOURCC('l','p','c','b');
- p_es->i_cat = AUDIO_ES;
+ case -1:
+ case REQUESTED_A52:
+ b_auto_spawn = VLC_TRUE;
}
- else
+#endif
+ }
+ else if( (i_id & 0xE0FF) == 0x20BD )
+ {
+ /* Subtitles video (0x20->0x3F) */
+ i_fourcc = VLC_FOURCC('s','p','u','b');
+ i_cat = SPU_ES;
+#ifdef AUTO_SPAWN
+ if( !p_input->stream.b_seekable )
+ if( config_GetInt( p_input, "spu-channel" )
+ == ((i_id & 0x1F00) >> 8) )
{
- p_es->i_fourcc = 0;
+ b_auto_spawn = VLC_TRUE;
}
+#endif
+ }
+ else if( (i_id & 0xF0FF) == 0xA0BD )
+ {
+ /* LPCM audio (0xA0->0xAF) */
+ i_fourcc = VLC_FOURCC('l','p','c','b');
+ i_cat = AUDIO_ES;
+ }
+ else
+ {
+ i_cat = UNKNOWN_ES;
+ i_fourcc = 0;
}
+ p_es = input_AddES( p_input, p_input->stream.pp_programs[0],
+ i_id, i_cat, NULL, 0 );
+
+ p_es->i_stream_id = p_data->p_demux_start[3];
+ p_es->i_fourcc = i_fourcc;
+
+ if( b_auto_spawn ) input_SelectES( p_input, p_es );
+
/* Tell the interface the stream has changed */
p_input->stream.b_changed = 1;
}
#undef p
}
-
* mpeg_ts.c : Transport Stream input module for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: ts.c,v 1.20 2003/03/18 23:59:07 massiot Exp $
+ * $Id: ts.c,v 1.21 2003/05/05 22:23:36 gbazin Exp $
*
* Authors: Henri Fallon <henri@via.ecp.fr>
* Johan Bilien <jobi@via.ecp.fr>
/* We'll have to catch the PAT in order to continue
* Then the input will catch the PMT and then the others ES
* The PAT es is indepedent of any program. */
- p_pat_es = input_AddES( p_input, NULL,
- 0x00, sizeof( es_ts_data_t ) );
+ p_pat_es = input_AddES( p_input, NULL, 0x00,
+ UNKNOWN_ES, NULL, sizeof( es_ts_data_t ) );
p_demux_data = (es_ts_data_t *)p_pat_es->p_demux_data;
p_demux_data->b_psi = 1;
p_demux_data->i_psi_type = PSI_IS_PAT;
/* Add the PMT ES to this program */
p_current_es = input_AddES( p_input, p_pgrm,(u16)i_pmt_pid,
- sizeof( es_ts_data_t) );
+ UNKNOWN_ES, NULL, sizeof( es_ts_data_t) );
p_es_demux = (es_ts_data_t *)p_current_es->p_demux_data;
p_es_demux->b_psi = 1;
p_es_demux->i_psi_type = PSI_IS_PMT;
i_es_info_length = ( ((u32)*(p_current_data + 3) & 0xF) << 8 ) |
*(p_current_data + 4);
- /* Add this ES to the program */
- p_new_es = input_AddES( p_input, p_es->p_pgrm,
- (u16)i_pid, sizeof( es_ts_data_t ) );
- ((es_ts_data_t *)p_new_es->p_demux_data)->i_continuity_counter = 0xFF;
-
/* Tell the interface what kind of stream it is and select
* the required ones */
{
+ int i_fourcc, i_cat, i_stream_id;
+
switch( i_stream_type )
{
case MPEG1_VIDEO_ES:
case MPEG2_MOTO_VIDEO_ES:
/* This isn't real, but we don't actually use
* it. */
- p_new_es->i_stream_id = 0xE0;
- p_new_es->i_fourcc = VLC_FOURCC('m','p','g','v');
- p_new_es->i_cat = VIDEO_ES;
+ i_stream_id = 0xE0;
+ i_fourcc = VLC_FOURCC('m','p','g','v');
+ i_cat = VIDEO_ES;
break;
case MPEG1_AUDIO_ES:
case MPEG2_AUDIO_ES:
/* This isn't real, but we don't actually use
* it. */
- p_new_es->i_stream_id = 0xC0;
- p_new_es->i_fourcc = VLC_FOURCC('m','p','g','a');
- p_new_es->i_cat = AUDIO_ES;
+ i_stream_id = 0xC0;
+ i_fourcc = VLC_FOURCC('m','p','g','a');
+ i_cat = AUDIO_ES;
break;
case A52_AUDIO_ES:
case A52DVB_AUDIO_ES:
if ( !b_vls_compat )
- p_new_es->i_fourcc = VLC_FOURCC('a','5','2',' ');
+ i_fourcc = VLC_FOURCC('a','5','2',' ');
else
- p_new_es->i_fourcc = VLC_FOURCC('a','5','2','b');
- p_new_es->i_stream_id = 0xBD;
- p_new_es->i_cat = AUDIO_ES;
+ i_fourcc = VLC_FOURCC('a','5','2','b');
+ i_stream_id = 0xBD;
+ i_cat = AUDIO_ES;
break;
case LPCM_AUDIO_ES:
- p_new_es->i_fourcc = VLC_FOURCC('l','p','c','m');
- p_new_es->i_stream_id = 0xBD;
- p_new_es->i_cat = AUDIO_ES;
+ i_fourcc = VLC_FOURCC('l','p','c','m');
+ i_stream_id = 0xBD;
+ i_cat = AUDIO_ES;
break;
case DVD_SPU_ES:
if ( !b_vls_compat )
- p_new_es->i_fourcc = VLC_FOURCC('s','p','u',' ');
+ i_fourcc = VLC_FOURCC('s','p','u',' ');
else
- p_new_es->i_fourcc = VLC_FOURCC('s','p','u','b');
- p_new_es->i_stream_id = 0xBD;
- p_new_es->i_cat = SPU_ES;
+ i_fourcc = VLC_FOURCC('s','p','u','b');
+ i_stream_id = 0xBD;
+ i_cat = SPU_ES;
break;
case SDDS_AUDIO_ES:
- p_new_es->i_fourcc = VLC_FOURCC('s','d','d','s');
- p_new_es->i_stream_id = 0xBD;
- p_new_es->i_cat = AUDIO_ES;
+ i_fourcc = VLC_FOURCC('s','d','d','s');
+ i_stream_id = 0xBD;
+ i_cat = AUDIO_ES;
break;
case DTS_AUDIO_ES:
- p_new_es->i_fourcc = VLC_FOURCC('d','t','s',' ');
- p_new_es->i_stream_id = 0xBD;
- p_new_es->i_cat = AUDIO_ES;
+ i_fourcc = VLC_FOURCC('d','t','s',' ');
+ i_stream_id = 0xBD;
+ i_cat = AUDIO_ES;
break;
/* 'b' stands for 'buggy' */
case A52B_AUDIO_ES:
- p_new_es->i_fourcc = VLC_FOURCC('a','5','2','b');
- p_new_es->i_stream_id = 0xBD;
- p_new_es->i_cat = AUDIO_ES;
+ i_fourcc = VLC_FOURCC('a','5','2','b');
+ i_stream_id = 0xBD;
+ i_cat = AUDIO_ES;
break;
case LPCMB_AUDIO_ES:
- p_new_es->i_fourcc = VLC_FOURCC('l','p','c','b');
- p_new_es->i_stream_id = 0xBD;
- p_new_es->i_cat = AUDIO_ES;
+ i_fourcc = VLC_FOURCC('l','p','c','b');
+ i_stream_id = 0xBD;
+ i_cat = AUDIO_ES;
break;
case DVDB_SPU_ES:
- p_new_es->i_fourcc = VLC_FOURCC('s','p','u','b');
- p_new_es->i_stream_id = 0xBD;
- p_new_es->i_cat = SPU_ES;
+ i_fourcc = VLC_FOURCC('s','p','u','b');
+ i_stream_id = 0xBD;
+ i_cat = SPU_ES;
break;
default :
- p_new_es->i_fourcc = 0;
- p_new_es->i_cat = UNKNOWN_ES;
+ i_stream_id = 0;
+ i_fourcc = 0;
+ i_cat = UNKNOWN_ES;
break;
}
+
+ /* Add this ES to the program */
+ p_new_es = input_AddES( p_input, p_es->p_pgrm, (u16)i_pid,
+ i_cat, NULL, sizeof( es_ts_data_t ) );
+
+ ((es_ts_data_t *)p_new_es->p_demux_data)->i_continuity_counter = 0xFF;
+
+ p_new_es->i_stream_id = i_stream_id;
+ p_new_es->i_fourcc = i_fourcc;
+
}
p_current_data += 5 + i_es_info_length;
/* Add the PMT ES to this program */
p_current_es = input_AddES( p_input, p_new_pgrm,
- (u16) p_pgrm->i_pid,
- sizeof( es_ts_data_t) );
+ (u16)p_pgrm->i_pid, UNKNOWN_ES,
+ NULL, sizeof(es_ts_data_t) );
p_es_demux = (es_ts_data_t *)p_current_es->p_demux_data;
p_es_demux->b_psi = 1;
p_es_demux->i_psi_type = PSI_IS_PMT;
p_es = p_new_pmt->p_first_es;
while( p_es )
{
- /* Add this ES */
- p_new_es = input_AddES( p_input, p_pgrm,
- (u16)p_es->i_pid, sizeof( es_ts_data_t ) );
- if( p_new_es == NULL )
- {
- msg_Err( p_input, "could not add ES %d", p_es->i_pid );
- p_input->b_error = 1;
- return;
- }
- ((es_ts_data_t *)p_new_es->p_demux_data)->i_continuity_counter = 0xFF;
+ int i_fourcc, i_cat, i_stream_id;
switch( p_es->i_type )
{
case MPEG1_VIDEO_ES:
case MPEG2_VIDEO_ES:
case MPEG2_MOTO_VIDEO_ES:
- p_new_es->i_fourcc = VLC_FOURCC('m','p','g','v');
- p_new_es->i_cat = VIDEO_ES;
+ i_fourcc = VLC_FOURCC('m','p','g','v');
+ i_cat = VIDEO_ES;
break;
case MPEG1_AUDIO_ES:
case MPEG2_AUDIO_ES:
- p_new_es->i_fourcc = VLC_FOURCC('m','p','g','a');
- p_new_es->i_cat = AUDIO_ES;
+ i_fourcc = VLC_FOURCC('m','p','g','a');
+ i_cat = AUDIO_ES;
break;
case A52_AUDIO_ES:
case A52DVB_AUDIO_ES:
if ( !b_vls_compat )
- p_new_es->i_fourcc = VLC_FOURCC('a','5','2',' ');
+ i_fourcc = VLC_FOURCC('a','5','2',' ');
else
- p_new_es->i_fourcc = VLC_FOURCC('a','5','2','b');
- p_new_es->i_cat = AUDIO_ES;
- p_new_es->i_stream_id = 0xBD;
+ i_fourcc = VLC_FOURCC('a','5','2','b');
+ i_cat = AUDIO_ES;
+ i_stream_id = 0xBD;
break;
case DVD_SPU_ES:
if ( !b_vls_compat )
- p_new_es->i_fourcc = VLC_FOURCC('s','p','u',' ');
+ i_fourcc = VLC_FOURCC('s','p','u',' ');
else
- p_new_es->i_fourcc = VLC_FOURCC('s','p','u','b');
- p_new_es->i_cat = SPU_ES;
- p_new_es->i_stream_id = 0xBD;
+ i_fourcc = VLC_FOURCC('s','p','u','b');
+ i_cat = SPU_ES;
+ i_stream_id = 0xBD;
break;
case LPCM_AUDIO_ES:
- p_new_es->i_fourcc = VLC_FOURCC('l','p','c','m');
- p_new_es->i_cat = AUDIO_ES;
- p_new_es->i_stream_id = 0xBD;
+ i_fourcc = VLC_FOURCC('l','p','c','m');
+ i_cat = AUDIO_ES;
+ i_stream_id = 0xBD;
break;
case SDDS_AUDIO_ES:
- p_new_es->i_fourcc = VLC_FOURCC('s','d','d','s');
- p_new_es->i_stream_id = 0xBD;
- p_new_es->i_cat = AUDIO_ES;
+ i_fourcc = VLC_FOURCC('s','d','d','s');
+ i_stream_id = 0xBD;
+ i_cat = AUDIO_ES;
break;
case DTS_AUDIO_ES:
- p_new_es->i_fourcc = VLC_FOURCC('d','t','s',' ');
- p_new_es->i_stream_id = 0xBD;
- p_new_es->i_cat = AUDIO_ES;
+ i_fourcc = VLC_FOURCC('d','t','s',' ');
+ i_stream_id = 0xBD;
+ i_cat = AUDIO_ES;
break;
case A52B_AUDIO_ES:
- p_new_es->i_fourcc = VLC_FOURCC('a','5','2','b');
- p_new_es->i_cat = AUDIO_ES;
- p_new_es->i_stream_id = 0xBD;
+ i_fourcc = VLC_FOURCC('a','5','2','b');
+ i_cat = AUDIO_ES;
+ i_stream_id = 0xBD;
break;
case DVDB_SPU_ES:
- p_new_es->i_fourcc = VLC_FOURCC('s','p','u','b');
- p_new_es->i_cat = SPU_ES;
- p_new_es->i_stream_id = 0xBD;
+ i_fourcc = VLC_FOURCC('s','p','u','b');
+ i_cat = SPU_ES;
+ i_stream_id = 0xBD;
break;
case LPCMB_AUDIO_ES:
- p_new_es->i_fourcc = VLC_FOURCC('l','p','c','b');
- p_new_es->i_cat = AUDIO_ES;
- p_new_es->i_stream_id = 0xBD;
+ i_fourcc = VLC_FOURCC('l','p','c','b');
+ i_cat = AUDIO_ES;
+ i_stream_id = 0xBD;
break;
case MPEG4_VIDEO_ES:
- p_new_es->i_fourcc = VLC_FOURCC('m','p','4','v');
- p_new_es->i_cat = VIDEO_ES;
- p_new_es->i_stream_id = 0xfa;
+ i_fourcc = VLC_FOURCC('m','p','4','v');
+ i_cat = VIDEO_ES;
+ i_stream_id = 0xfa;
break;
case MPEG4_AUDIO_ES:
- p_new_es->i_fourcc = VLC_FOURCC('m','p','4','a');
- p_new_es->i_cat = AUDIO_ES;
- p_new_es->i_stream_id = 0xfa;
+ i_fourcc = VLC_FOURCC('m','p','4','a');
+ i_cat = AUDIO_ES;
+ i_stream_id = 0xfa;
break;
case MSCODEC_VIDEO_ES:
- p_new_es->i_fourcc = VLC_FOURCC(0,0,0,0); // fixed later
- p_new_es->i_cat = VIDEO_ES;
- p_new_es->i_stream_id = 0xa0;
+ i_fourcc = VLC_FOURCC(0,0,0,0); // fixed later
+ i_cat = VIDEO_ES;
+ i_stream_id = 0xa0;
break;
default:
- p_new_es->i_fourcc = 0;
- p_new_es->i_cat = UNKNOWN_ES;
+ i_fourcc = 0;
+ i_cat = UNKNOWN_ES;
+ }
+
+ /* Add this ES */
+ p_new_es = input_AddES( p_input, p_pgrm, (u16)p_es->i_pid,
+ i_cat, NULL, sizeof( es_ts_data_t ) );
+ if( p_new_es == NULL )
+ {
+ msg_Err( p_input, "could not add ES %d", p_es->i_pid );
+ p_input->b_error = 1;
+ return;
}
+ p_new_es->i_fourcc = i_fourcc;
+ p_new_es->i_stream_id = i_stream_id;
+
+ ((es_ts_data_t *)p_new_es->p_demux_data)->i_continuity_counter = 0xFF;
if( p_es->i_type == MPEG4_VIDEO_ES || p_es->i_type == MPEG4_AUDIO_ES )
{
* ogg.c : ogg stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: ogg.c,v 1.24 2003/04/14 03:23:30 fenrir Exp $
+ * $Id: ogg.c,v 1.25 2003/05/05 22:23:34 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
vlc_mutex_lock( &p_input->stream.stream_lock );
p_stream->p_es = input_AddES( p_input,
p_input->stream.p_selected_program,
- p_ogg->i_streams + 1, 0 );
+ i_stream,
+ p_stream->i_cat, NULL, 0 );
p_input->stream.i_mux_rate += (p_stream->i_bitrate / ( 8 * 50 ));
vlc_mutex_unlock( &p_input->stream.stream_lock );
- p_stream->p_es->i_stream_id = p_stream->p_es->i_id = i_stream;
+ p_stream->p_es->i_stream_id = i_stream;
p_stream->p_es->i_fourcc = p_stream->i_fourcc;
- p_stream->p_es->i_cat = p_stream->i_cat;
p_stream->p_es->p_waveformatex = (void*)p_stream->p_wf;
p_stream->p_es->p_bitmapinfoheader = (void*)p_stream->p_bih;
#undef p_stream
* rawdv.c : raw dv input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: rawdv.c,v 1.7 2003/04/27 15:25:11 gbazin Exp $
+ * $Id: rawdv.c,v 1.8 2003/05/05 22:23:34 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
vlc_mutex_lock( &p_input->stream.stream_lock );
p_rawdv->p_video_es = input_AddES( p_input,
p_input->stream.p_selected_program,
- 1, 0 );
+ 1, VIDEO_ES, NULL, 0 );
p_rawdv->p_video_es->i_stream_id = 0;
p_rawdv->p_video_es->i_fourcc = VLC_FOURCC( 'd','v','s','d' );
- p_rawdv->p_video_es->i_cat = VIDEO_ES;
p_rawdv->p_video_es->p_bitmapinfoheader = (void *)p_rawdv->p_bih;
input_SelectES( p_input, p_rawdv->p_video_es );
vlc_mutex_unlock( &p_input->stream.stream_lock );
vlc_mutex_lock( &p_input->stream.stream_lock );
p_rawdv->p_audio_es = input_AddES( p_input,
p_input->stream.p_selected_program,
- 2, 0 );
+ 2, AUDIO_ES, NULL, 0 );
p_rawdv->p_audio_es->i_stream_id = 1;
p_rawdv->p_audio_es->i_fourcc = VLC_FOURCC( 'd','v','a','u' );
- p_rawdv->p_audio_es->i_cat = AUDIO_ES;
p_rawdv->p_audio_es->p_waveformatex = (void *)p_rawdv->p_wf;
input_SelectES( p_input, p_rawdv->p_audio_es );
vlc_mutex_unlock( &p_input->stream.stream_lock );
* sub.c
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: sub.c,v 1.12 2003/04/14 03:23:30 fenrir Exp $
+ * $Id: sub.c,v 1.13 2003/05/05 22:23:37 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
/* *** add subtitle ES *** */
vlc_mutex_lock( &p_input->stream.stream_lock );
- p_sub->p_es = input_AddES( p_input,
- p_input->stream.p_selected_program,
+ p_sub->p_es = input_AddES( p_input, p_input->stream.p_selected_program,
0xff, // FIXME
- 0 );
+ SPU_ES, NULL, 0 );
vlc_mutex_unlock( &p_input->stream.stream_lock );
p_sub->p_es->i_stream_id = 0xff; // FIXME
p_sub->p_es->i_fourcc = VLC_FOURCC( 's','u','b','t' );
- p_sub->p_es->i_cat = SPU_ES;
p_sub->i_previously_selected = 0;
return VLC_SUCCESS;
* wav.c : wav file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: wav.c,v 1.14 2003/03/11 06:45:59 fenrir Exp $
+ * $Id: wav.c,v 1.15 2003/05/05 22:23:37 gbazin Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
p_input->stream.i_mux_rate = 0 ; /* FIXME */
p_demux->p_es = input_AddES( p_input,
- p_input->stream.p_selected_program, 1,
- 0 );
+ p_input->stream.p_selected_program,
+ 1, AUDIO_ES, NULL, 0 );
p_demux->p_es->i_stream_id = 1;
p_demux->p_es->i_fourcc = p_demux->i_fourcc;
- p_demux->p_es->i_cat = AUDIO_ES;
p_demux->p_es->p_waveformatex = malloc( p_demux->i_wf );
memcpy( p_demux->p_es->p_waveformatex, p_demux->p_wf, p_demux->i_wf );
* VlcWrapper.cpp: BeOS plugin for vlc (derived from MacOS X port)
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: VlcWrapper.cpp,v 1.28 2003/04/23 15:18:24 titer Exp $
+ * $Id: VlcWrapper.cpp,v 1.29 2003/05/05 22:23:38 gbazin Exp $
*
* Authors: Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
{
message = new BMessage( what );
message->AddInt32( fieldName, i );
- if( strlen( p_input->stream.pp_es[i]->psz_desc ) )
- trackName = strdup( p_input->stream.pp_es[i]->psz_desc );
- else
+ if( !p_input->stream.pp_es[i]->psz_desc ||
+ !*p_input->stream.pp_es[i]->psz_desc )
trackName = _("<unknown>");
+ else
+ trackName = strdup( p_input->stream.pp_es[i]->psz_desc );
menuItem = new BMenuItem( trackName, message );
if( p_input->stream.pp_es[i] == p_es )
menuItem->SetMarked( true );
* menu.c : functions to handle menu items.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: menu.c,v 1.9 2003/05/04 22:42:15 gbazin Exp $
+ * $Id: menu.c,v 1.10 2003/05/05 22:23:38 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
p_intf->p_sys->p_input->stream.p_selected_program ) )
{
i_item++;
- strcpy( psz_name,
- p_intf->p_sys->p_input->stream.pp_es[i]->psz_desc );
- if( psz_name[0] == '\0' )
+ if( !p_intf->p_sys->p_input->stream.pp_es[i]->psz_desc ||
+ !*p_intf->p_sys->p_input->stream.pp_es[i]->psz_desc )
{
snprintf( psz_name, GTK_MENU_LABEL_SIZE,
"Language %d", i_item );
psz_name[ GTK_MENU_LABEL_SIZE - 1 ] = '\0';
}
+ else
+ {
+ strcpy( psz_name,
+ p_intf->p_sys->p_input->stream.pp_es[i]->psz_desc );
+ }
p_item = gtk_radio_menu_item_new_with_label( p_group, psz_name );
p_group =
* intf.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
- * $Id: intf.m,v 1.73 2003/05/05 22:04:11 hartman Exp $
+ * $Id: intf.m,v 1.74 2003/05/05 22:23:39 gbazin Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
NSMenuItem * o_lmi;
NSString * o_title;
- if( *ES->psz_desc )
- {
- o_title = [NSApp localizedString: ES->psz_desc];
- }
- else
+ if( !ES->psz_desc || !*ES->psz_desc )
{
char psz_title[ 256 ];
o_title = [NSApp localizedString: psz_title];
}
+ else
+ {
+ o_title = [NSApp localizedString: ES->psz_desc];
+ }
o_lmi = [o_menu addItemWithTitle: o_title
action: pf_callback keyEquivalent: @""];
* menu.cpp: functions to handle menu items\r
*****************************************************************************\r
* Copyright (C) 2002-2003 VideoLAN\r
- * $Id: menu.cpp,v 1.15 2003/05/04 22:42:16 gbazin Exp $\r
+ * $Id: menu.cpp,v 1.16 2003/05/05 22:23:39 gbazin Exp $\r
*\r
* Authors: Olivier Teuliere <ipkiss@via.ecp.fr>\r
*\r
p_intf->p_sys->p_input->stream.p_selected_program ) )\r
{\r
i_item++;\r
- Name = p_intf->p_sys->p_input->stream.pp_es[i]->psz_desc;\r
+ if( p_intf->p_sys->p_input->stream.pp_es[i]->psz_desc )\r
+ Name = p_intf->p_sys->p_input->stream.pp_es[i]->psz_desc;\r
if( Name.IsEmpty() )\r
Name.sprintf( "Language %d", i_item );\r
\r
* menus.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: menus.cpp,v 1.1 2003/05/04 22:42:16 gbazin Exp $
+ * $Id: menus.cpp,v 1.2 2003/05/05 22:23:40 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
void PopupMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
{
vlc_object_t *p_object;
- char *ppsz_varnames[16];
- int pi_objects[16];
+ char *ppsz_varnames[19];
+ int pi_objects[19];
int i = 0;
/* Initializations */
- memset( pi_objects, 0, 16 * sizeof(int) );
+ memset( pi_objects, 0, 19 * sizeof(int) );
/* Audio menu */
ppsz_varnames[i++] = _("Audio menu");
pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "navigation";
pi_objects[i++] = p_object->i_object_id;
+
+ ppsz_varnames[i] = "video-es";
+ pi_objects[i++] = p_object->i_object_id;
+ ppsz_varnames[i] = "audio-es";
+ pi_objects[i++] = p_object->i_object_id;
+ ppsz_varnames[i] = "spu-es";
+ pi_objects[i++] = p_object->i_object_id;
+
vlc_object_release( p_object );
}
wxMenu *AudioMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
{
vlc_object_t *p_object;
- char *ppsz_varnames[4];
- int pi_objects[4];
+ char *ppsz_varnames[5];
+ int pi_objects[5];
int i = 0;
/* Initializations */
- memset( pi_objects, 0, 4 * sizeof(int) );
+ memset( pi_objects, 0, 5 * sizeof(int) );
/* Audio menu */
ppsz_varnames[i++] = NULL; /* Separator */
vlc_object_release( p_object );
}
+ p_object = (vlc_object_t *)vlc_object_find( _p_intf, VLC_OBJECT_INPUT,
+ FIND_ANYWHERE );
+ if( p_object != NULL )
+ {
+ ppsz_varnames[i] = "audio-es";
+ pi_objects[i++] = p_object->i_object_id;
+ vlc_object_release( p_object );
+ }
+
/* Build menu */
return new Menu( _p_intf, _p_main_interface, i,
ppsz_varnames, pi_objects );
vlc_object_release( p_object );
}
+ p_object = (vlc_object_t *)vlc_object_find( _p_intf, VLC_OBJECT_INPUT,
+ FIND_ANYWHERE );
+ if( p_object != NULL )
+ {
+ ppsz_varnames[i] = "video-es";
+ pi_objects[i++] = p_object->i_object_id;
+ ppsz_varnames[i] = "spu-es";
+ pi_objects[i++] = p_object->i_object_id;
+ vlc_object_release( p_object );
+ }
+
/* Build menu */
return new Menu( _p_intf, _p_main_interface, i,
ppsz_varnames, pi_objects );
* display.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: display.c,v 1.3 2003/04/29 22:44:08 fenrir Exp $
+ * $Id: display.c,v 1.4 2003/05/05 22:23:40 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
id->p_es = input_AddES( p_sys->p_input,
NULL, /* no program */
12, /* es_id */
+ /* p_fmt->i_cat; */ UNKNOWN_ES, /* es category */
+ NULL, /* description */
0 ); /* no extra data */
if( !id->p_es )
return NULL;
}
id->p_es->i_stream_id = 1;
- id->p_es->i_cat = UNKNOWN_ES; /* p_fmt->i_cat; */
id->p_es->i_fourcc = p_fmt->i_fourcc;
id->p_es->b_force_decoder = VLC_TRUE;
switch( p_fmt->i_cat )
# libvlc
+include/interface.h
+src/audio_output/output.c
+src/input/input_programs.c
src/libvlc.c
src/libvlc.h
src/misc/configuration.c
-src/audio_output/output.c
-include/interface.h
# access modules
modules/access/directory.c
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management
*****************************************************************************
* Copyright (C) 1999-2002 VideoLAN
- * $Id: input_programs.c,v 1.105 2003/05/04 22:42:17 gbazin Exp $
+ * $Id: input_programs.c,v 1.106 2003/05/05 22:23:42 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
vlc_value_t, vlc_value_t, void * );
static int NavigationCallback( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
+static int ESCallback( vlc_object_t *, char const *,
+ vlc_value_t, vlc_value_t, void * );
/*****************************************************************************
* input_InitStream: init the stream descriptor of the given input
*****************************************************************************/
int input_InitStream( input_thread_t * p_input, size_t i_data_len )
{
+ vlc_value_t text;
p_input->stream.i_stream_id = 0;
/* Create a few object variables used for navigation in the interfaces */
var_Create( p_input, "program", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
+ text.psz_string = _("Program");
+ var_Change( p_input, "program", VLC_VAR_SETTEXT, &text, NULL );
var_Create( p_input, "title", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
+ text.psz_string = _("Title");
+ var_Change( p_input, "title", VLC_VAR_SETTEXT, &text, NULL );
var_Create( p_input, "chapter", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
+ text.psz_string = _("Chapter");
+ var_Change( p_input, "chapter", VLC_VAR_SETTEXT, &text, NULL );
var_Create( p_input, "navigation", VLC_VAR_VARIABLE | VLC_VAR_HASCHOICE );
+ text.psz_string = _("Navigation");
+ var_Change( p_input, "navigation", VLC_VAR_SETTEXT, &text, NULL );
+ var_Create( p_input, "video-es", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
+ text.psz_string = _("Video track");
+ var_Change( p_input, "video-es", VLC_VAR_SETTEXT, &text, NULL );
+ var_Create( p_input, "audio-es", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
+ text.psz_string = _("Audio track");
+ var_Change( p_input, "audio-es", VLC_VAR_SETTEXT, &text, NULL );
+ var_Create( p_input, "spu-es", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
+ text.psz_string = _("Subtitle track");
+ var_Change( p_input, "spu-es", VLC_VAR_SETTEXT, &text, NULL );
+
var_AddCallback( p_input, "program", ProgramCallback, NULL );
var_AddCallback( p_input, "title", TitleCallback, NULL );
var_AddCallback( p_input, "chapter", ChapterCallback, NULL );
+ var_AddCallback( p_input, "video-es", ESCallback, NULL );
+ var_AddCallback( p_input, "audio-es", ESCallback, NULL );
+ var_AddCallback( p_input, "spu-es", ESCallback, NULL );
return 0;
}
*****************************************************************************/
void input_EndStream( input_thread_t * p_input )
{
- /* Free navigation variables */
- var_Destroy( p_input, "program" );
- var_Destroy( p_input, "title" );
- var_Destroy( p_input, "chapter" );
-
/* Free all programs and associated ES, and associated decoders. */
while( p_input->stream.i_pgrm_number )
{
{
free( p_input->stream.p_demux_data );
}
+
+ /* Free navigation variables */
+ var_Destroy( p_input, "program" );
+ var_Destroy( p_input, "title" );
+ var_Destroy( p_input, "chapter" );
+ var_Destroy( p_input, "video-es" );
+ var_Destroy( p_input, "audio-es" );
+ var_Destroy( p_input, "spu-es" );
}
/*****************************************************************************
*****************************************************************************/
es_descriptor_t * input_AddES( input_thread_t * p_input,
pgrm_descriptor_t * p_pgrm, u16 i_es_id,
+ int i_category, char const *psz_desc,
size_t i_data_len )
{
es_descriptor_t * p_es;
+ vlc_value_t val, text;
+ char *psz_var = NULL;
p_es = (es_descriptor_t *)malloc( sizeof(es_descriptor_t) );
if( p_es == NULL )
/* Init its values */
p_es->i_id = i_es_id;
- p_es->psz_desc[0] = '\0';
+ p_es->psz_desc = psz_desc ? strdup( psz_desc ) : NULL;
p_es->p_pes = NULL;
p_es->p_decoder_fifo = NULL;
- p_es->i_cat = UNKNOWN_ES;
+ p_es->i_cat = i_category;
p_es->i_demux_fd = 0;
p_es->c_packets = 0;
p_es->c_invalid_packets = 0;
p_es->p_pgrm = NULL;
}
+ switch( i_category )
+ {
+ case AUDIO_ES:
+ psz_var = "audio-es";
+ break;
+ case SPU_ES:
+ psz_var = "spu-es";
+ break;
+ case VIDEO_ES:
+ psz_var = "video-es";
+ break;
+ }
+
+ if( psz_var )
+ {
+ val.i_int = p_es->i_id;
+ text.psz_string = (char *)psz_desc;
+ var_Change( p_input, psz_var, VLC_VAR_ADDCHOICE, &val, &text );
+ }
+
return p_es;
}
{
unsigned int i_index, i_es_index;
pgrm_descriptor_t * p_pgrm;
+ char * psz_var;
+ vlc_value_t val;
/* Find the ES in the ES table */
for( i_es_index = 0; i_es_index < p_input->stream.i_es_number;
return;
}
- p_pgrm = p_es->p_pgrm;
+ /* Remove es from its associated variable */
+ switch( p_es->i_cat )
+ {
+ case AUDIO_ES:
+ psz_var = "audio-es";
+ break;
+ case SPU_ES:
+ psz_var = "spu-es";
+ break;
+ case VIDEO_ES:
+ default:
+ psz_var = "video-es";
+ break;
+ }
+ val.i_int = p_es->i_id;
+ var_Change( p_input, psz_var, VLC_VAR_DELCHOICE, &val, NULL );
/* Kill associated decoder, if any. */
if( p_es->p_decoder_fifo != NULL )
input_EndDecoder( p_input, p_es );
}
- /* Remove this ES from the description of the program if it is associated to
- * one */
+ /* Remove this ES from the description of the program if it is associated
+ * to one */
+ p_pgrm = p_es->p_pgrm;
if( p_pgrm )
{
for( i_index = 0; i_index < p_pgrm->i_es_number; i_index++ )
free( p_es->p_bitmapinfoheader );
}
+ /* Free the description string */
+ if( p_es->psz_desc != NULL )
+ {
+ free( p_es->psz_desc );
+ }
+
/* Find the ES in the ES table */
for( i_es_index = 0; i_es_index < p_input->stream.i_es_number;
i_es_index++ )
*****************************************************************************/
int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es )
{
+ vlc_value_t val;
+
if( p_es == NULL )
{
msg_Err( p_input, "nothing to do in input_SelectES" );
return -1;
}
+ /* Update the es variable without triggering a callback */
+ val.i_int = p_es->i_id;
+ var_Change( p_input, "audio-es", VLC_VAR_SETVALUE, &val, NULL );
+
return 0;
}
return VLC_SUCCESS;
}
+
+static int ESCallback( vlc_object_t *p_this, char const *psz_cmd,
+ vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+ input_thread_t *p_input = (input_thread_t *)p_this;
+ unsigned int i;
+
+ vlc_mutex_lock( &p_input->stream.stream_lock );
+
+ /* Unselect old ES */
+ for( i = 0 ; i < p_input->stream.i_es_number ; i++ )
+ {
+ if( p_input->stream.pp_es[i]->i_id == oldval.i_int &&
+ p_input->stream.pp_es[i]->p_decoder_fifo != NULL )
+ {
+ input_UnselectES( p_input, p_input->stream.pp_es[i] );
+ }
+ }
+
+ /* Select new ES */
+ for( i = 0 ; i < p_input->stream.i_es_number ; i++ )
+ {
+ if( p_input->stream.pp_es[i]->i_id == newval.i_int &&
+ p_input->stream.pp_es[i]->p_decoder_fifo == NULL )
+ {
+ input_SelectES( p_input, p_input->stream.pp_es[i] );
+ }
+ }
+
+ vlc_mutex_unlock( &p_input->stream.stream_lock );
+
+ return VLC_SUCCESS;
+}
* libvlc.h: main libvlc header
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.h,v 1.59 2003/05/05 16:09:35 gbazin Exp $
+ * $Id: libvlc.h,v 1.60 2003/05/05 22:23:41 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
#define ZOOM_LONGTEXT N_( \
"You can zoom the video by the specified factor.")
-#define GRAYSCALE_TEXT N_("gGayscale video output")
+#define GRAYSCALE_TEXT N_("Gayscale video output")
#define GRAYSCALE_LONGTEXT N_( \
"When enabled, the color information from the video won't be decoded " \
"(this can also allow you to save some processing power).")