Commit ba3ec85c authored by sigmunau's avatar sigmunau

modules/demux/asf/*: added some file info code

 modules/demux/util/id3tag.c: do not parse id3v1 tags at the end of file, as
these cause to much trubble
parent ba349ccc
......@@ -2,7 +2,7 @@
* asf.c : ASFv01 file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: asf.c,v 1.12 2002/12/06 16:34:06 sam Exp $
* $Id: asf.c,v 1.13 2003/01/05 21:03:58 sigmunau Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -149,7 +149,9 @@ static int Activate( vlc_object_t * p_this )
}
else
{
input_info_category_t *p_cat = input_InfoCategory( p_input, "Asf" );
msg_Dbg( p_input, "found %d streams", p_demux->i_streams );
input_AddInfo( p_cat, "Number of streams", "%d" , p_demux->i_streams );
}
/* create one program */
......@@ -174,6 +176,10 @@ static int Activate( vlc_object_t * p_this )
{
asf_stream_t *p_stream;
asf_object_stream_properties_t *p_sp;
char psz_cat[sizeof("Stream ")+10];
input_info_category_t *p_cat;
sprintf( psz_cat, "Stream %d", i_stream );
p_cat = input_InfoCategory( p_input, psz_cat);
p_sp = ASF_FindObject( p_demux->root.p_hdr,
&asf_object_stream_properties_guid,
......@@ -206,6 +212,7 @@ static int Activate( vlc_object_t * p_this )
}
p_stream->i_cat = AUDIO_ES;
input_AddInfo( p_cat, "Type", "Audio" );
msg_Dbg( p_input,
"adding new audio stream(codec:0x%x,ID:%d)",
i_codec,
......@@ -237,6 +244,7 @@ static int Activate( vlc_object_t * p_this )
p_stream->p_es->i_fourcc =
VLC_FOURCC( 'm','s',(i_codec >> 8)&0xff,i_codec&0xff );
}
input_AddInfo( p_cat, "Codec", "%.4s", (char*)&p_stream->p_es->i_fourcc );
if( p_sp->i_type_specific_data_length > 0 )
{
WAVEFORMATEX *p_wf;
......@@ -251,10 +259,14 @@ static int Activate( vlc_object_t * p_this )
p_wf->wFormatTag = GetWLE( p_data );
p_wf->nChannels = GetWLE( p_data + 2 );
input_AddInfo( p_cat, "Channels", "%d", p_wf->nChannels );
p_wf->nSamplesPerSec = GetDWLE( p_data + 4 );
input_AddInfo( p_cat, "Sample rate", "%d", p_wf->nSamplesPerSec );
p_wf->nAvgBytesPerSec = GetDWLE( p_data + 8 );
input_AddInfo( p_cat, "Avg. byterate", "%d", p_wf->nAvgBytesPerSec );
p_wf->nBlockAlign = GetWLE( p_data + 12 );
p_wf->wBitsPerSample = GetWLE( p_data + 14 );
input_AddInfo( p_cat, "Bits Per Sample", "%d", p_wf->wBitsPerSample );
p_wf->cbSize = __MAX( 0,
i_size - sizeof( WAVEFORMATEX ));
if( i_size > sizeof( WAVEFORMATEX ) )
......@@ -270,6 +282,7 @@ 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;
input_AddInfo( p_cat, "Type", "Video" );
msg_Dbg( p_input,
"adding new video stream(ID:%d)",
p_sp->i_stream_number );
......@@ -286,6 +299,7 @@ static int Activate( vlc_object_t * p_this )
p_stream->p_es->i_fourcc =
VLC_FOURCC( 'u','n','d','f' );
}
input_AddInfo( p_cat, "Codec", "%.4s", (char*)&p_stream->p_es->i_fourcc );
if( p_sp->i_type_specific_data_length > 11 )
{
BITMAPINFOHEADER *p_bih;
......@@ -299,14 +313,22 @@ static int Activate( vlc_object_t * p_this )
p_data = p_sp->p_type_specific_data + 11;
p_bih->biSize = GetDWLE( p_data );
input_AddInfo( p_cat, "Size", "%d", p_bih->biSize );
p_bih->biWidth = GetDWLE( p_data + 4 );
p_bih->biHeight = GetDWLE( p_data + 8 );
input_AddInfo( p_cat, "Resolution", "%dx%d", p_bih->biWidth, p_bih->biHeight );
p_bih->biPlanes = GetDWLE( p_data + 12 );
input_AddInfo( p_cat, "Planes", "%d", p_bih->biPlanes );
p_bih->biBitCount = GetDWLE( p_data + 14 );
input_AddInfo( p_cat, "Bits per pixel", "%d", p_bih->biBitCount );
p_bih->biCompression= GetDWLE( p_data + 16 );
input_AddInfo( p_cat, "Compression Rate", "%d", p_bih->biCompression );
p_bih->biSizeImage = GetDWLE( p_data + 20 );
input_AddInfo( p_cat, "Image Size", "%d", p_bih->biSizeImage );
p_bih->biXPelsPerMeter = GetDWLE( p_data + 24 );
input_AddInfo( p_cat, "X pixels per meter", "%d", p_bih->biXPelsPerMeter );
p_bih->biYPelsPerMeter = GetDWLE( p_data + 28 );
input_AddInfo( p_cat, "Y pixels per meter", "%d", p_bih->biYPelsPerMeter );
p_bih->biClrUsed = GetDWLE( p_data + 32 );
p_bih->biClrImportant = GetDWLE( p_data + 36 );
......
......@@ -2,7 +2,7 @@
* libasf.c :
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: libasf.c,v 1.9 2002/12/18 14:17:10 sam Exp $
* $Id: libasf.c,v 1.10 2003/01/05 21:03:58 sigmunau Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -605,8 +605,15 @@ int ASF_ReadObject_codec_list( input_thread_t *p_input,
p_cl->i_codec_entries_count );
for( i_codec = 0; i_codec < p_cl->i_codec_entries_count; i_codec++ )
{
char psz_cat[sizeof("Stream ")+10];
input_info_category_t *p_cat;
sprintf( psz_cat, "Stream %d", i_codec );
p_cat = input_InfoCategory( p_input, psz_cat);
#define codec p_cl->codec[i_codec]
msg_Dbg( p_input,
input_AddInfo( p_cat, "Codec name", codec.psz_name );
input_AddInfo( p_cat, "Codec description", codec.psz_description );
msg_Dbg( p_input,
"Read \"Codec List Object\" codec[%d] %s name:\"%s\" description:\"%s\" information_length:%d",
i_codec,
( codec.i_type == ASF_CODEC_TYPE_VIDEO ) ? "video" : ( ( codec.i_type == ASF_CODEC_TYPE_AUDIO ) ? "audio" : "unknown" ),
......@@ -684,6 +691,14 @@ int ASF_ReadObject_content_description( input_thread_t *p_input,
#undef GETSTRINGW
#ifdef ASF_DEBUG
{
input_info_category_t *p_cat = input_InfoCategory( p_input, "Asf" );
input_AddInfo( p_cat, "Title", p_cd->psz_title );
input_AddInfo( p_cat, "Author", p_cd->psz_author );
input_AddInfo( p_cat, "Copyright", p_cd->psz_copyright );
input_AddInfo( p_cat, "Description", p_cd->psz_description );
input_AddInfo( p_cat, "Rating", p_cd->psz_rating );
}
msg_Dbg( p_input,
"Read \"Content Description Object\" title:\"%s\" author:\"%s\" copyright:\"%s\" description:\"%s\" rating:\"%s\"",
p_cd->psz_title,
......
......@@ -2,7 +2,7 @@
* id3tag.c: id3 tag parser/skipper based on libid3tag
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: id3tag.c,v 1.2 2002/10/13 14:26:48 sigmunau Exp $
* $Id: id3tag.c,v 1.3 2003/01/05 21:03:58 sigmunau Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
......@@ -115,6 +115,7 @@ static int ParseID3Tags( vlc_object_t *p_this )
}
i_size = id3_tag_query( p_peek, 10 );
#if 0
if ( p_input->stream.b_seekable )
{
/*look for a id3v1 tag at the end of the file*/
......@@ -171,6 +172,7 @@ static int ParseID3Tags( vlc_object_t *p_this )
p_input->pf_seek( p_input, 0 );
input_AccessReinit( p_input );
}
#endif
if ( i_size <= 0 )
{
return( VLC_SUCCESS );
......
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