Changeset 81b7c54562bbdb33e649686e170ce281d48975f6

Show
Ignore:
Timestamp:
07/01/03 22:49:01 (6 years ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1041976141 +0000
git-parent:

[4118695e4916cee3d34a3a67f14609e6bc67d6c7]

git-author:
Laurent Aimar <fenrir@videolan.org> 1041976141 +0000
Message:
  • all: I have added two new variables in es_descriptor_t and

decoder_fifo_t (p_waveformatex and p_bitmapinfoheader). It's
a replacement of p_demux_data as this variable is used by
some demuxers in another way. This way, I will be able to add
preliminary support of mpeg4 in mpeg2TS... (I haven't tested ogm
demuxer so if somebody wants ...)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/input_ext-dec.h

    rbc061e8 r81b7c54  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999-2001 VideoLAN 
    5  * $Id: input_ext-dec.h,v 1.77 2002/11/11 14:39:11 sam Exp $ 
     5 * $Id: input_ext-dec.h,v 1.78 2003/01/07 21:49:01 fenrir Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    108108    stream_ctrl_t *     p_stream_ctrl; 
    109109    sout_instance_t *   p_sout; 
     110    void *              p_waveformatex; 
     111    void *              p_bitmapinfoheader; 
    110112 
    111113    /* Module properties */ 
  • include/input_ext-intf.h

    rd3c3b32 r81b7c54  
    55 ***************************************************************************** 
    66 * Copyright (C) 1999, 2000 VideoLAN 
    7  * $Id: input_ext-intf.h,v 1.82 2002/12/31 01:54:35 massiot Exp $ 
     7 * $Id: input_ext-intf.h,v 1.83 2003/01/07 21:49:01 fenrir Exp $ 
    88 * 
    99 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    6666    /* Decoder information */ 
    6767    decoder_fifo_t *        p_decoder_fifo; 
     68    void *                  p_waveformatex; 
     69    void *                  p_bitmapinfoheader; 
    6870 
    6971    count_t                 c_packets;                 /* total packets read */ 
  • modules/codec/adpcm.c

    r2216d29 r81b7c54  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001, 2002 VideoLAN 
    5  * $Id: adpcm.c,v 1.4 2003/01/02 20:48:28 gbazin Exp $ 
     5 * $Id: adpcm.c,v 1.5 2003/01/07 21:49:01 fenrir Exp $ 
    66 * 
    77 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
     
    224224static int InitThread( adec_thread_t * p_adec ) 
    225225{ 
    226     if( !( p_adec->p_wf = (WAVEFORMATEX*)p_adec->p_fifo->p_demux_data )
     226    if( ( p_adec->p_wf = (WAVEFORMATEX*)p_adec->p_fifo->p_waveformatex ) == NULL
    227227    { 
    228228        msg_Err( p_adec->p_fifo, "missing format" ); 
  • modules/codec/araw.c

    r2216d29 r81b7c54  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001, 2002 VideoLAN 
    5  * $Id: araw.c,v 1.10 2003/01/02 20:48:28 gbazin Exp $ 
     5 * $Id: araw.c,v 1.11 2003/01/07 21:49:01 fenrir Exp $ 
    66 * 
    77 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
     
    194194static int InitThread( adec_thread_t * p_adec ) 
    195195{ 
    196  
    197     if( !p_adec->p_fifo->p_demux_data ) 
     196    if( ( p_adec->p_wf = (WAVEFORMATEX*)p_adec->p_fifo->p_waveformatex ) == NULL ) 
    198197    { 
    199198        msg_Err( p_adec->p_fifo, "unknown raw format" ); 
    200199        return( -1 ); 
    201200    } 
    202     p_adec->p_wf = (WAVEFORMATEX*)p_adec->p_fifo->p_demux_data; 
     201 
    203202    /* fixing some values */ 
    204203    if( p_adec->p_wf->wFormatTag  == WAVE_FORMAT_PCM &&  
  • modules/codec/faad/decoder.c

    r2216d29 r81b7c54  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001, 2002 VideoLAN 
    5  * $Id: decoder.c,v 1.16 2003/01/02 20:48:28 gbazin Exp $ 
     5 * $Id: decoder.c,v 1.17 2003/01/07 21:49:01 fenrir Exp $ 
    66 * 
    77 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
     
    199199static int InitThread( adec_thread_t * p_adec ) 
    200200{ 
     201    WAVEFORMATEX    *p_wf; 
    201202    int i_status; 
    202     unsigned long i_rate; 
    203     unsigned char i_nb_channels; 
    204              
     203    unsigned long   i_rate; 
     204    unsigned char   i_nb_channels; 
     205 
    205206    faacDecConfiguration *p_faad_config; 
    206207 
    207     if( !p_adec->p_fifo->p_demux_data
     208    if( ( p_wf = (WAVEFORMATEX*)p_adec->p_fifo->p_waveformatex ) == NULL
    208209    { 
    209210        msg_Warn( p_adec->p_fifo, 
     
    213214    { 
    214215        faac_GetWaveFormatEx( &p_adec->format, 
    215                               (u8*)p_adec->p_fifo->p_demux_data ); 
     216                              (uint8_t*)p_wf ); 
    216217    } 
    217218 
     
    227228        return( -1 ); 
    228229    } 
    229      
     230 
    230231    if( p_adec->format.p_data == NULL ) 
    231232    { 
  • modules/codec/ffmpeg/audio.c

    r2216d29 r81b7c54  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999-2001 VideoLAN 
    5  * $Id: audio.c,v 1.10 2003/01/02 20:48:28 gbazin Exp $ 
     5 * $Id: audio.c,v 1.11 2003/01/07 21:49:01 fenrir Exp $ 
    66 * 
    77 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
     
    117117int E_( InitThread_Audio )( adec_thread_t *p_adec ) 
    118118{ 
    119     if( p_adec->p_fifo->p_demux_data ) 
    120     { 
    121         ffmpeg_GetWaveFormatEx( &p_adec->format,  
    122                                 (u8*)p_adec->p_fifo->p_demux_data ); 
     119    WAVEFORMATEX *p_wf; 
     120 
     121    if( ( p_wf = p_adec->p_fifo->p_waveformatex ) != NULL ) 
     122    { 
     123        ffmpeg_GetWaveFormatEx( &p_adec->format, 
     124                                (uint8_t*)p_wf ); 
    123125    } 
    124126    else 
  • modules/codec/ffmpeg/video.c

    r30a998d r81b7c54  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999-2001 VideoLAN 
    5  * $Id: video.c,v 1.14 2002/12/18 16:31:25 fenrir Exp $ 
     5 * $Id: video.c,v 1.15 2003/01/07 21:49:01 fenrir Exp $ 
    66 * 
    77 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
     
    281281#endif 
    282282 
    283     if( p_vdec->p_fifo->p_demux_data ) 
    284     { 
    285         p_vdec->p_format = (BITMAPINFOHEADER *)p_vdec->p_fifo->p_demux_data; 
    286  
     283    if( ( p_vdec->p_format = (BITMAPINFOHEADER *)p_vdec->p_fifo->p_bitmapinfoheader) != NULL ) 
     284    { 
    287285        /* ***** Fill p_context with init values ***** */ 
    288286        p_vdec->p_context->width  = p_vdec->p_format->biWidth; 
  • modules/codec/xvid.c

    re2da42f r81b7c54  
    33 ***************************************************************************** 
    44 * Copyright (C) 2002 VideoLAN 
    5  * $Id: xvid.c,v 1.3 2002/11/28 17:34:59 sam Exp $ 
     5 * $Id: xvid.c,v 1.4 2003/01/07 21:49:01 fenrir Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    101101        return VLC_EGENERIC; 
    102102    } 
    103  
    104     p_format = (BITMAPINFOHEADER *)p_fifo->p_demux_data; 
    105  
    106     /* Guess picture properties from the BIH */ 
    107     i_width = p_format->biWidth; 
    108     i_height = p_format->biHeight; 
     103    if( ( p_format = (BITMAPINFOHEADER *)p_fifo->p_bitmapinfoheader ) == NULL ) 
     104    { 
     105        i_width  = 1; 
     106        i_height = 1;   // avoid segfault anyway it's wrong 
     107    } 
     108    else 
     109    { 
     110        /* Guess picture properties from the BIH */ 
     111        i_width = p_format->biWidth; 
     112        i_height = p_format->biHeight; 
     113    } 
     114 
    109115    i_chroma = VLC_FOURCC('Y','V','1','2'); 
    110116    i_aspect = VOUT_ASPECT_FACTOR * i_width / i_height; 
  • modules/demux/asf/asf.c

    rba3ec85 r81b7c54  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: asf.c,v 1.13 2003/01/05 21:03:58 sigmunau Exp $ 
     5 * $Id: asf.c,v 1.14 2003/01/07 21:49:01 fenrir Exp $ 
    66 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
    77 * 
     
    255255 
    256256                p_wf = malloc( i_size ); 
    257                 p_stream->p_es->p_demux_data = (void*)p_wf; 
     257                p_stream->p_es->p_waveformatex = (void*)p_wf; 
    258258                p_data = p_sp->p_type_specific_data; 
    259259 
     
    272272                if( i_size > sizeof( WAVEFORMATEX ) ) 
    273273                { 
    274                     memcpy( (uint8_t*)p_stream->p_es->p_demux_data + sizeof( WAVEFORMATEX ), 
     274                    memcpy( (uint8_t*)p_wf + sizeof( WAVEFORMATEX ), 
    275275                            p_data + sizeof( WAVEFORMATEX ), 
    276276                            i_size - sizeof( WAVEFORMATEX ) ); 
     
    310310 
    311311                p_bih = malloc( i_size ); 
    312                 p_stream->p_es->p_demux_data = (void*)p_bih; 
     312                p_stream->p_es->p_bitmapinfoheader = (void*)p_bih; 
    313313                p_data = p_sp->p_type_specific_data + 11; 
    314314 
     
    335335                if( i_size > sizeof( BITMAPINFOHEADER ) ) 
    336336                { 
    337                     memcpy( (uint8_t*)p_stream->p_es->p_demux_data + sizeof( BITMAPINFOHEADER ), 
     337                    memcpy( (uint8_t*)p_bih + sizeof( BITMAPINFOHEADER ), 
    338338                            p_data + sizeof( BITMAPINFOHEADER ), 
    339339                            i_size - sizeof( BITMAPINFOHEADER ) ); 
  • modules/demux/avi/avi.c

    r3479106 r81b7c54  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: avi.c,v 1.19 2002/12/27 15:40:52 sam Exp $ 
     5 * $Id: avi.c,v 1.20 2003/01/07 21:49:01 fenrir Exp $ 
    66 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
    77 * 
     
    975975                                   p_avi_strf_auds->p_wf->wBitsPerSample ); 
    976976                } 
    977                                     
    978                                     
    979                      
    980977                break; 
    981978 
     
    10441041            p_es = input_AddES( p_input, 
    10451042                                p_input->stream.p_selected_program, 1+i, 
    1046                                 i_init_size ); 
     1043                                0 ); 
    10471044        vlc_mutex_unlock( &p_input->stream.stream_lock ); 
    10481045        p_es->i_stream_id =i; /* XXX: i don't use it */ 
    10491046        p_es->i_fourcc = p_info->i_fourcc; 
    10501047        p_es->i_cat = p_info->i_cat; 
    1051  
    1052         /* We copy strf for decoder in p_es->p_demux_data */ 
    1053         if( p_init_data ) 
    1054         { 
    1055             memcpy( p_es->p_demux_data, 
    1056                     p_init_data, 
    1057                     i_init_size ); 
     1048        if( p_es->i_cat == AUDIO_ES ) 
     1049        { 
     1050            p_es->p_waveformatex = malloc( i_init_size ); 
     1051            memcpy( p_es->p_waveformatex, p_init_data, i_init_size ); 
     1052        } 
     1053        else if( p_es->i_cat == VIDEO_ES ) 
     1054        { 
     1055            p_es->p_bitmapinfoheader = malloc( i_init_size ); 
     1056            memcpy( p_es->p_bitmapinfoheader, p_init_data, i_init_size ); 
    10581057        } 
    10591058#undef p_info 
  • modules/demux/mp4/mp4.c

    rbe0f3d8 r81b7c54  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: mp4.c,v 1.10 2002/12/14 18:57:34 fenrir Exp $ 
     5 * $Id: mp4.c,v 1.11 2003/01/07 21:49:01 fenrir Exp $ 
    66 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
    77 * 
     
    11441144            break; 
    11451145    } 
    1146  
    1147     p_demux_track->p_es->p_demux_data = (es_sys_t *)p_init; 
     1146    if( p_demux_track->i_cat == AUDIO_ES ) 
     1147    { 
     1148        p_demux_track->p_es->p_waveformatex = (void*)p_init; 
     1149    } 
     1150    else if( p_demux_track->i_cat == VIDEO_ES ) 
     1151    { 
     1152        p_demux_track->p_es->p_bitmapinfoheader = (void*)p_init; 
     1153    } 
    11481154    vlc_mutex_lock( &p_input->stream.stream_lock ); 
    11491155    input_SelectES( p_input, p_demux_track->p_es ); 
  • modules/demux/ogg.c

    r71bd3ef r81b7c54  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: ogg.c,v 1.17 2002/12/20 15:18:56 sigmunau Exp $ 
     5 * $Id: ogg.c,v 1.18 2003/01/07 21:49:01 fenrir Exp $ 
    66 * 
    77 * Authors: Gildas Bazin <gbazin@netcourrier.com> 
     
    11291129        p_stream->p_es->i_fourcc = p_stream->i_fourcc; 
    11301130        p_stream->p_es->i_cat = p_stream->i_cat; 
    1131         p_stream->p_es->p_demux_data = p_stream->p_bih ? 
    1132             (void *)p_stream->p_bih : (void *)p_stream->p_wf
     1131        p_stream->p_es->p_waveformatex      = (void*)p_stream->p_wf; 
     1132        p_stream->p_es->p_bitmapinfoheader  = (void*)p_stream->p_bih
    11331133#undef p_stream 
    11341134    } 
  • modules/demux/rawdv.c

    rd5d568e r81b7c54  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: rawdv.c,v 1.1 2002/12/17 21:15:43 gbazin Exp $ 
     5 * $Id: rawdv.c,v 1.2 2003/01/07 21:49:01 fenrir Exp $ 
    66 * 
    77 * Authors: Gildas Bazin <gbazin@netcourrier.com> 
     
    268268    p_rawdv->p_video_es->i_fourcc = VLC_FOURCC( 'd','v','s','d' ); 
    269269    p_rawdv->p_video_es->i_cat = VIDEO_ES; 
    270     p_rawdv->p_video_es->p_demux_data = (void *)p_rawdv->p_bih; 
     270    p_rawdv->p_video_es->p_bitmapinfoheader = (void *)p_rawdv->p_bih; 
    271271    input_SelectES( p_input, p_rawdv->p_video_es ); 
    272272    vlc_mutex_unlock( &p_input->stream.stream_lock ); 
  • modules/demux/wav/wav.c

    rf22f4ef r81b7c54  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001 VideoLAN 
    5  * $Id: wav.c,v 1.8 2002/12/18 14:17:10 sam Exp $ 
     5 * $Id: wav.c,v 1.9 2003/01/07 21:49:01 fenrir Exp $ 
    66 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
    77 *  
     
    491491        p_demux->p_es = input_AddES( p_input, 
    492492                                     p_input->stream.p_selected_program, 1, 
    493                                      p_demux->i_wf ); 
     493                                     0 ); 
    494494        p_demux->p_es->i_stream_id = 1; 
    495495        p_demux->p_es->i_fourcc = p_demux->i_fourcc; 
    496496        p_demux->p_es->i_cat = AUDIO_ES; 
    497         memcpy( p_demux->p_es->p_demux_data, 
    498                 p_demux->p_wf, 
    499                 p_demux->i_wf ); 
    500          
     497        p_demux->p_es->p_waveformatex = malloc( p_demux->i_wf ); 
     498        memcpy( p_demux->p_es->p_waveformatex, p_demux->p_wf, p_demux->i_wf ); 
     499 
    501500        input_SelectES( p_input, p_demux->p_es ); 
    502          
     501 
    503502        p_input->stream.p_selected_program->b_is_ok = 1; 
    504503        vlc_mutex_unlock( &p_input->stream.stream_lock ); 
     
    514513 
    515514        p_demux->p_demux = module_Need( p_input, "demux", NULL ); 
    516          
     515 
    517516        p_input->psz_demux = psz_sav; 
    518          
     517 
    519518        if( !p_demux->p_demux ) 
    520519        { 
  • src/input/input_dec.c

    rcc4a55d r81b7c54  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999-2001 VideoLAN 
    5  * $Id: input_dec.c,v 1.54 2002/12/18 17:52:23 gbazin Exp $ 
     5 * $Id: input_dec.c,v 1.55 2003/01/07 21:49:01 fenrir Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    328328    p_fifo->i_id = p_es->i_id; 
    329329    p_fifo->i_fourcc = p_es->i_fourcc; 
    330     p_fifo->p_demux_data = p_es->p_demux_data; 
    331  
     330    p_fifo->p_demux_data   = p_es->p_demux_data; 
     331    p_fifo->p_waveformatex = p_es->p_waveformatex; 
     332    p_fifo->p_bitmapinfoheader = p_es->p_bitmapinfoheader; 
    332333    p_fifo->p_stream_ctrl = &p_input->stream.control; 
    333334    p_fifo->p_sout = p_input->stream.p_sout; 
  • src/input/input_programs.c

    rade615b r81b7c54  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999-2002 VideoLAN 
    5  * $Id: input_programs.c,v 1.99 2002/12/06 16:34:08 sam Exp $ 
     5 * $Id: input_programs.c,v 1.100 2003/01/07 21:49:01 fenrir Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    462462        p_es->p_demux_data = NULL; 
    463463    } 
     464    p_es->p_waveformatex     = NULL; 
     465    p_es->p_bitmapinfoheader = NULL; 
    464466 
    465467    /* Add this ES to the program definition if one is given */ 
     
    532534        free( p_es->p_demux_data ); 
    533535    } 
     536    if( p_es->p_waveformatex ) 
     537    { 
     538        free( p_es->p_waveformatex ); 
     539    } 
     540    if( p_es->p_bitmapinfoheader ) 
     541    { 
     542        free( p_es->p_bitmapinfoheader ); 
     543    } 
    534544 
    535545    /* Find the ES in the ES table */