Commit 95b4a56a authored by Gildas Bazin's avatar Gildas Bazin

* ALL: changed the prototype of input_AddES() to include enough information so we can build an "video-es", "audio-es" and "spu-es" object variable. These variables can be used by the interfaces to navigate between the elementary streams.
* modules/gui/wxwindows/menus.cpp: use the "foo-es" object variables.
parent 45d50b96
......@@ -4,7 +4,7 @@
* 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>
*
......@@ -52,7 +52,7 @@ struct es_descriptor_t
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 */
......
......@@ -3,7 +3,7 @@
* 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>
*
......@@ -47,7 +47,7 @@ VLC_EXPORT( int, input_SetProgram,( input_thread_t *, pgrm_descriptor_t * ) );
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: Stphane Borel <stef@via.ecp.fr>
*
......@@ -64,16 +64,20 @@ void DVDLaunchDecoders( input_thread_t * p_input );
#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);
/*****************************************************************************
......@@ -94,12 +98,13 @@ void DVDReadVideo( input_thread_t * p_input )
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 );
}
}
......@@ -137,27 +142,27 @@ void DVDReadAudio( input_thread_t * p_input )
{
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:
......@@ -222,7 +227,7 @@ void DVDReadSPU( input_thread_t * p_input )
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),
......@@ -231,7 +236,7 @@ void DVDReadSPU( input_thread_t * p_input )
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 );
}
}
}
......
......@@ -2,7 +2,7 @@
* 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: Stphane Borel <stef@via.ecp.fr>
*
......@@ -71,16 +71,20 @@ void dvdplay_DeleteES( input_thread_t* p_input )
}
#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
......@@ -100,12 +104,13 @@ void dvdplay_Video( input_thread_t * p_input )
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 );
}
}
......@@ -143,29 +148,29 @@ void dvdplay_Audio( input_thread_t * p_input )
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:
......@@ -207,7 +212,7 @@ void dvdplay_Subp( input_thread_t * p_input )
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) );
......@@ -215,7 +220,7 @@ void dvdplay_Subp( input_thread_t * p_input )
else
{
ADDES( i_id, VLC_FOURCC('s','p','u','b'), SPU_ES,
p_attr->lang_code, 0 );
p_attr->lang_code, "", 0 );
}
}
}
......
......@@ -6,7 +6,7 @@
* 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: Stphane Borel <stef@via.ecp.fr>
*
......@@ -666,10 +666,9 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
/* 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]
......@@ -687,42 +686,36 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
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 */
......@@ -779,12 +772,11 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
}
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
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -1191,13 +1191,12 @@ static int DemuxOpen( vlc_object_t *p_this )
{
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] );
......@@ -1220,7 +1219,9 @@ static int DemuxOpen( vlc_object_t *p_this )
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] );
......
......@@ -2,7 +2,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>
*
......@@ -845,7 +845,7 @@ static int AudioConfig( vlc_object_t *p_this, char const *psz_cmd,
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 );
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -103,10 +103,10 @@ static int Init( vlc_object_t * p_this )
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;
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -489,10 +489,8 @@ static int Activate( vlc_object_t * p_this )
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 );
......@@ -502,7 +500,6 @@ static int Activate( vlc_object_t * p_this )
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;
......
......@@ -2,7 +2,7 @@
* 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
......@@ -205,11 +205,7 @@ static int Activate( vlc_object_t * p_this )
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 ) )
......@@ -225,6 +221,10 @@ static int Activate( vlc_object_t * p_this )
}
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)",
......@@ -295,10 +295,13 @@ static int Activate( vlc_object_t * p_this )
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 =
......@@ -356,15 +359,12 @@ static int Activate( vlc_object_t * p_this )
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 );
}
......
......@@ -2,7 +2,7 @@
* 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
......@@ -406,13 +406,10 @@ static int AUInit( vlc_object_t * p_this )
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,
......
......@@ -2,7 +2,7 @@
* 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
......@@ -1239,13 +1239,11 @@ static int AVIInit( vlc_object_t * p_this )
/* 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 ) )
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -104,10 +104,10 @@ static int Init( vlc_object_t * p_this )
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;
......
......@@ -2,7 +2,7 @@
* 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
......@@ -882,6 +882,7 @@ static int TrackCreateES ( input_thread_t *p_input,
{
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;
......@@ -940,19 +941,17 @@ static int TrackCreateES ( input_thread_t *p_input,
}
}
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;
......@@ -971,8 +970,6 @@ static int TrackCreateES ( input_thread_t *p_input,
break;
}
p_es->i_cat = p_track->i_cat;
i_decoder_specific_info_len = 0;
p_decoder_specific_info = NULL;
p_pes_init = NULL;
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -583,10 +583,8 @@ static int Activate( vlc_object_t * p_this )
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 );
......@@ -596,7 +594,6 @@ static int Activate( vlc_object_t * p_this )
}
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 );
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -117,10 +117,10 @@ static int Activate( vlc_object_t * p_this )
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;
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -129,8 +129,7 @@ static int Activate( vlc_object_t * p_this )
/* 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 );
......@@ -140,7 +139,6 @@ static int Activate( vlc_object_t * p_this )
}
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 );
......
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -1123,12 +1123,12 @@ static int Activate( vlc_object_t * p_this )
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
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -292,10 +292,9 @@ static int Activate( vlc_object_t * p_this )
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 );
......@@ -304,10 +303,9 @@ static int Activate( vlc_object_t * p_this )
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 );
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -425,15 +425,13 @@ static int sub_open ( subtitle_demux_t *p_sub,
/* *** 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;
......
......@@ -2,7 +2,7 @@
* 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
......@@ -527,11 +527,10 @@ static int WAVInit( vlc_object_t * p_this )
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 );
......
......@@ -2,7 +2,7 @@
* 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>
......@@ -193,10 +193,11 @@ BList * VlcWrapper::GetChannels( int i_cat )
{
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 );
......
......@@ -2,7 +2,7 @@
* 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>
* Stphane Borel <stef@via.ecp.fr>
......@@ -764,14 +764,18 @@ static gint GtkLanguageMenus( gpointer p_data,
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 =
......
......@@ -2,7 +2,7 @@
* 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>
......@@ -1272,11 +1272,7 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
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 ];
......@@ -1286,6 +1282,10 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
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: @""];
......
......@@ -2,7 +2,7 @@
* menu.cpp: functions to handle menu items
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: menu.cpp,v 1.15 2003/05/04 22:42:16 gbazin Exp $
* $Id: menu.cpp,v 1.16 2003/05/05 22:23:39 gbazin Exp $
*
* Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
*
......@@ -867,7 +867,8 @@ void __fastcall TMenusGen::LanguageMenu( TMenuItem *Root, es_descriptor_t *p_es,
p_intf->p_sys->p_input->stream.p_selected_program ) )
{
i_item++;
Name = p_intf->p_sys->p_input->stream.pp_es[i]->psz_desc;
if( p_intf->p_sys->p_input->stream.pp_es[i]->psz_desc )
Name = p_intf->p_sys->p_input->stream.pp_es[i]->psz_desc;
if( Name.IsEmpty() )
Name.sprintf( "Language %d", i_item );
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -92,12 +92,12 @@ END_EVENT_TABLE()
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");
......@@ -143,6 +143,14 @@ void PopupMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
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 );
}
......@@ -165,12 +173,12 @@ void PopupMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
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 */
......@@ -187,6 +195,15 @@ wxMenu *AudioMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
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 );
......@@ -213,6 +230,17 @@ wxMenu *VideoMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
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 );
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -142,6 +142,8 @@ static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_f
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 )
......@@ -153,7 +155,6 @@ static sout_stream_id_t * Add ( sout_stream_t *p_stream, sout_format_t *p_f
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
......
......@@ -2,7 +2,7 @@
* 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>
*
......@@ -48,12 +48,15 @@ static int ChapterCallback( vlc_object_t *, char const *,
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;
......@@ -84,12 +87,33 @@ int input_InitStream( input_thread_t * p_input, size_t i_data_len )
/* 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;
}
......@@ -99,11 +123,6 @@ int input_InitStream( input_thread_t * p_input, size_t i_data_len )
*****************************************************************************/
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 )
{
......@@ -132,6 +151,14 @@ void input_EndStream( input_thread_t * p_input )
{
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" );
}
/*****************************************************************************
......@@ -500,9 +527,12 @@ es_descriptor_t * input_FindES( input_thread_t * p_input, uint16_t i_es_id )
*****************************************************************************/
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 )
......@@ -518,10 +548,10 @@ es_descriptor_t * input_AddES( input_thread_t * p_input,
/* 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;
......@@ -558,6 +588,26 @@ es_descriptor_t * input_AddES( input_thread_t * p_input,
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;
}
......@@ -568,6 +618,8 @@ void input_DelES( input_thread_t * p_input, es_descriptor_t * 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;
......@@ -584,7 +636,22 @@ void input_DelES( input_thread_t * p_input, es_descriptor_t * p_es )
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 )
......@@ -592,8 +659,9 @@ void input_DelES( input_thread_t * p_input, es_descriptor_t * p_es )
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++ )
......@@ -622,6 +690,12 @@ void input_DelES( input_thread_t * p_input, es_descriptor_t * p_es )
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++ )
......@@ -647,6 +721,8 @@ void input_DelES( input_thread_t * p_input, es_descriptor_t * p_es )
*****************************************************************************/
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" );
......@@ -687,6 +763,10 @@ int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es )
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;
}
......@@ -836,3 +916,36 @@ static int NavigationCallback( vlc_object_t *p_this, char const *psz_cmd,
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;
}
......@@ -2,7 +2,7 @@
* 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>
......@@ -156,7 +156,7 @@ static char *ppsz_sout_vcodec[] = { "", "mpeg1", "mpeg2", "mpeg4", NULL };
#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).")
......
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