Commit b642af72 authored by Rocky Bernstein's avatar Rocky Bernstein

Add a few more fields in the stream info.

parent 31f7c3ee
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mpga.c : MPEG-I/II Audio input module for vlc * mpga.c : MPEG-I/II Audio input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: mpga.c,v 1.10 2003/11/21 16:07:20 fenrir Exp $ * $Id: mpga.c,v 1.11 2003/12/03 00:27:52 rocky Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -249,6 +249,7 @@ static int Open( vlc_object_t * p_this ) ...@@ -249,6 +249,7 @@ static int Open( vlc_object_t * p_this )
{ {
int i_xing; int i_xing;
uint8_t *p_xing; uint8_t *p_xing;
char psz_description[50];
p_sys->i_bitrate_avg = MPGA_BITRATE( header ) * 1000; p_sys->i_bitrate_avg = MPGA_BITRATE( header ) * 1000;
if( ( i_xing = stream_Peek( p_input->s, &p_xing, 1024 ) ) >= 21 ) if( ( i_xing = stream_Peek( p_input->s, &p_xing, 1024 ) ) >= 21 )
...@@ -305,7 +306,7 @@ static int Open( vlc_object_t * p_this ) ...@@ -305,7 +306,7 @@ static int Open( vlc_object_t * p_this )
} }
msg_Dbg( p_input, "version=%d layer=%d channels=%d samplerate=%d", msg_Dbg( p_input, "version=%d layer=%d channels=%d samplerate=%d",
MPGA_VERSION( header) + 1, MPGA_VERSION( header ) + 1,
MPGA_LAYER( header ) + 1, MPGA_LAYER( header ) + 1,
MPGA_CHANNELS( header ), MPGA_CHANNELS( header ),
MPGA_SAMPLE_RATE( header ) ); MPGA_SAMPLE_RATE( header ) );
...@@ -313,6 +314,9 @@ static int Open( vlc_object_t * p_this ) ...@@ -313,6 +314,9 @@ static int Open( vlc_object_t * p_this )
fmt.audio.i_channels = MPGA_CHANNELS( header ); fmt.audio.i_channels = MPGA_CHANNELS( header );
fmt.audio.i_rate = MPGA_SAMPLE_RATE( header ); fmt.audio.i_rate = MPGA_SAMPLE_RATE( header );
fmt.i_bitrate = p_sys->i_bitrate_avg; fmt.i_bitrate = p_sys->i_bitrate_avg;
sprintf( psz_description, "MPEG Audio Layer %d, version %d",
MPGA_LAYER ( header ) + 1, MPGA_VERSION ( header ) + 1 );
fmt.psz_description = strdup( psz_description );
} }
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mpgv.c : MPEG-I/II Video demuxer * mpgv.c : MPEG-I/II Video demuxer
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: mpgv.c,v 1.2 2003/11/24 00:39:01 fenrir Exp $ * $Id: mpgv.c,v 1.3 2003/12/03 00:27:52 rocky Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -75,6 +75,7 @@ static int Open( vlc_object_t * p_this ) ...@@ -75,6 +75,7 @@ static int Open( vlc_object_t * p_this )
uint8_t *p_peek; uint8_t *p_peek;
es_format_t fmt; es_format_t fmt;
char psz_description[50];
if( stream_Peek( p_input->s, &p_peek, 4 ) < 4 ) if( stream_Peek( p_input->s, &p_peek, 4 ) < 4 )
{ {
...@@ -151,6 +152,8 @@ static int Open( vlc_object_t * p_this ) ...@@ -151,6 +152,8 @@ static int Open( vlc_object_t * p_this )
* create the output * create the output
*/ */
es_format_Init( &fmt, VIDEO_ES, VLC_FOURCC( 'm', 'p', 'g', 'v' ) ); es_format_Init( &fmt, VIDEO_ES, VLC_FOURCC( 'm', 'p', 'g', 'v' ) );
sprintf( psz_description, "MPEG-I/II Video" );
fmt.psz_description = strdup( psz_description );
p_sys->p_es = es_out_Add( p_input->p_es_out, &fmt ); p_sys->p_es = es_out_Add( p_input->p_es_out, &fmt );
return VLC_SUCCESS; return VLC_SUCCESS;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* es_out.c: Es Out handler for input. * es_out.c: Es Out handler for input.
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: es_out.c,v 1.6 2003/12/02 12:57:35 gbazin Exp $ * $Id: es_out.c,v 1.7 2003/12/03 00:27:52 rocky Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -337,22 +337,32 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt ) ...@@ -337,22 +337,32 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt )
switch( fmt->i_cat ) switch( fmt->i_cat )
{ {
case AUDIO_ES: case AUDIO_ES:
input_AddInfo( p_cat, _("Type"), _("Audio") ); if( fmt->psz_description )
{
input_AddInfo( p_cat, _("Description"), "%s",
fmt->psz_description );
}
input_AddInfo( p_cat, _("Codec"), "%.4s", input_AddInfo( p_cat, _("Codec"), "%.4s",
(char*)&fmt->i_codec ); (char*)&fmt->i_codec );
input_AddInfo( p_cat, _("Type"), _("Audio") );
if( fmt->audio.i_channels > 0 ) if( fmt->audio.i_channels > 0 )
{ {
input_AddInfo( p_cat, _("Channels"), "%d", input_AddInfo( p_cat, _("Channels"), "%d",
fmt->audio.i_channels ); fmt->audio.i_channels );
} }
if( fmt->psz_language )
{
input_AddInfo( p_cat, _("Language"), "%s",
fmt->psz_language );
}
if( fmt->audio.i_rate > 0 ) if( fmt->audio.i_rate > 0 )
{ {
input_AddInfo( p_cat, _("Sample Rate"), "%d", input_AddInfo( p_cat, _("Sample Rate"), _("%d Hz"),
fmt->audio.i_rate ); fmt->audio.i_rate );
} }
if( fmt->i_bitrate > 0 ) if( fmt->i_bitrate > 0 )
{ {
input_AddInfo( p_cat, _("Bitrate"), "%d", input_AddInfo( p_cat, _("Bitrate"), _("%d bps"),
fmt->i_bitrate ); fmt->i_bitrate );
} }
if( fmt->audio.i_bitspersample ) if( fmt->audio.i_bitspersample )
...@@ -362,6 +372,11 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt ) ...@@ -362,6 +372,11 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt )
} }
break; break;
case VIDEO_ES: case VIDEO_ES:
if( fmt->psz_description )
{
input_AddInfo( p_cat, _("Description"), "%s",
fmt->psz_description );
}
input_AddInfo( p_cat, _("Type"), _("Video") ); input_AddInfo( p_cat, _("Type"), _("Video") );
input_AddInfo( p_cat, _("Codec"), "%.4s", input_AddInfo( p_cat, _("Codec"), "%.4s",
(char*)&fmt->i_codec ); (char*)&fmt->i_codec );
......
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