Commit 64d33dc9 authored by Sam Hocevar's avatar Sam Hocevar

* ALL: decoders now use a fourcc as a probe value.

  * include/input_ext-intf.h: killed p_es->b_audio, since i_cat already fills
    its purpose.
  * include/input_ext-intf.h: killed p_es->i_type in favour of p_es->i_fourcc.
  * include/video.h: killed p_pic->p_plane->b_margin; now i_visible_pitch is
    always valid.

  * ./src/libvlc.h: replaced --mpeg-adec and --ac3-adec with --codec; see
    vlc --help for more information.

  * include/video.h: removed fourcc values which should _not_ be global
    (thanks fenrir for convincing me).
  * ALL: video output plugins use the VLC_FOURCC macro to build their fourccs.
  * ./plugins/beos/InterfaceWindow.cpp: removed the last remaining call to
    input_ChangeES.

   Things I'm not sure about and need comments:
    - I used "mpga" and "mpgv" for MPEG (1+2) audio and video fourcc values.
    - I also introduced "spu ", "lpcm" and "ac3 ".
    - I removed for instance "MP4_GetCodec" because it wasn't really
      used except for the description string. I hope this change did not
      break anything really important.
    - fenrir, I must have broken a lot of things you wrote. Sorry in advance.
parent 97bf3e7d
......@@ -352,6 +352,15 @@ endif
plugins-uninstall:
rm -f $(DESTDIR)$(libdir)/vlc/*.so
builtins-install:
mkdir -p $(DESTDIR)$(libdir)/vlc
ifneq (,$(BUILTINS))
$(INSTALL) $(BUILTINS:%=plugins/%.a) $(DESTDIR)$(libdir)/vlc
endif
builtins-uninstall:
rm -f $(DESTDIR)$(libdir)/vlc/*.a
libvlc-install:
mkdir -p $(DESTDIR)$(bindir)
$(INSTALL) vlc-config $(DESTDIR)$(bindir)
......
......@@ -1787,7 +1787,7 @@ dnl
dnl Create the vlc-config script
dnl
libvlc_LDFLAGS="${vlc_LDFLAGS} ${builtins_LDFLAGS}"
for i in ${BUILTINS} ; do libvlc_LDFLAGS="${libvlc_LDFLAGS} `eval echo '$'{${i}_LDFLAGS}`" ; done
for i in ${BUILTINS} ; do libvlc_LDFLAGS="${libvlc_LDFLAGS} @libdir@/${i}.a `eval echo '$'{${i}_LDFLAGS}`" ; done
AC_SUBST(libvlc_LDFLAGS)
dnl
......
usr/bin
usr/lib
usr/lib/vlc
usr/include/vlc
usr/share/doc
......@@ -80,6 +80,7 @@ install: build
# install development files
mv debian/vlc/usr/bin/vlc-config debian/libvlc0-dev/usr/bin/
mv debian/vlc/usr/lib/*.a debian/libvlc0-dev/usr/lib/
# mv debian/vlc/usr/lib/vlc/*.a debian/libvlc0-dev/usr/lib/vlc/
mv debian/vlc/usr/include/vlc/* debian/libvlc0-dev/usr/include/vlc/
ln -s vlc debian/libvlc0-dev/usr/share/doc/libvlc0-dev
......
......@@ -2,7 +2,7 @@
* input_ext-dec.h: structures exported to the VideoLAN decoders
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: input_ext-dec.h,v 1.63 2002/07/21 15:18:29 fenrir Exp $
* $Id: input_ext-dec.h,v 1.64 2002/07/23 00:39:16 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Kaempf <maxx@via.ecp.fr>
......@@ -25,7 +25,9 @@
#ifndef _VLC_INPUT_EXT_DEC_H
#define _VLC_INPUT_EXT_DEC_H 1
/* ES streams types - see ISO/IEC 13818-1 table 2-29 numbers */
/* ES streams types - see ISO/IEC 13818-1 table 2-29 numbers.
* these values are used in src/input/mpeg_system.c, and in
* the following plugins: mpeg_ts, mpeg_ts_dvbpsi, input_satellite. */
#define MPEG1_VIDEO_ES 0x01
#define MPEG2_VIDEO_ES 0x02
#define MPEG1_AUDIO_ES 0x03
......@@ -34,16 +36,6 @@
/* These ones might violate the norm : */
#define DVD_SPU_ES 0x82
#define LPCM_AUDIO_ES 0x83
#define MSMPEG4v1_VIDEO_ES 0x40
#define MSMPEG4v2_VIDEO_ES 0x41
#define MSMPEG4v3_VIDEO_ES 0x42
#define MPEG4_VIDEO_ES 0x50
#define H263_VIDEO_ES 0x60
#define I263_VIDEO_ES 0x61
#define SVQ1_VIDEO_ES 0x62
#define CINEPAK_VIDEO_ES 0x65
#define UNKNOWN_ES 0xFF
/* Structures exported to the decoders */
......@@ -123,7 +115,7 @@ struct decoder_fifo_t
/* Standard pointers given to the decoders as a toolbox. */
u16 i_id;
u8 i_type;
vlc_fourcc_t i_fourcc;
void * p_demux_data;
stream_ctrl_t * p_stream_ctrl;
};
......
......@@ -4,7 +4,7 @@
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.71 2002/07/21 19:26:13 sigmunau Exp $
* $Id: input_ext-intf.h,v 1.72 2002/07/23 00:39:16 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -47,12 +47,8 @@ struct es_descriptor_t
{
u16 i_id; /* stream ID for PS, PID for TS */
u8 i_stream_id; /* stream ID defined in the PES */
u8 i_type; /* stream type */
vlc_bool_t b_audio; /* is the stream an audio stream that
* will need to be discarded with
* fast forward and slow motion ? */
u8 i_cat; /* stream category: video, audio,
* spu, other */
vlc_fourcc_t i_fourcc; /* stream type */
u8 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
......@@ -86,11 +82,11 @@ struct es_descriptor_t
/* ES Categories to be used by interface plugins */
#define VIDEO_ES 0x00
#define AUDIO_ES 0x01
#define SPU_ES 0x02
#define NAV_ES 0x03
#define UNKNOWN_ES 0xFF
#define UNKNOWN_ES 0x00
#define VIDEO_ES 0x01
#define AUDIO_ES 0x02
#define SPU_ES 0x03
#define NAV_ES 0x04
/*****************************************************************************
* pgrm_descriptor_t
......@@ -368,7 +364,6 @@ VLC_EXPORT( void, __input_Tell, ( vlc_object_t *, stream_position_t * ) );
VLC_EXPORT( void, input_DumpStream, ( input_thread_t * ) );
VLC_EXPORT( char *, input_OffsetToTime, ( input_thread_t *, char *, off_t ) );
VLC_EXPORT( int, input_ChangeES, ( input_thread_t *, es_descriptor_t *, u8 ) );
VLC_EXPORT( int, input_ToggleES, ( input_thread_t *, es_descriptor_t *, vlc_bool_t ) );
VLC_EXPORT( int, input_ChangeArea, ( input_thread_t *, input_area_t * ) );
VLC_EXPORT( int, input_ChangeProgram, ( input_thread_t *, u16 ) );
......
......@@ -2,7 +2,7 @@
* modules.h : Module management functions.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: modules.h,v 1.57 2002/07/20 18:01:41 sam Exp $
* $Id: modules.h,v 1.58 2002/07/23 00:39:16 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -283,7 +283,7 @@ typedef struct function_list_t
/* Decoder plugins */
struct
{
int ( * pf_probe)( u8 * p_es );
int ( * pf_probe)( vlc_fourcc_t * p_es );
int ( * pf_run ) ( decoder_fifo_t * p_fifo );
} dec;
......
......@@ -4,7 +4,7 @@
* includes all common video types and constants.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video.h,v 1.55 2002/07/20 18:01:41 sam Exp $
* $Id: video.h,v 1.56 2002/07/23 00:39:16 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -35,14 +35,10 @@ typedef struct plane_t
int i_pitch; /* Number of bytes in a line, including margins */
/* Size of a macropixel, defaults to 1 */
int i_pixel_bytes;
/* Is there a margin ? defaults to no */
vlc_bool_t b_margin;
int i_pixel_pitch;
/* Variables used for pictures with margins */
int i_visible_bytes; /* How many real pixels are there ? */
vlc_bool_t b_hidden; /* Are we allowed to write to the margin ? */
int i_visible_pitch; /* How many visible pixels are there ? */
} plane_t;
......@@ -99,10 +95,10 @@ struct picture_heap_t
/* Picture static properties - those properties are fixed at initialization
* and should NOT be modified */
int i_width; /* picture width */
int i_height; /* picture height */
u32 i_chroma; /* picture chroma */
int i_aspect; /* aspect ratio */
int i_width; /* picture width */
int i_height; /* picture height */
vlc_fourcc_t i_chroma; /* picture chroma */
int i_aspect; /* aspect ratio */
/* Real pictures */
picture_t* pp_picture[VOUT_MAX_PICTURES]; /* pictures */
......@@ -140,152 +136,6 @@ struct picture_heap_t
#define DISPLAYED_PICTURE 5 /* been displayed but is linked */
#define DESTROYED_PICTURE 6 /* allocated but no more used */
/*****************************************************************************
* Codes used to describe picture format - see http://www.webartz.com/fourcc/
*****************************************************************************/
#define VLC_FOURCC( a, b, c, d ) \
( ((u32)a) | ( ((u32)b) << 8 ) | ( ((u32)c) << 16 ) | ( ((u32)d) << 24 ) )
#define VLC_TWOCC( a, b ) \
( (u16)(a) | ( (u16)(b) << 8 ) )
/* AVI stuff */
#define FOURCC_RIFF VLC_FOURCC('R','I','F','F')
#define FOURCC_LIST VLC_FOURCC('L','I','S','T')
#define FOURCC_JUNK VLC_FOURCC('J','U','N','K')
#define FOURCC_AVI VLC_FOURCC('A','V','I',' ')
#define FOURCC_WAVE VLC_FOURCC('W','A','V','E')
#define FOURCC_avih VLC_FOURCC('a','v','i','h')
#define FOURCC_hdrl VLC_FOURCC('h','d','r','l')
#define FOURCC_movi VLC_FOURCC('m','o','v','i')
#define FOURCC_idx1 VLC_FOURCC('i','d','x','1')
#define FOURCC_strl VLC_FOURCC('s','t','r','l')
#define FOURCC_strh VLC_FOURCC('s','t','r','h')
#define FOURCC_strf VLC_FOURCC('s','t','r','f')
#define FOURCC_strd VLC_FOURCC('s','t','r','d')
#define FOURCC_rec VLC_FOURCC('r','e','c',' ')
#define FOURCC_auds VLC_FOURCC('a','u','d','s')
#define FOURCC_vids VLC_FOURCC('v','i','d','s')
#define TWOCC_wb VLC_TWOCC('w','b')
#define TWOCC_db VLC_TWOCC('d','b')
#define TWOCC_dc VLC_TWOCC('d','c')
#define TWOCC_pc VLC_TWOCC('p','c')
/* MPEG4 codec */
#define FOURCC_DIVX VLC_FOURCC('D','I','V','X')
#define FOURCC_divx VLC_FOURCC('d','i','v','x')
#define FOURCC_DIV1 VLC_FOURCC('D','I','V','1')
#define FOURCC_div1 VLC_FOURCC('d','i','v','1')
#define FOURCC_MP4S VLC_FOURCC('M','P','4','S')
#define FOURCC_mp4s VLC_FOURCC('m','p','4','s')
#define FOURCC_M4S2 VLC_FOURCC('M','4','S','2')
#define FOURCC_m4s2 VLC_FOURCC('m','4','s','2')
#define FOURCC_xvid VLC_FOURCC('x','v','i','d')
#define FOURCC_XVID VLC_FOURCC('X','V','I','D')
#define FOURCC_XviD VLC_FOURCC('X','v','i','D')
#define FOURCC_DX50 VLC_FOURCC('D','X','5','0')
#define FOURCC_mp4v VLC_FOURCC('m','p','4','v')
#define FOURCC_4 VLC_FOURCC( 4, 0, 0, 0 )
/* MSMPEG4 v2 */
#define FOURCC_MPG4 VLC_FOURCC('M','P','G','4')
#define FOURCC_mpg4 VLC_FOURCC('m','p','g','4')
#define FOURCC_DIV2 VLC_FOURCC('D','I','V','2')
#define FOURCC_div2 VLC_FOURCC('d','i','v','2')
#define FOURCC_MP42 VLC_FOURCC('M','P','4','2')
#define FOURCC_mp42 VLC_FOURCC('m','p','4','2')
/* MSMPEG4 v3 / M$ mpeg4 v3 */
#define FOURCC_MPG3 VLC_FOURCC('M','P','G','3')
#define FOURCC_mpg3 VLC_FOURCC('m','p','g','3')
#define FOURCC_div3 VLC_FOURCC('d','i','v','3')
#define FOURCC_MP43 VLC_FOURCC('M','P','4','3')
#define FOURCC_mp43 VLC_FOURCC('m','p','4','3')
/* DivX 3.20 */
#define FOURCC_DIV3 VLC_FOURCC('D','I','V','3')
#define FOURCC_DIV4 VLC_FOURCC('D','I','V','4')
#define FOURCC_div4 VLC_FOURCC('d','i','v','4')
#define FOURCC_DIV5 VLC_FOURCC('D','I','V','5')
#define FOURCC_div5 VLC_FOURCC('d','i','v','5')
#define FOURCC_DIV6 VLC_FOURCC('D','I','V','6')
#define FOURCC_div6 VLC_FOURCC('d','i','v','6')
/* AngelPotion stuff */
#define FOURCC_AP41 VLC_FOURCC('A','P','4','1')
/* ?? */
#define FOURCC_3IV1 VLC_FOURCC('3','I','V','1')
/* H263 and H263i */
#define FOURCC_H263 VLC_FOURCC('H','2','6','3')
#define FOURCC_h263 VLC_FOURCC('h','2','6','3')
#define FOURCC_U263 VLC_FOURCC('U','2','6','3')
#define FOURCC_I263 VLC_FOURCC('I','2','6','3')
#define FOURCC_i263 VLC_FOURCC('i','2','6','3')
/* Packed RGB for 8bpp */
#define FOURCC_BI_RGB VLC_FOURCC( 0 , 0 , 0 , 0 )
#define FOURCC_RGB2 VLC_FOURCC('R','G','B','2')
/* Packed RGB for 16, 24, 32bpp */
#define FOURCC_BI_BITFIELDS VLC_FOURCC( 0 , 0 , 0 , 3 )
/* Packed RGB 15bpp, 0x1f, 0x7e0, 0xf800 */
#define FOURCC_RV15 VLC_FOURCC('R','V','1','5')
/* Packed RGB 16bpp, 0x1f, 0x3e0, 0x7c00 */
#define FOURCC_RV16 VLC_FOURCC('R','V','1','6')
/* Packed RGB 24bpp, 0xff, 0xff00, 0xff0000 */
#define FOURCC_RV24 VLC_FOURCC('R','V','2','4')
/* Packed RGB 32bpp, 0xff, 0xff00, 0xff0000 */
#define FOURCC_RV32 VLC_FOURCC('R','V','3','2')
/* Planar YUV 4:2:0, Y:U:V */
#define FOURCC_I420 VLC_FOURCC('I','4','2','0')
#define FOURCC_IYUV VLC_FOURCC('I','Y','U','V')
/* Planar YUV 4:2:0, Y:V:U */
#define FOURCC_YV12 VLC_FOURCC('Y','V','1','2')
/* Packed YUV 4:2:2, U:Y:V:Y, interlaced */
#define FOURCC_IUYV VLC_FOURCC('I','U','Y','V')
/* Packed YUV 4:2:2, U:Y:V:Y */
#define FOURCC_UYVY VLC_FOURCC('U','Y','V','Y')
#define FOURCC_UYNV VLC_FOURCC('U','Y','N','V')
#define FOURCC_Y422 VLC_FOURCC('Y','4','2','2')
/* Packed YUV 4:2:2, U:Y:V:Y, reverted */
#define FOURCC_cyuv VLC_FOURCC('c','y','u','v')
/* Packed YUV 4:2:2, Y:U:Y:V */
#define FOURCC_YUY2 VLC_FOURCC('Y','U','Y','2')
#define FOURCC_YUNV VLC_FOURCC('Y','U','N','V')
/* Packed YUV 4:2:2, Y:V:Y:U */
#define FOURCC_YVYU VLC_FOURCC('Y','V','Y','U')
/* Packed YUV 2:1:1, Y:U:Y:V */
#define FOURCC_Y211 VLC_FOURCC('Y','2','1','1')
/* Custom formats which we use but which don't exist in the fourcc database */
/* Planar Y, packed UV, from Matrox */
#define FOURCC_YMGA VLC_FOURCC('Y','M','G','A')
/* Planar 4:2:2, Y:U:V */
#define FOURCC_I422 VLC_FOURCC('I','4','2','2')
/* Planar 4:4:4, Y:U:V */
#define FOURCC_I444 VLC_FOURCC('I','4','4','4')
/*****************************************************************************
* Shortcuts to access image components
*****************************************************************************/
......
......@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc_common.h,v 1.11 2002/07/21 19:26:13 sigmunau Exp $
* $Id: vlc_common.h,v 1.12 2002/07/23 00:39:16 sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -117,6 +117,19 @@ typedef u8 yuv_data_t;
*****************************************************************************/
typedef s64 mtime_t;
/*****************************************************************************
* The vlc_fourcc_t type.
*****************************************************************************
* See http://www.webartz.com/fourcc/ for a very detailed list.
*****************************************************************************/
typedef u32 vlc_fourcc_t;
#define VLC_FOURCC( a, b, c, d ) \
( ((u32)a) | ( ((u32)b) << 8 ) | ( ((u32)c) << 16 ) | ( ((u32)d) << 24 ) )
#define VLC_TWOCC( a, b ) \
( (u16)(a) | ( (u16)(b) << 8 ) )
/*****************************************************************************
* Classes declaration
*****************************************************************************/
......
......@@ -37,7 +37,6 @@ struct module_symbols_t
int (* input_AccessInit_inner) ( input_thread_t * ) ;
int (* input_AddInfo_inner) ( input_info_category_t *, char *, char *, ... ) ;
int (* input_ChangeArea_inner) ( input_thread_t *, input_area_t * ) ;
int (* input_ChangeES_inner) ( input_thread_t *, es_descriptor_t *, u8 ) ;
int (* input_ChangeProgram_inner) ( input_thread_t *, u16 ) ;
int (* input_ClockManageControl_inner) ( input_thread_t *, pgrm_descriptor_t *, mtime_t ) ;
int (* input_InitStream_inner) ( input_thread_t *, size_t ) ;
......@@ -213,7 +212,6 @@ struct module_symbols_t
# define input_AddProgram p_symbols->input_AddProgram_inner
# define input_BuffersEnd p_symbols->input_BuffersEnd_inner
# define input_ChangeArea p_symbols->input_ChangeArea_inner
# define input_ChangeES p_symbols->input_ChangeES_inner
# define input_ChangeProgram p_symbols->input_ChangeProgram_inner
# define input_ClockGetTS p_symbols->input_ClockGetTS_inner
# define input_ClockManageControl p_symbols->input_ClockManageControl_inner
......
......@@ -4,7 +4,7 @@
* (http://liba52.sf.net/).
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: a52.c,v 1.20 2002/07/19 22:04:37 massiot Exp $
* $Id: a52.c,v 1.21 2002/07/23 00:39:16 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -63,7 +63,7 @@ static vlc_bool_t b_liba52_initialized = 0;
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int decoder_Probe ( u8 * );
static int decoder_Probe ( vlc_fourcc_t * );
static int decoder_Run ( decoder_fifo_t * );
static int DecodeFrame ( a52_adec_thread_t * );
static int InitThread ( a52_adec_thread_t * );
......@@ -116,9 +116,9 @@ MODULE_DEACTIVATE_STOP
* Tries to launch a decoder and return score so that the interface is able
* to choose.
*****************************************************************************/
static int decoder_Probe( u8 *pi_type )
static int decoder_Probe( vlc_fourcc_t *pi_type )
{
return ( *pi_type == AC3_AUDIO_ES ? 0 : -1 );
return *pi_type == VLC_FOURCC('a','5','2',' ') ? 0 : -1;
}
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* a52_system.c : A52 input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: a52_system.c,v 1.1 2002/06/02 23:43:38 bozo Exp $
* $Id: a52_system.c,v 1.2 2002/07/23 00:39:16 sam Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -131,7 +131,7 @@ static int Init( 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, 0xBD, 0 );
p_es->i_stream_id = 0xBD;
p_es->i_type = AC3_AUDIO_ES;
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;
......
......@@ -2,7 +2,7 @@
* vout_aa.c: Aa video output display method for testing purposes
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: aa.c,v 1.7 2002/07/20 18:01:42 sam Exp $
* $Id: aa.c,v 1.8 2002/07/23 00:39:16 sam Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
......@@ -145,7 +145,7 @@ static int vout_Init( vout_thread_t *p_vout )
I_OUTPUTPICTURES = 0;
p_vout->output.i_chroma = FOURCC_RGB2;
p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2');
p_vout->output.i_width = p_vout->p_sys->i_width;
p_vout->output.i_height = p_vout->p_sys->i_height;
p_vout->output.i_aspect = p_vout->p_sys->i_width
......@@ -169,10 +169,10 @@ static int vout_Init( vout_thread_t *p_vout )
/* Allocate the picture */
p_pic->p->p_pixels = aa_image( p_vout->p_sys->aa_context );
p_pic->p->i_pixel_bytes = 1;
p_pic->p->i_lines = p_vout->p_sys->i_height;
p_pic->p->i_pitch = p_vout->p_sys->i_width;
p_pic->p->b_margin = 0;
p_pic->p->i_pixel_pitch = 1;
p_pic->p->i_visible_pitch = p_vout->p_sys->i_width;
p_pic->i_planes = 1;
p_pic->i_status = DESTROYED_PICTURE;
......
......@@ -2,7 +2,7 @@
* ac3_adec.c: ac3 decoder module main file
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: ac3_adec.c,v 1.33 2002/06/01 18:04:48 sam Exp $
* $Id: ac3_adec.c,v 1.34 2002/07/23 00:39:16 sam Exp $
*
* Authors: Michel Lespinasse <walken@zoy.org>
*
......@@ -44,7 +44,7 @@
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int decoder_Probe ( u8 * );
static int decoder_Probe ( vlc_fourcc_t * );
static int decoder_Run ( decoder_fifo_t * );
static int InitThread ( ac3dec_t * p_adec );
static void EndThread ( ac3dec_t * p_adec );
......@@ -96,9 +96,9 @@ MODULE_DEACTIVATE_STOP
* Tries to launch a decoder and return score so that the interface is able
* to chose.
*****************************************************************************/
static int decoder_Probe( u8 *pi_type )
static int decoder_Probe( vlc_fourcc_t *pi_type )
{
return ( *pi_type == AC3_AUDIO_ES ) ? 0 : -1;
return *pi_type == VLC_FOURCC('a','5','2',' ') ? 0 : -1;
}
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* ac3_spdif.c: ac3 pass-through to external decoder with enabled soundcard
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: ac3_spdif.c,v 1.30 2002/06/05 18:15:46 stef Exp $
* $Id: ac3_spdif.c,v 1.31 2002/07/23 00:39:16 sam Exp $
*
* Authors: Stphane Borel <stef@via.ecp.fr>
* Juha Yrjola <jyrjola@cc.hut.fi>
......@@ -44,7 +44,7 @@
/****************************************************************************
* Local Prototypes
****************************************************************************/
static int decoder_Probe ( u8 * );
static int decoder_Probe ( vlc_fourcc_t * );
static int decoder_Run ( decoder_fifo_t * );
static int InitThread ( ac3_spdif_thread_t * );
static void EndThread ( ac3_spdif_thread_t * );
......@@ -132,9 +132,9 @@ MODULE_DEACTIVATE_STOP
* Tries to launch a decoder and return score so that the interface is able
* to chose.
*****************************************************************************/
static int decoder_Probe( u8 *pi_type )
static int decoder_Probe( vlc_fourcc_t *pi_type )
{
return( *pi_type == AC3_AUDIO_ES ) ? 0 : -1;
return( *pi_type == VLC_FOURCC('a','5','2',' ') ) ? 0 : -1;
}
......
......@@ -2,7 +2,7 @@
* avi.c : AVI file Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: avi.c,v 1.31 2002/07/15 19:33:02 fenrir Exp $
* $Id: avi.c,v 1.32 2002/07/23 00:39:16 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -180,28 +180,31 @@ static inline int AVI_GetESTypeFromTwoCC( u16 i_type )
}
}
static int AVI_AudioGetType( u32 i_type )
static vlc_fourcc_t AVI_AudioGetType( u32 i_type )
{
switch( i_type )
{
/* case( WAVE_FORMAT_PCM ):
return( WAVE_AUDIO_ES ); */
return VLC_FOURCC('l','p','c','m'); */
case( WAVE_FORMAT_AC3 ):
return( AC3_AUDIO_ES );
return VLC_FOURCC('a','5','2',' ');
case( WAVE_FORMAT_MPEG):
case( WAVE_FORMAT_MPEGLAYER3):
return( MPEG2_AUDIO_ES ); /* 2 for mpeg-2 layer 1 2 ou 3 */
return VLC_FOURCC('m','p','g','a'); /* for mpeg2 layer 1 2 ou 3 */
default:
return( 0 );
return 0;
}
}
/* Test if it seems that it's a key frame */
static int AVI_GetKeyFlag( int i_type, u8 *p_byte )
static int AVI_GetKeyFlag( vlc_fourcc_t i_fourcc, u8 *p_byte )
{
switch( i_type )
switch( i_fourcc )
{
case( MSMPEG4v1_VIDEO_ES ):
case FOURCC_DIV1:
case FOURCC_div1:
case FOURCC_MPG4:
case FOURCC_mpg4:
if( GetDWBE( p_byte ) != 0x00000100 )
/* startcode perhaps swapped, I haven't tested */
{
......@@ -213,11 +216,38 @@ static int AVI_GetKeyFlag( int i_type, u8 *p_byte )
{
return( (*(p_byte+4))&0x06 ? 0 : AVIIF_KEYFRAME);
}
case( MSMPEG4v2_VIDEO_ES ):
case( MSMPEG4v3_VIDEO_ES ):
case FOURCC_DIV2:
case FOURCC_div2:
case FOURCC_MP42:
case FOURCC_mp42:
case FOURCC_MPG3:
case FOURCC_mpg3:
case FOURCC_div3:
case FOURCC_MP43:
case FOURCC_mp43:
case FOURCC_DIV3:
case FOURCC_DIV4:
case FOURCC_div4:
case FOURCC_DIV5:
case FOURCC_div5:
case FOURCC_DIV6:
case FOURCC_div6:
case FOURCC_AP41:
case FOURCC_3IV1:
// printf( "\n Is a Key Frame %s", (*p_byte)&0xC0 ? "no" : "yes!!" );
return( (*p_byte)&0xC0 ? 0 : AVIIF_KEYFRAME );
case( MPEG4_VIDEO_ES ):
case FOURCC_DIVX:
case FOURCC_divx:
case FOURCC_MP4S:
case FOURCC_mp4s:
case FOURCC_M4S2:
case FOURCC_m4s2:
case FOURCC_xvid:
case FOURCC_XVID:
case FOURCC_XviD:
case FOURCC_DX50:
case FOURCC_mp4v:
case FOURCC_4:
if( GetDWBE( p_byte ) != 0x000001b6 )
{
/* not true , need to find the first VOP header
......@@ -557,8 +587,7 @@ static int AVIInit( input_thread_t *p_input )
riffchunk_t *p_strl,*p_strh,*p_strf;
demux_data_avi_file_t *p_avi_demux;
es_descriptor_t *p_es = NULL; /* for not warning */
char *name;
int i, i_codec;
int i;
if( !( p_input->p_demux_data =
p_avi_demux = malloc( sizeof(demux_data_avi_file_t) ) ) )
......@@ -717,15 +746,8 @@ static int AVIInit( input_thread_t *p_input )
p_es->i_cat = AUDIO_ES;
AVI_Parse_WaveFormatEx( &p_info->audio_format,
p_strf->p_data->p_payload_start );
p_es->b_audio = 1;
p_es->i_type =
AVI_AudioGetType( p_info->audio_format.i_formattag );
if( !p_es->i_type )
{
msg_Warn( p_input, "stream(%d,0x%x) not supported", i,
p_info->audio_format.i_formattag );
p_es->i_cat = UNKNOWN_ES;
}
p_es->i_fourcc = AVI_AudioGetType(
p_info->audio_format.i_formattag );
break;
case( FOURCC_vids ):
......@@ -736,17 +758,7 @@ static int AVIInit( input_thread_t *p_input )
/* XXX quick hack for playing ffmpeg video, I don't know
who is doing something wrong */
p_info->header.i_samplesize = 0;
p_es->b_audio = 0;
if( !AVI_GetVideoCodec( p_info->video_format.i_compression,
&i_codec,
&name ) )
{
msg_Warn( p_input, "stream(%d,%4.4s) not supported", i,
(char*)&p_info->video_format.i_compression);
p_es->i_cat = UNKNOWN_ES;
}
p_es->i_type = i_codec;
p_es->i_fourcc = p_info->video_format.i_compression;
break;
default:
msg_Err( p_input, "unknown stream(%d) type", i );
......@@ -1319,7 +1331,7 @@ static int __AVI_GetChunk( input_thread_t *p_input,
AVIIndexEntry_t index;
index.i_id = p_ck->i_id;
index.i_flags = AVI_GetKeyFlag( p_info_i->p_es->i_type,
index.i_flags = AVI_GetKeyFlag( p_info_i->p_es->i_fourcc,
(u8*)&p_ck->i_8bytes);
index.i_pos = p_ck->i_pos;
index.i_length = p_ck->i_size;
......
......@@ -2,7 +2,7 @@
* avi.h : AVI file Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: avi.h,v 1.9 2002/07/15 19:33:02 fenrir Exp $
* $Id: avi.h,v 1.10 2002/07/23 00:39:16 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -40,6 +40,84 @@
the keyframe flag isn't a true flag
but have to be verified */
/* AVI stuff */
#define FOURCC_RIFF VLC_FOURCC('R','I','F','F')
#define FOURCC_LIST VLC_FOURCC('L','I','S','T')
#define FOURCC_JUNK VLC_FOURCC('J','U','N','K')
#define FOURCC_AVI VLC_FOURCC('A','V','I',' ')
#define FOURCC_WAVE VLC_FOURCC('W','A','V','E')
#define FOURCC_avih VLC_FOURCC('a','v','i','h')
#define FOURCC_hdrl VLC_FOURCC('h','d','r','l')
#define FOURCC_movi VLC_FOURCC('m','o','v','i')
#define FOURCC_idx1 VLC_FOURCC('i','d','x','1')
#define FOURCC_strl VLC_FOURCC('s','t','r','l')
#define FOURCC_strh VLC_FOURCC('s','t','r','h')
#define FOURCC_strf VLC_FOURCC('s','t','r','f')
#define FOURCC_strd VLC_FOURCC('s','t','r','d')
#define FOURCC_rec VLC_FOURCC('r','e','c',' ')
#define FOURCC_auds VLC_FOURCC('a','u','d','s')
#define FOURCC_vids VLC_FOURCC('v','i','d','s')
#define TWOCC_wb VLC_TWOCC('w','b')
#define TWOCC_db VLC_TWOCC('d','b')
#define TWOCC_dc VLC_TWOCC('d','c')
#define TWOCC_pc VLC_TWOCC('p','c')
/* MPEG4 video */
#define FOURCC_DIVX VLC_FOURCC('D','I','V','X')