* ALL: decoders now use a fourcc as a probe value.
authorSam Hocevar <sam@videolan.org>
Tue, 23 Jul 2002 00:39:17 +0000 (00:39 +0000)
committerSam Hocevar <sam@videolan.org>
Tue, 23 Jul 2002 00:39:17 +0000 (00:39 +0000)
  * 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.

73 files changed:
Makefile
configure.in
debian/libvlc0-dev.dirs
debian/rules
include/input_ext-dec.h
include/input_ext-intf.h
include/modules.h
include/video.h
include/vlc_common.h
include/vlc_symbols.h
plugins/a52/a52.c
plugins/a52_system/a52_system.c
plugins/aa/aa.c
plugins/ac3_adec/ac3_adec.c
plugins/ac3_spdif/ac3_spdif.c
plugins/avi/avi.c
plugins/avi/avi.h
plugins/avi/libioRIFF.c
plugins/beos/InterfaceWindow.cpp
plugins/beos/InterfaceWindow.h
plugins/beos/VideoWindow.h
plugins/beos/vout_beos.cpp
plugins/chroma/i420_rgb.c
plugins/chroma/i420_rgb16.c
plugins/chroma/i420_rgb8.c
plugins/chroma/i420_ymga.c
plugins/chroma/i420_yuy2.c
plugins/chroma/i422_yuy2.c
plugins/cinepak/.cvsignore [new file with mode: 0644]
plugins/cinepak/cinepak.c
plugins/directx/vout_directx.c
plugins/dummy/vout_dummy.c
plugins/dvd/dvd_es.c
plugins/dvdread/input_dvdread.c
plugins/fb/fb.c
plugins/ffmpeg/ffmpeg.c
plugins/ffmpeg/ffmpeg.h
plugins/filter/crop.c
plugins/filter/deinterlace.c
plugins/fx/scope.c
plugins/ggi/ggi.c
plugins/glide/glide.c
plugins/lpcm_adec/lpcm_adec.c
plugins/macosx/vout_macosx.m
plugins/mad/mad_adec.c
plugins/mga/mga.c
plugins/mga/xmga.c
plugins/mp4/libmp4.c
plugins/mp4/libmp4.h
plugins/mp4/mp4.c
plugins/mp4/mp4.h
plugins/mpeg_adec/mpeg_adec.c
plugins/mpeg_system/mpeg_audio.c
plugins/mpeg_system/mpeg_es.c
plugins/mpeg_system/mpeg_ps.c
plugins/mpeg_system/mpeg_ts.c
plugins/mpeg_vdec/video_parser.c
plugins/mpeg_vdec/vpar_headers.c
plugins/qnx/vout_qnx.c
plugins/sdl/vout_sdl.c
plugins/spudec/spu_decoder.c
plugins/x11/xcommon.c
src/input/input_dec.c
src/input/input_ext-intf.c
src/input/input_programs.c
src/input/mpeg_system.c
src/libvlc.h
src/misc/modules.c
src/misc/modules_plugin.h
src/video_output/video_output.c
src/video_output/vout_pictures.c
src/video_output/vout_pictures.h [new file with mode: 0644]
src/vlc.c

index c4593bd..e80a21a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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)
index 90b9692..48f8041 100644 (file)
@@ -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 
index 4a6f03c..12e3c2d 100644 (file)
@@ -1,4 +1,4 @@
 usr/bin
-usr/lib
+usr/lib/vlc
 usr/include/vlc
 usr/share/doc
index 6adb536..e6b5d0b 100755 (executable)
@@ -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
 
index 042be97..a75a224 100644 (file)
@@ -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
 /* 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;
 };
index 8e2712a..d2253f5 100644 (file)
@@ -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 ) );
index ff36725..de07bc6 100644 (file)
@@ -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;
 
index 142d75f..2601f8e 100644 (file)
@@ -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
  *****************************************************************************/
index 1484895..72dfa21 100644 (file)
@@ -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
  *****************************************************************************/
index 895ea20..94f9123 100644 (file)
@@ -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
index c437c9c..b08c430 100644 (file)
@@ -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;
 }
 
 /*****************************************************************************
index 4df18fa..a0b1822 100644 (file)
@@ -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;
index 079dad1..79bcf77 100644 (file)
@@ -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;
index 3653507..8f403fc 100644 (file)
@@ -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;
 }
 
 /*****************************************************************************
index be0e1f1..79791b5 100644 (file)
@@ -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: Stéphane 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;
 }
 
 
index fca2b87..ca91d6a 100644 (file)
@@ -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;
index 4eb4fc0..c3ce426 100644 (file)
@@ -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
                                            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')
+#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')
+
 /* Sound formats */
 #define WAVE_FORMAT_UNKNOWN         0x0000
 #define WAVE_FORMAT_PCM             0x0001
@@ -183,81 +261,3 @@ typedef struct demux_data_avi_file_s
 
 } demux_data_avi_file_t;
 
-/* current codec */
-static struct
-{
-    int i_fourcc;
-    int i_vlc_codec;
-    char *psz_name;
-
-} AVI_VideoCodecs [] = {
-    { FOURCC_DIV1,  MSMPEG4v1_VIDEO_ES, "MS MPEG-4 v1" },
-    { FOURCC_div1,  MSMPEG4v1_VIDEO_ES, "MS MPEG-4 v1" },
-    { FOURCC_MPG4,  MSMPEG4v1_VIDEO_ES, "MS MPEG-4 v1" },
-    { FOURCC_mpg4,  MSMPEG4v1_VIDEO_ES, "MS MPEG-4 v1" },
-
-    { FOURCC_DIV2,  MSMPEG4v2_VIDEO_ES, "MS MPEG-4 v2" },
-    { FOURCC_div2,  MSMPEG4v2_VIDEO_ES, "MS MPEG-4 v2" },
-    { FOURCC_MP42,  MSMPEG4v2_VIDEO_ES, "MS MPEG-4 v2" },
-    { FOURCC_mp42,  MSMPEG4v2_VIDEO_ES, "MS MPEG-4 v2" },
-    
-    { FOURCC_MPG3,  MSMPEG4v3_VIDEO_ES, "MS MPEG-4 v3" },
-    { FOURCC_mpg3,  MSMPEG4v3_VIDEO_ES, "MS MPEG-4 v3" },
-    { FOURCC_div3,  MSMPEG4v3_VIDEO_ES, "MS MPEG-4 v3" },
-    { FOURCC_MP43,  MSMPEG4v3_VIDEO_ES, "MS MPEG-4 v3" },
-    { FOURCC_mp43,  MSMPEG4v3_VIDEO_ES, "MS MPEG-4 v3" },
-    { FOURCC_DIV3,  MSMPEG4v3_VIDEO_ES, "MS MPEG-4 v3" },
-    { FOURCC_DIV4,  MSMPEG4v3_VIDEO_ES, "MS MPEG-4 v3" },
-    { FOURCC_div4,  MSMPEG4v3_VIDEO_ES, "MS MPEG-4 v3" },
-    { FOURCC_DIV5,  MSMPEG4v3_VIDEO_ES, "MS MPEG-4 v3" },
-    { FOURCC_div5,  MSMPEG4v3_VIDEO_ES, "MS MPEG-4 v3" },
-    { FOURCC_DIV6,  MSMPEG4v3_VIDEO_ES, "MS MPEG-4 v3" },
-    { FOURCC_div6,  MSMPEG4v3_VIDEO_ES, "MS MPEG-4 v3" },
-    { FOURCC_AP41,  MSMPEG4v3_VIDEO_ES, "MS MPEG-4 v3" },
-    { FOURCC_3IV1,  MSMPEG4v3_VIDEO_ES, "MS MPEG-4 v3" }, /* wrong */
-
-    { FOURCC_DIVX,  MPEG4_VIDEO_ES, "MPEG-4" },
-    { FOURCC_divx,  MPEG4_VIDEO_ES, "MPEG-4" },
-    { FOURCC_MP4S,  MPEG4_VIDEO_ES, "MPEG-4" },
-    { FOURCC_mp4s,  MPEG4_VIDEO_ES, "MPEG-4" },
-    { FOURCC_M4S2,  MPEG4_VIDEO_ES, "MPEG-4" },
-    { FOURCC_m4s2,  MPEG4_VIDEO_ES, "MPEG-4" },
-    { FOURCC_xvid,  MPEG4_VIDEO_ES, "MPEG-4" },
-    { FOURCC_XVID,  MPEG4_VIDEO_ES, "MPEG-4" },
-    { FOURCC_XviD,  MPEG4_VIDEO_ES, "MPEG-4" },
-    { FOURCC_DX50,  MPEG4_VIDEO_ES, "MPEG-4" },
-    { FOURCC_mp4v,  MPEG4_VIDEO_ES, "MPEG-4" },
-    { FOURCC_4,     MPEG4_VIDEO_ES, "MPEG-4" },
-    
-    { FOURCC_H263,  H263_VIDEO_ES, "H263" },
-    { FOURCC_h263,  H263_VIDEO_ES, "H263" },
-    { FOURCC_U263,  H263_VIDEO_ES, "H263" },
-
-    { FOURCC_I263,  I263_VIDEO_ES, "H263.I" },
-    { FOURCC_i263,  I263_VIDEO_ES, "H263.I" },
-
-    { 0,            UNKNOWN_ES,     "Unknown" }
-};
-
-static int AVI_GetVideoCodec( int i_fourcc,
-                              int *pi_vlc_codec,
-                              char **ppsz_name )
-{
-    int i_codec;
-
-    for( i_codec = 0; ; i_codec++ )
-    {
-        if( ( AVI_VideoCodecs[i_codec].i_fourcc == i_fourcc )||
-            ( AVI_VideoCodecs[i_codec].i_fourcc == 0 ) )
-        {
-            break;
-        }
-    }
-    if( pi_vlc_codec )
-        *pi_vlc_codec = AVI_VideoCodecs[i_codec].i_vlc_codec;
-    if( ppsz_name )
-        *ppsz_name = AVI_VideoCodecs[i_codec].psz_name;
-
-    return( AVI_VideoCodecs[i_codec].i_fourcc == 0 ? 0 : 1 );
-}                        
-
index 8a06d1b..3eefe2c 100644 (file)
@@ -2,7 +2,7 @@
  * libioRIFF.c : AVI file Stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: libioRIFF.c,v 1.12 2002/07/02 17:54:49 fenrir Exp $
+ * $Id: libioRIFF.c,v 1.13 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
@@ -355,7 +355,8 @@ int   RIFF_TestFileHeader( input_thread_t * p_input, riffchunk_t ** pp_riff, u32
     {
         return( -1 );
     }
-    if( ( (*pp_riff)->i_id != FOURCC_RIFF )||( (*pp_riff)->i_type != i_type ) )
+    if( (*pp_riff)->i_id != VLC_FOURCC('R','I','F','F')
+         || (*pp_riff)->i_type != i_type )
     {
         free( *pp_riff );
         return( -1 );
@@ -414,7 +415,8 @@ int   RIFF_FindListChunk( input_thread_t *p_input, riffchunk_t **pp_riff, riffch
         {
             free( *pp_riff );
         }
-        if( RIFF_FindChunk( p_input, FOURCC_LIST, p_rifffather) != 0 )
+        if( RIFF_FindChunk( p_input,
+                            VLC_FOURCC('L','I','S','T'), p_rifffather ) != 0 )
         {
             return( -1 );
         }
index 06e3fb8..f788920 100644 (file)
@@ -2,7 +2,7 @@
  * InterfaceWindow.cpp: beos interface
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: InterfaceWindow.cpp,v 1.19 2002/07/15 20:09:31 sam Exp $
+ * $Id: InterfaceWindow.cpp,v 1.20 2002/07/23 00:39:16 sam Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -411,31 +411,41 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
         break;
 
     case SELECT_CHANNEL:
+    case SELECT_SUBTITLE:
         {
-            int32 i = p_message->FindInt32( "channel" );
-            if ( i == -1 )
+            int32 i_new, i_old = -1;
+            if( p_message->what == SELECT_CHANNEL )
             {
-                input_ChangeES( p_input_bank->pp_input[0], NULL, AUDIO_ES );
+                i_new = p_message->FindInt32( "channel" );
+                i_cat = AUDIO_ES;
             }
             else
             {
-                input_ChangeES( p_input_bank->pp_input[0],
-                        p_input_bank->pp_input[0]->stream.pp_es[i], AUDIO_ES );
+                i_new = p_message->FindInt32( "subtitle" );
+                i_cat = AUDIO_ES;
             }
-        }
-        break;
 
-    case SELECT_SUBTITLE:
-        {
-            int32 i = p_message->FindInt32( "subtitle" );
-            if ( i == -1 )
+            vlc_mutex_lock( &p_input->stream.stream_lock );
+            for( int i = 0; i < p_input->stream.i_selected_es_number ; i++ )
+            {
+                if( p_input->stream.pp_selected_es[i]->i_cat == i_cat )
+                {
+                    i_old = i;
+                    break;
+                }
+            }
+            vlc_mutex_unlock( &p_input->stream.stream_lock );
+
+            if( i_new != -1 )
             {
-                input_ChangeES( p_input_bank->pp_input[0], NULL, SPU_ES);
+                input_ToggleES( p_input, p_input->stream.pp_selected_es[i_new],
+                                VLC_TRUE );
             }
-            else
+
+            if( i_old != -1 )
             {
-                input_ChangeES( p_input_bank->pp_input[0],
-                        p_input_bank->pp_input[0]->stream.pp_es[i], SPU_ES );
+                input_ToggleES( p_input, p_input->stream.pp_selected_es[i_old],
+                                VLC_FALSE );
             }
         }
         break;
index cc4b0b4..8e9b0db 100644 (file)
@@ -2,7 +2,7 @@
  * InterfaceWindow.h: BeOS interface window class prototype
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: InterfaceWindow.h,v 1.13 2002/06/01 09:20:16 tcastley Exp $
+ * $Id: InterfaceWindow.h,v 1.14 2002/07/23 00:39:16 sam Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Tony Castley <tcastley@mail.powerup.com.au>
@@ -68,8 +68,5 @@ private:
        BFilePanel *file_panel;
        PlayListWindow* playlist_window;
     BMenuItem      *miOnTop;
-       es_descriptor_t *  p_audio_es;
-    es_descriptor_t *  p_spu_es;
-
 };
 
index 59dda60..5051a8b 100644 (file)
@@ -2,7 +2,7 @@
  * VideoWindow.h: BeOS video window class prototype
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: VideoWindow.h,v 1.21 2002/06/01 12:31:58 sam Exp $
+ * $Id: VideoWindow.h,v 1.22 2002/07/23 00:39:16 sam Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Tony Castley <tcastley@mail.powerup.com.au>
@@ -37,11 +37,11 @@ typedef struct colorcombo
 
 colorcombo colspace[]=
 {
-       {B_YCbCr420, "B_YCbCr420", FOURCC_I420, 3, 2},
-       {B_YUV422,   "B_YUV422",   FOURCC_Y422, 3, 2},
-       {B_YCbCr422, "B_YCbCr422", FOURCC_YUY2, 3, 2},
-       {B_RGB32,    "B_RGB32",    FOURCC_RV32, 1, 4},
-       {B_RGB16,    "B_RGB16",    FOURCC_RV16, 1, 2}
+       {B_YCbCr420, "B_YCbCr420", VLC_FOURCC('I','4','2','0'), 3, 2},
+       {B_YUV422,   "B_YUV422",   VLC_FOURCC('Y','4','2','2'), 3, 2},
+       {B_YCbCr422, "B_YCbCr422", VLC_FOURCC('Y','U','Y','2'), 3, 2},
+       {B_RGB32,    "B_RGB32",    VLC_FOURCC('R','V','3','2'), 1, 4},
+       {B_RGB16,    "B_RGB16",    VLC_FOURCC('R','V','1','6'), 1, 2}
 };
 
 #define COLOR_COUNT 5
index 348225f..126a5aa 100644 (file)
@@ -2,7 +2,7 @@
  * vout_beos.cpp: beos video output display method
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: vout_beos.cpp,v 1.62 2002/07/22 11:39:56 tcastley Exp $
+ * $Id: vout_beos.cpp,v 1.63 2002/07/23 00:39:16 sam Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -565,22 +565,10 @@ int vout_Init( vout_thread_t *p_vout )
        p_pic->p->p_pixels = (u8*)p_vout->p_sys->p_window->bitmap[buffer_index]->Bits();
        p_pic->p->i_lines = p_vout->p_sys->i_height;
 
-       p_pic->p->i_pixel_bytes = colspace[p_vout->p_sys->p_window->colspace_index].pixel_bytes;
+       p_pic->p->i_pixel_pitch = colspace[p_vout->p_sys->p_window->colspace_index].pixel_bytes;
        p_pic->i_planes = colspace[p_vout->p_sys->p_window->colspace_index].planes;
        p_pic->p->i_pitch = p_vout->p_sys->p_window->bitmap[buffer_index]->BytesPerRow(); 
-
-       if (p_vout->p_sys->p_window->mode == OVERLAY)
-       {
-          p_pic->p->i_visible_bytes = (p_vout->p_sys->p_window->bitmap[buffer_index]->Bounds().IntegerWidth()+1) 
-                                     * p_pic->p->i_pixel_bytes; 
-          p_pic->p->b_margin = 1;
-          p_pic->p->b_hidden = 0;
-       }
-       else
-       {
-          p_pic->p->b_margin = 0;
-          p_pic->p->i_visible_bytes = p_pic->p->i_pitch;
-       }
+       p_pic->p->i_visible_pitch = p_pic->p->i_pixel_pitch * ( p_vout->p_sys->p_window->bitmap[buffer_index]->Bounds().IntegerWidth() + 1 );
 
        p_pic->i_status = DESTROYED_PICTURE;
        p_pic->i_type   = DIRECT_PICTURE;
index e79a989..573b861 100644 (file)
@@ -2,7 +2,7 @@
  * i420_rgb.c : YUV to bitmap RGB conversion module for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: i420_rgb.c,v 1.9 2002/06/01 12:31:58 sam Exp $
+ * $Id: i420_rgb.c,v 1.10 2002/07/23 00:39:16 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -105,26 +105,26 @@ static int chroma_Init( vout_thread_t *p_vout )
 
     switch( p_vout->render.i_chroma )
     {
-        case FOURCC_YV12:
-        case FOURCC_I420:
-        case FOURCC_IYUV:
+        case VLC_FOURCC('Y','V','1','2'):
+        case VLC_FOURCC('I','4','2','0'):
+        case VLC_FOURCC('I','Y','U','V'):
             switch( p_vout->output.i_chroma )
             {
 #if defined (MODULE_NAME_IS_chroma_i420_rgb)
-                case FOURCC_RGB2:
+                case VLC_FOURCC('R','G','B','2'):
                     p_vout->chroma.pf_convert = _M( I420_RGB8 );
                     break;
 #endif
-                case FOURCC_RV15:
+                case VLC_FOURCC('R','V','1','5'):
                     p_vout->chroma.pf_convert = _M( I420_RGB15 );
                     break;
 
-                case FOURCC_RV16:
+                case VLC_FOURCC('R','V','1','6'):
                     p_vout->chroma.pf_convert = _M( I420_RGB16 );
                     break;
 
-                case FOURCC_RV24:
-                case FOURCC_RV32:
+                case VLC_FOURCC('R','V','2','4'):
+                case VLC_FOURCC('R','V','3','2'):
                     p_vout->chroma.pf_convert = _M( I420_RGB32 );
                     break;
 
@@ -146,18 +146,18 @@ static int chroma_Init( vout_thread_t *p_vout )
     switch( p_vout->output.i_chroma )
     {
 #if defined (MODULE_NAME_IS_chroma_i420_rgb)
-        case FOURCC_RGB2:
+        case VLC_FOURCC('R','G','B','2'):
             p_vout->chroma.p_sys->p_buffer = malloc( VOUT_MAX_WIDTH );
             break;
 #endif
 
-        case FOURCC_RV15:
-        case FOURCC_RV16:
+        case VLC_FOURCC('R','V','1','5'):
+        case VLC_FOURCC('R','V','1','6'):
             p_vout->chroma.p_sys->p_buffer = malloc( VOUT_MAX_WIDTH * 2 );
             break;
 
-        case FOURCC_RV24:
-        case FOURCC_RV32:
+        case VLC_FOURCC('R','V','2','4'):
+        case VLC_FOURCC('R','V','3','2'):
             p_vout->chroma.p_sys->p_buffer = malloc( VOUT_MAX_WIDTH * 4 );
             break;
 
@@ -173,7 +173,8 @@ static int chroma_Init( vout_thread_t *p_vout )
     }
 
     p_vout->chroma.p_sys->p_offset = malloc( p_vout->output.i_width
-                    * ( ( p_vout->output.i_chroma == FOURCC_RGB2 ) ? 2 : 1 )
+                    * ( ( p_vout->output.i_chroma
+                           == VLC_FOURCC('R','G','B','2') ) ? 2 : 1 )
                     * sizeof( int ) );
     if( p_vout->chroma.p_sys->p_offset == NULL )
     {
@@ -185,11 +186,11 @@ static int chroma_Init( vout_thread_t *p_vout )
 #if defined (MODULE_NAME_IS_chroma_i420_rgb)
     switch( p_vout->output.i_chroma )
     {
-    case FOURCC_RGB2:
+    case VLC_FOURCC('R','G','B','2'):
         i_tables_size = sizeof( u8 ) * PALETTE_TABLE_SIZE;
         break;
-    case FOURCC_RV15:
-    case FOURCC_RV16:
+    case VLC_FOURCC('R','V','1','5'):
+    case VLC_FOURCC('R','V','1','6'):
         i_tables_size = sizeof( u16 ) * RGB_TABLE_SIZE;
         break;
     default: /* RV24, RV32 */
@@ -265,13 +266,13 @@ static void SetYUV( vout_thread_t *p_vout )
     /* Color: build red, green and blue tables */
     switch( p_vout->output.i_chroma )
     {
-    case FOURCC_RGB2:
+    case VLC_FOURCC('R','G','B','2'):
         p_vout->chroma.p_sys->p_rgb8 = (u8 *)p_vout->chroma.p_sys->p_base;
         Set8bppPalette( p_vout, p_vout->chroma.p_sys->p_rgb8 );
         break;
 
-    case FOURCC_RV15:
-    case FOURCC_RV16:
+    case VLC_FOURCC('R','V','1','5'):
+    case VLC_FOURCC('R','V','1','6'):
         p_vout->chroma.p_sys->p_rgb16 = (u16 *)p_vout->chroma.p_sys->p_base;
         for( i_index = 0; i_index < RED_MARGIN; i_index++ )
         {
@@ -296,8 +297,8 @@ static void SetYUV( vout_thread_t *p_vout )
         }
         break;
 
-    case FOURCC_RV24:
-    case FOURCC_RV32:
+    case VLC_FOURCC('R','V','2','4'):
+    case VLC_FOURCC('R','V','3','2'):
         p_vout->chroma.p_sys->p_rgb32 = (u32 *)p_vout->chroma.p_sys->p_base;
         for( i_index = 0; i_index < RED_MARGIN; i_index++ )
         {
index 038117e..b56087c 100644 (file)
@@ -2,7 +2,7 @@
  * i420_rgb16.c : YUV to bitmap RGB conversion module for vlc
  *****************************************************************************
  * Copyright (C) 2000 VideoLAN
- * $Id: i420_rgb16.c,v 1.8 2002/06/01 12:31:58 sam Exp $
+ * $Id: i420_rgb16.c,v 1.9 2002/07/23 00:39:16 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -82,14 +82,7 @@ void _M( I420_RGB15 )( vout_thread_t *p_vout, picture_t *p_src,
     int *       p_offset_start = p_vout->chroma.p_sys->p_offset;
     int *       p_offset;
 
-    if( p_dest->p->b_margin )
-    {
-        i_right_margin = (p_dest->p->i_pitch - p_dest->p->i_visible_bytes) / 2;
-    }
-    else
-    {
-        i_right_margin = 0;
-    }
+    i_right_margin = p_dest->p->i_pitch - p_dest->p->i_visible_pitch;
 
     if( p_vout->render.i_width & 7 )
     {
@@ -217,14 +210,7 @@ void _M( I420_RGB16 )( vout_thread_t *p_vout, picture_t *p_src,
     int *       p_offset_start = p_vout->chroma.p_sys->p_offset;
     int *       p_offset;
 
-    if( p_dest->p->b_margin )
-    {
-        i_right_margin = (p_dest->p->i_pitch - p_dest->p->i_visible_bytes) / 2;
-    }
-    else
-    {
-        i_right_margin = 0;
-    }
+    i_right_margin = p_dest->p->i_pitch - p_dest->p->i_visible_pitch;
 
     if( p_vout->render.i_width & 7 )
     {
@@ -352,14 +338,7 @@ void _M( I420_RGB32 )( vout_thread_t *p_vout, picture_t *p_src,
     int *       p_offset_start = p_vout->chroma.p_sys->p_offset;
     int *       p_offset;
 
-    if( p_dest->p->b_margin )
-    {
-        i_right_margin = (p_dest->p->i_pitch - p_dest->p->i_visible_bytes) / 2;
-    }
-    else
-    {
-        i_right_margin = 0;
-    }
+    i_right_margin = p_dest->p->i_pitch - p_dest->p->i_visible_pitch;
 
     if( p_vout->render.i_width & 7 )
     {
index edc9284..cb6ce37 100644 (file)
@@ -2,7 +2,7 @@
  * i420_rgb8.c : YUV to bitmap RGB conversion module for vlc
  *****************************************************************************
  * Copyright (C) 2000 VideoLAN
- * $Id: i420_rgb8.c,v 1.6 2002/06/01 12:31:58 sam Exp $
+ * $Id: i420_rgb8.c,v 1.7 2002/07/23 00:39:16 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -78,14 +78,7 @@ void _M( I420_RGB8 )( vout_thread_t *p_vout, picture_t *p_src,
                p_vout->output.i_width, p_vout->output.i_height,
                &b_hscale, &i_vscale, p_offset_start );
 
-    if( p_dest->p->b_margin )
-    {
-        i_right_margin = (p_dest->p->i_pitch - p_dest->p->i_visible_bytes);
-    }
-    else
-    {
-        i_right_margin = 0;
-    }
+    i_right_margin = p_dest->p->i_pitch - p_dest->p->i_visible_pitch;
 
     /*
      * Perform conversion
index 46e4e1e..69fd4f4 100644 (file)
@@ -2,7 +2,7 @@
  * i420_ymga.c : YUV to YUV conversion module for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: i420_ymga.c,v 1.6 2002/06/01 12:31:58 sam Exp $
+ * $Id: i420_ymga.c,v 1.7 2002/07/23 00:39:16 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -92,12 +92,12 @@ static int chroma_Init( vout_thread_t *p_vout )
 
     switch( p_vout->render.i_chroma )
     {
-        case FOURCC_YV12:
-        case FOURCC_I420:
-        case FOURCC_IYUV:
+        case VLC_FOURCC('Y','V','1','2'):
+        case VLC_FOURCC('I','4','2','0'):
+        case VLC_FOURCC('I','Y','U','V'):
             switch( p_vout->output.i_chroma )
             {
-                case FOURCC_YMGA:
+                case VLC_FOURCC('Y','M','G','A'):
                     p_vout->chroma.pf_convert = I420_YMGA;
                     break;
 
index ad0f379..6447750 100644 (file)
@@ -2,7 +2,7 @@
  * i420_yuy2.c : YUV to YUV conversion module for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: i420_yuy2.c,v 1.9 2002/06/01 16:45:34 sam Exp $
+ * $Id: i420_yuy2.c,v 1.10 2002/07/23 00:39:16 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -114,36 +114,36 @@ static int chroma_Init( vout_thread_t *p_vout )
 
     switch( p_vout->render.i_chroma )
     {
-        case FOURCC_YV12:
-        case FOURCC_I420:
-        case FOURCC_IYUV:
+        case VLC_FOURCC('Y','V','1','2'):
+        case VLC_FOURCC('I','4','2','0'):
+        case VLC_FOURCC('I','Y','U','V'):
             switch( p_vout->output.i_chroma )
             {
-                case FOURCC_YUY2:
-                case FOURCC_YUNV:
+                case VLC_FOURCC('Y','U','Y','2'):
+                case VLC_FOURCC('Y','U','N','V'):
                     p_vout->chroma.pf_convert = I420_YUY2;
                     break;
 
-                case FOURCC_YVYU:
+                case VLC_FOURCC('Y','V','Y','U'):
                     p_vout->chroma.pf_convert = I420_YVYU;
                     break;
 
-                case FOURCC_UYVY:
-                case FOURCC_UYNV:
-                case FOURCC_Y422:
+                case VLC_FOURCC('U','Y','V','Y'):
+                case VLC_FOURCC('U','Y','N','V'):
+                case VLC_FOURCC('Y','4','2','2'):
                     p_vout->chroma.pf_convert = I420_UYVY;
                     break;
 
-                case FOURCC_IUYV:
+                case VLC_FOURCC('I','U','Y','V'):
                     p_vout->chroma.pf_convert = I420_IUYV;
                     break;
 
-                case FOURCC_cyuv:
+                case VLC_FOURCC('c','y','u','v'):
                     p_vout->chroma.pf_convert = I420_cyuv;
                     break;
 
 #if defined (MODULE_NAME_IS_chroma_i420_yuy2)
-                case FOURCC_Y211:
+                case VLC_FOURCC('Y','2','1','1'):
                     p_vout->chroma.pf_convert = I420_Y211;
                     break;
 #endif
@@ -185,10 +185,10 @@ static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source,
 
     int i_x, i_y;
 
-    const int i_source_margin = p_source->p->b_margin ?
-        p_source->p->i_pitch - p_source->p->i_visible_bytes : 0;
-    const int i_dest_margin = p_dest->p->b_margin ?
-        p_dest->p->i_pitch - p_dest->p->i_visible_bytes : 0;
+    const int i_source_margin = p_source->p->i_pitch
+                                 - p_source->p->i_visible_pitch;
+    const int i_dest_margin = p_dest->p->i_pitch
+                               - p_dest->p->i_visible_pitch;
 
     for( i_y = p_vout->render.i_height / 2 ; i_y-- ; )
     {
@@ -230,10 +230,10 @@ static void I420_YVYU( vout_thread_t *p_vout, picture_t *p_source,
 
     int i_x, i_y;
 
-    const int i_source_margin = p_source->p->b_margin ?
-        p_source->p->i_pitch - p_source->p->i_visible_bytes : 0;
-    const int i_dest_margin = p_dest->p->b_margin ?
-        p_dest->p->i_pitch - p_dest->p->i_visible_bytes : 0;
+    const int i_source_margin = p_source->p->i_pitch
+                                 - p_source->p->i_visible_pitch;
+    const int i_dest_margin = p_dest->p->i_pitch
+                               - p_dest->p->i_visible_pitch;
 
     for( i_y = p_vout->render.i_height / 2 ; i_y-- ; )
     {
@@ -275,10 +275,10 @@ static void I420_UYVY( vout_thread_t *p_vout, picture_t *p_source,
 
     int i_x, i_y;
 
-    const int i_source_margin = p_source->p->b_margin ?
-        p_source->p->i_pitch - p_source->p->i_visible_bytes : 0;
-    const int i_dest_margin = p_dest->p->b_margin ?
-        p_dest->p->i_pitch - p_dest->p->i_visible_bytes : 0;
+    const int i_source_margin = p_source->p->i_pitch
+                                 - p_source->p->i_visible_pitch;
+    const int i_dest_margin = p_dest->p->i_pitch
+                               - p_dest->p->i_visible_pitch;
 
     for( i_y = p_vout->render.i_height / 2 ; i_y-- ; )
     {
@@ -332,10 +332,10 @@ static void I420_cyuv( vout_thread_t *p_vout, picture_t *p_source,
 
     int i_x, i_y;
 
-    const int i_source_margin = p_source->p->b_margin ?
-        p_source->p->i_pitch - p_source->p->i_visible_bytes : 0;
-    const int i_dest_margin = p_dest->p->b_margin ?
-        p_dest->p->i_pitch - p_dest->p->i_visible_bytes : 0;
+    const int i_source_margin = p_source->p->i_pitch
+                                 - p_source->p->i_visible_pitch;
+    const int i_dest_margin = p_dest->p->i_pitch
+                               - p_dest->p->i_visible_pitch;
 
     for( i_y = p_vout->render.i_height / 2 ; i_y-- ; )
     {
@@ -378,10 +378,10 @@ static void I420_Y211( vout_thread_t *p_vout, picture_t *p_source,
 
     int i_x, i_y;
 
-    const int i_source_margin = p_source->p->b_margin ?
-        p_source->p->i_pitch - p_source->p->i_visible_bytes : 0;
-    const int i_dest_margin = p_dest->p->b_margin ?
-        p_dest->p->i_pitch - p_dest->p->i_visible_bytes : 0;
+    const int i_source_margin = p_source->p->i_pitch
+                                 - p_source->p->i_visible_pitch;
+    const int i_dest_margin = p_dest->p->i_pitch
+                               - p_dest->p->i_visible_pitch;
 
     for( i_y = p_vout->render.i_height / 2 ; i_y-- ; )
     {
index 58aa343..4e69291 100644 (file)
@@ -2,7 +2,7 @@
  * i422_yuy2.c : YUV to YUV conversion module for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: i422_yuy2.c,v 1.6 2002/06/01 12:31:58 sam Exp $
+ * $Id: i422_yuy2.c,v 1.7 2002/07/23 00:39:16 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -105,34 +105,34 @@ static int chroma_Init( vout_thread_t *p_vout )
 
     switch( p_vout->render.i_chroma )
     {
-        case FOURCC_I422:
+        case VLC_FOURCC('I','4','2','2'):
             switch( p_vout->output.i_chroma )
             {
-                case FOURCC_YUY2:
-                case FOURCC_YUNV:
+                case VLC_FOURCC('Y','U','Y','2'):
+                case VLC_FOURCC('Y','U','N','V'):
                     p_vout->chroma.pf_convert = I422_YUY2;
                     break;
 
-                case FOURCC_YVYU:
+                case VLC_FOURCC('Y','V','Y','U'):
                     p_vout->chroma.pf_convert = I422_YVYU;
                     break;
 
-                case FOURCC_UYVY:
-                case FOURCC_UYNV:
-                case FOURCC_Y422:
+                case VLC_FOURCC('U','Y','V','Y'):
+                case VLC_FOURCC('U','Y','N','V'):
+                case VLC_FOURCC('Y','4','2','2'):
                     p_vout->chroma.pf_convert = I422_UYVY;
                     break;
 
-                case FOURCC_IUYV:
+                case VLC_FOURCC('I','U','Y','V'):
                     p_vout->chroma.pf_convert = I422_IUYV;
                     break;
 
-                case FOURCC_cyuv:
+                case VLC_FOURCC('c','y','u','v'):
                     p_vout->chroma.pf_convert = I422_cyuv;
                     break;
 
 #if defined (MODULE_NAME_IS_chroma_i422_yuy2)
-                case FOURCC_Y211:
+                case VLC_FOURCC('Y','2','1','1'):
                     p_vout->chroma.pf_convert = I422_Y211;
                     break;
 #endif
diff --git a/plugins/cinepak/.cvsignore b/plugins/cinepak/.cvsignore
new file mode 100644 (file)
index 0000000..56f1e1d
--- /dev/null
@@ -0,0 +1,5 @@
+*.bak
+.dep
+*.lo
+*.o.*
+*.lo.*
index 86ef914..064ae28 100644 (file)
@@ -2,7 +2,7 @@
  * cinepak.c: cinepak video decoder 
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: cinepak.c,v 1.2 2002/07/21 18:47:22 fenrir Exp $
+ * $Id: cinepak.c,v 1.3 2002/07/23 00:39:16 sam Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -48,7 +48,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      ( videodec_thread_t * );
 static void     EndThread       ( videodec_thread_t * );
@@ -90,9 +90,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 == CINEPAK_VIDEO_ES ) ? 0 : -1 );
+    return( ( *pi_type == VLC_FOURCC('c','v','i','d') ) ? 0 : -1 );
 }
 
 /*****************************************************************************
@@ -273,7 +273,7 @@ static int cinepak_CheckVout( vout_thread_t *p_vout,
     
     if( ( p_vout->render.i_width != i_width )||
         ( p_vout->render.i_height != i_height )||
-        ( p_vout->render.i_chroma != FOURCC_I420 )||
+        ( p_vout->render.i_chroma != VLC_FOURCC('I','4','2','0') )||
         ( p_vout->render.i_aspect != VOUT_ASPECT_FACTOR * i_width / i_height) )
     {
         return( 0 );
@@ -333,7 +333,7 @@ static vout_thread_t *cinepak_CreateVout( videodec_thread_t *p_vdec,
         p_vout = vout_CreateThread( p_vdec->p_fifo,
                                     i_width,
                                     i_height,
-                                    FOURCC_I420,
+                                    VLC_FOURCC('I','4','2','0'),
                                     VOUT_ASPECT_FACTOR * i_width / i_height );
     }
 
index e68bf3a..b1a060d 100644 (file)
@@ -2,7 +2,7 @@
  * vout_directx.c: Windows DirectX video output display method
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: vout_directx.c,v 1.39 2002/06/02 09:03:54 sam Exp $
+ * $Id: vout_directx.c,v 1.40 2002/07/23 00:39:16 sam Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -734,9 +734,12 @@ static int DirectXCreateSurface( vout_thread_t *p_vout,
 
     if( !b_overlay )
     {
-        vlc_bool_t b_rgb_surface = ( i_chroma == FOURCC_RGB2 ) ||
-            ( i_chroma == FOURCC_RV15 ) || ( i_chroma == FOURCC_RV16 ) ||
-            ( i_chroma == FOURCC_RV24 ) || ( i_chroma == FOURCC_RV32 );
+        vlc_bool_t b_rgb_surface =
+            ( i_chroma == VLC_FOURCC('R','G','B','2') )
+          || ( i_chroma == VLC_FOURCC('R','V','1','5') )
+           || ( i_chroma == VLC_FOURCC('R','V','1','6') )
+            || ( i_chroma == VLC_FOURCC('R','V','2','4') )
+             || ( i_chroma == VLC_FOURCC('R','V','3','2') );
 
         memset( &ddsd, 0, sizeof( DDSURFACEDESC ) );
         ddsd.dwSize = sizeof(DDSURFACEDESC);
@@ -909,20 +912,20 @@ static int NewPictureVec( vout_thread_t *p_vout, picture_t *p_pic,
     /* Choose the chroma we will try first. */
     switch( p_vout->render.i_chroma )
     {
-        case FOURCC_YUY2:
-        case FOURCC_YUNV:
-            p_vout->output.i_chroma = FOURCC_YUY2;
+        case VLC_FOURCC('Y','U','Y','2'):
+        case VLC_FOURCC('Y','U','N','V'):
+            p_vout->output.i_chroma = VLC_FOURCC('Y','U','Y','2');
             break;
-        case FOURCC_UYVY:
-        case FOURCC_UYNV:
-        case FOURCC_Y422:
-            p_vout->output.i_chroma = FOURCC_UYVY;
+        case VLC_FOURCC('U','Y','V','Y'):
+        case VLC_FOURCC('U','Y','N','V'):
+        case VLC_FOURCC('Y','4','2','2'):
+            p_vout->output.i_chroma = VLC_FOURCC('U','Y','V','Y');
             break;
-        case FOURCC_YVYU:
-            p_vout->output.i_chroma = FOURCC_YVYU;
+        case VLC_FOURCC('Y','V','Y','U'):
+            p_vout->output.i_chroma = VLC_FOURCC('Y','V','Y','U');
             break;
         default:
-            p_vout->output.i_chroma = FOURCC_YV12;
+            p_vout->output.i_chroma = VLC_FOURCC('Y','V','1','2');
             break;
     }
 
@@ -993,7 +996,7 @@ static int NewPictureVec( vout_thread_t *p_vout, picture_t *p_pic,
                 for( j = 0; j < front_pic.i_planes; j++ )
                     memset( front_pic.p[j].p_pixels, 127,
                             front_pic.p[j].i_lines * front_pic.p[j].i_pitch
-                            * front_pic.p[j].i_pixel_bytes );
+                            * front_pic.p[j].i_pixel_pitch );
             }
 
             DirectXUpdateOverlay( p_vout );
@@ -1036,15 +1039,20 @@ static int NewPictureVec( vout_thread_t *p_vout, picture_t *p_pic,
                 switch( ddpfPixelFormat.dwRGBBitCount )
                 {
                 case 8: /* FIXME: set the palette */
-                    p_vout->output.i_chroma = FOURCC_RGB2; break;
+                    p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2');
+                    break;
                 case 15:
-                    p_vout->output.i_chroma = FOURCC_RV15; break;
+                    p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5');
+                    break;
                 case 16:
-                    p_vout->output.i_chroma = FOURCC_RV16; break;
+                    p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6');
+                    break;
                 case 24:
-                    p_vout->output.i_chroma = FOURCC_RV24; break;
+                    p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4');
+                    break;
                 case 32:
-                    p_vout->output.i_chroma = FOURCC_RV32; break;
+                    p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2');
+                    break;
                 default:
                     msg_Err( p_vout, "unknown screen depth" );
                     return( 0 );
@@ -1147,81 +1155,80 @@ static int UpdatePictureStruct( vout_thread_t *p_vout, picture_t *p_pic,
 
     switch( p_vout->output.i_chroma )
     {
-
-        case FOURCC_RGB2:
-        case FOURCC_RV15:
-        case FOURCC_RV16:
-        case FOURCC_RV24:
-        case FOURCC_RV32:
+        case VLC_FOURCC('R','G','B','2'):
+        case VLC_FOURCC('R','V','1','5'):
+        case VLC_FOURCC('R','V','1','6'):
+        case VLC_FOURCC('R','V','2','4'):
+        case VLC_FOURCC('R','V','3','2'):
             p_pic->p->p_pixels = p_pic->p_sys->ddsd.lpSurface;
             p_pic->p->i_lines = p_vout->output.i_height;
             p_pic->p->i_pitch = p_pic->p_sys->ddsd.lPitch;
-            p_pic->p->b_margin = 0;
-            p_pic->i_planes = 1;
             switch( p_vout->output.i_chroma )
             {
-                case FOURCC_RGB2:
-                    p_pic->p->i_pixel_bytes = 1;
+                case VLC_FOURCC('R','G','B','2'):
+                    p_pic->p->i_pixel_pitch = 1;
                     break;
-                case FOURCC_RV15:
-                case FOURCC_RV16:
-                    p_pic->p->i_pixel_bytes = 2;
+                case VLC_FOURCC('R','V','1','5'):
+                case VLC_FOURCC('R','V','1','6'):
+                    p_pic->p->i_pixel_pitch = 2;
                     break;
-                case FOURCC_RV24:
-                case FOURCC_RV32:
-                    p_pic->p->i_pixel_bytes = 4;
+                case VLC_FOURCC('R','V','2','4'):
+                case VLC_FOURCC('R','V','3','2'):
+                    p_pic->p->i_pixel_pitch = 4;
                     break;
                 default:
                     return( -1 );
             }
+            p_pic->p->i_visible_pitch = p_pic->p_sys->ddsd.lPitch;
+            p_pic->i_planes = 1;
             break;
 
-        case FOURCC_YV12:
+        case VLC_FOURCC('Y','V','1','2'):
 
             p_pic->Y_PIXELS = p_pic->p_sys->ddsd.lpSurface;
             p_pic->p[Y_PLANE].i_lines = p_vout->output.i_height;
             p_pic->p[Y_PLANE].i_pitch = p_pic->p_sys->ddsd.lPitch;
-            p_pic->p[Y_PLANE].i_pixel_bytes = 1;
-            p_pic->p[Y_PLANE].b_margin = 0;
+            p_pic->p[Y_PLANE].i_pixel_pitch = 1;
+            p_pic->p[Y_PLANE].i_visible_pitch = p_pic->p[Y_PLANE].i_pitch;
 
             p_pic->V_PIXELS =  p_pic->Y_PIXELS
               + p_pic->p[Y_PLANE].i_lines * p_pic->p[Y_PLANE].i_pitch;
             p_pic->p[V_PLANE].i_lines = p_vout->output.i_height / 2;
             p_pic->p[V_PLANE].i_pitch = p_pic->p[Y_PLANE].i_pitch / 2;
-            p_pic->p[V_PLANE].i_pixel_bytes = 1;
-            p_pic->p[V_PLANE].b_margin = 0;
+            p_pic->p[V_PLANE].i_pixel_pitch = 1;
+            p_pic->p[V_PLANE].i_visible_pitch = p_pic->p[V_PLANE].i_pitch;
 
             p_pic->U_PIXELS = p_pic->V_PIXELS
               + p_pic->p[V_PLANE].i_lines * p_pic->p[V_PLANE].i_pitch;
             p_pic->p[U_PLANE].i_lines = p_vout->output.i_height / 2;
             p_pic->p[U_PLANE].i_pitch = p_pic->p[Y_PLANE].i_pitch / 2;
-            p_pic->p[U_PLANE].i_pixel_bytes = 1;
-            p_pic->p[U_PLANE].b_margin = 0;
+            p_pic->p[U_PLANE].i_pixel_pitch = 1;
+            p_pic->p[U_PLANE].i_visible_pitch = p_pic->p[U_PLANE].i_pitch;
 
             p_pic->i_planes = 3;
             break;
 
-        case FOURCC_IYUV:
+        case VLC_FOURCC('I','Y','U','V'):
 
             p_pic->Y_PIXELS = p_pic->p_sys->ddsd.lpSurface;
             p_pic->p[Y_PLANE].i_lines = p_vout->output.i_height;
             p_pic->p[Y_PLANE].i_pitch = p_pic->p_sys->ddsd.lPitch;
-            p_pic->p[Y_PLANE].i_pixel_bytes = 1;
-            p_pic->p[Y_PLANE].b_margin = 0;
+            p_pic->p[Y_PLANE].i_pixel_pitch = 1;
+            p_pic->p[Y_PLANE].i_visible_pitch = p_pic->p[Y_PLANE].i_pitch;
 
             p_pic->U_PIXELS = p_pic->Y_PIXELS
               + p_pic->p[Y_PLANE].i_lines * p_pic->p[Y_PLANE].i_pitch;
             p_pic->p[U_PLANE].i_lines = p_vout->output.i_height / 2;
             p_pic->p[U_PLANE].i_pitch = p_pic->p[Y_PLANE].i_pitch / 2;
-            p_pic->p[U_PLANE].i_pixel_bytes = 1;
-            p_pic->p[U_PLANE].b_margin = 0;
+            p_pic->p[U_PLANE].i_pixel_pitch = 1;
+            p_pic->p[U_PLANE].i_visible_pitch = p_pic->p[U_PLANE].i_pitch;
 
             p_pic->V_PIXELS =  p_pic->U_PIXELS
               + p_pic->p[U_PLANE].i_lines * p_pic->p[U_PLANE].i_pitch;
             p_pic->p[V_PLANE].i_lines = p_vout->output.i_height / 2;
             p_pic->p[V_PLANE].i_pitch = p_pic->p[Y_PLANE].i_pitch / 2;
-            p_pic->p[V_PLANE].i_pixel_bytes = 1;
-            p_pic->p[V_PLANE].b_margin = 0;
+            p_pic->p[V_PLANE].i_pixel_pitch = 1;
+            p_pic->p[V_PLANE].i_visible_pitch = p_pic->p[V_PLANE].i_pitch;
 
             p_pic->i_planes = 3;
             break;
index 8e38f13..d2b1194 100644 (file)
@@ -2,7 +2,7 @@
  * vout_dummy.c: Dummy video output display method for testing purposes
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: vout_dummy.c,v 1.25 2002/07/20 18:01:42 sam Exp $
+ * $Id: vout_dummy.c,v 1.26 2002/07/23 00:39:16 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -133,7 +133,7 @@ static int vout_Init( vout_thread_t *p_vout )
     }
     else
     {
-        p_vout->output.i_chroma = FOURCC_RV16;
+        p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6');
         p_vout->output.i_rmask  = 0xf800;
         p_vout->output.i_gmask  = 0x07e0;
         p_vout->output.i_bmask  = 0x001f;
index c64dee0..b5e29d2 100644 (file)
@@ -1,7 +1,7 @@
 /* dvd_es.c: functions to find and select ES
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: dvd_es.c,v 1.14 2002/06/27 19:46:32 sam Exp $
+ * $Id: dvd_es.c,v 1.15 2002/07/23 00:39:16 sam Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -64,11 +64,11 @@ 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, type, cat, lang, size )           \
+#define ADDES( stream_id, private_id, fourcc, cat, lang, 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_type = (type);                                              \
+    p_es->i_fourcc = (fourcc);                                          \
     p_es->i_cat = (cat);                                                \
     if( lang )                                                          \
     {                                                                   \
@@ -94,12 +94,12 @@ void DVDReadVideo( input_thread_t * p_input )
     
     if( i_ratio )
     {
-        ADDES( 0xe0, 0, MPEG2_VIDEO_ES, 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, MPEG2_VIDEO_ES, VIDEO_ES, 0, 0 );
+        ADDES( 0xe0, 0, VLC_FOURCC('m','p','g','v'), VIDEO_ES, 0, 0 );
     }
         
 }
@@ -137,23 +137,20 @@ void DVDReadAudio( input_thread_t * p_input )
             {
             case 0x00:              /* AC3 */
                 ADDES( 0xbd, 0x80 + audio_status.i_position,
-                       AC3_AUDIO_ES, AUDIO_ES, i_lang, 0 );
-                p_es->b_audio = 1;
+                       VLC_FOURCC('a','5','2',' '), AUDIO_ES, i_lang, 0 );
                 strcat( p_es->psz_desc, " (ac3)" );
 
                 break;
             case 0x02:
             case 0x03:              /* MPEG audio */
                 ADDES( 0xc0 + audio_status.i_position, 0,
-                       MPEG2_AUDIO_ES, AUDIO_ES, i_lang, 0 );
-                p_es->b_audio = 1;
+                       VLC_FOURCC('m','p','g','a'), AUDIO_ES, i_lang, 0 );
                 strcat( p_es->psz_desc, " (mpeg)" );
 
                 break;
             case 0x04:              /* LPCM */
                 ADDES( 0xbd, 0xa0 + audio_status.i_position,
-                       LPCM_AUDIO_ES, AUDIO_ES, i_lang, 0 );
-                p_es->b_audio = 1;
+                       VLC_FOURCC('l','p','c','m'), AUDIO_ES, i_lang, 0 );
                 strcat( p_es->psz_desc, " (lpcm)" );
 
                 break;
@@ -222,7 +219,7 @@ void DVDReadSPU( input_thread_t * p_input )
 
             if( vmg.title.pi_yuv_color )
             {
-                ADDES( 0xbd, 0x20 + i_id, DVD_SPU_ES, SPU_ES,
+                ADDES( 0xbd, 0x20 + i_id, VLC_FOURCC('s','p','u',' '), SPU_ES,
                        vts.manager_inf.p_spu_attr[i-1].i_lang_code,
                        sizeof(int) + 16*sizeof(u32) );
                 *(int*)p_es->p_demux_data = 0xBeeF;
@@ -231,7 +228,7 @@ void DVDReadSPU( input_thread_t * p_input )
             }
             else
             {
-                ADDES( 0xbd, 0x20 + i_id, DVD_SPU_ES, SPU_ES,
+                ADDES( 0xbd, 0x20 + i_id, VLC_FOURCC('s','p','u',' '), SPU_ES,
                    vts.manager_inf.p_spu_attr[i-1].i_lang_code, 0 );
             }
         }
@@ -275,13 +272,14 @@ void DVDLaunchDecoders( input_thread_t * p_input )
                == REQUESTED_AC3 ) )
         {
             int     i_ac3 = i_audio;
-            while( ( p_input->stream.pp_es[i_ac3]->i_type !=
-                     AC3_AUDIO_ES ) && ( i_ac3 <=
+            while( ( p_input->stream.pp_es[i_ac3]->i_fourcc !=
+                     VLC_FOURCC('a','5','2',' ') ) && ( i_ac3 <=
                      p_dvd->p_ifo->vts.manager_inf.i_audio_nb ) )
             {
                 i_ac3++;
             }
-            if( p_input->stream.pp_es[i_ac3]->i_type == AC3_AUDIO_ES )
+            if( p_input->stream.pp_es[i_ac3]->i_fourcc
+                 == VLC_FOURCC('a','5','2',' ') )
             {
                 input_SelectES( p_input,
                                 p_input->stream.pp_es[i_ac3] );
@@ -309,7 +307,8 @@ void DVDLaunchDecoders( input_thread_t * p_input )
             int i = 0, j = 0;
             for( i = 0; i < p_input->stream.i_es_number; i++ )
             {
-                if ( p_input->stream.pp_es[i]->i_type == DVD_SPU_ES )
+                if ( p_input->stream.pp_es[i]->i_fourcc
+                      == VLC_FOURCC('s','p','u',' ') )
                 {
                     j++;
                     if ( i_spu == j ) break;
index 74aa6d5..b068e41 100644 (file)
@@ -6,7 +6,7 @@
  * It depends on: libdvdread for ifo files and block reading.
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: input_dvdread.c,v 1.40 2002/06/02 13:49:35 sam Exp $
+ * $Id: input_dvdread.c,v 1.41 2002/07/23 00:39:17 sam Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -649,7 +649,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
 
         p_es = input_AddES( p_input, NULL, 0xe0, 0 );
         p_es->i_stream_id = 0xe0;
-        p_es->i_type = MPEG2_VIDEO_ES;
+        p_es->i_fourcc = VLC_FOURCC('m','p','g','v');
         p_es->i_cat = VIDEO_ES;
 
 #define audio_control \
@@ -675,8 +675,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
                     i_id = ( ( 0x80 + i_position ) << 8 ) | 0xbd;
                     p_es = input_AddES( p_input, NULL, i_id, 0 );
                     p_es->i_stream_id = 0xbd;
-                    p_es->i_type = AC3_AUDIO_ES;
-                    p_es->b_audio = 1;
+                    p_es->i_fourcc = VLC_FOURCC('a','5','2',' ');
                     p_es->i_cat = AUDIO_ES;
                     strcpy( p_es->psz_desc, DecodeLanguage(
                         p_vts->vtsi_mat->vts_audio_attr[i-1].lang_code ) ); 
@@ -688,8 +687,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
                     i_id = 0xc0 + i_position;
                     p_es = input_AddES( p_input, NULL, i_id, 0 );
                     p_es->i_stream_id = i_id;
-                    p_es->i_type = MPEG2_AUDIO_ES;
-                    p_es->b_audio = 1;
+                    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 ) ); 
@@ -701,8 +699,7 @@ static int DvdReadSetArea( input_thread_t * p_input, input_area_t * p_area )
                     i_id = ( ( 0xa0 + i_position ) << 8 ) | 0xbd;
                     p_es = input_AddES( p_input, NULL, i_id, 0 );
                     p_es->i_stream_id = i_id;
-                    p_es->i_type = LPCM_AUDIO_ES;
-                    p_es->b_audio = 1;
+                    p_es->i_fourcc = VLC_FOURCC('l','p','c','m');
                     p_es->i_cat = AUDIO_ES;
                     strcpy( p_es->psz_desc, DecodeLanguage(
                         p_vts->vtsi_mat->vts_audio_attr[i-1].lang_code ) ); 
@@ -765,7 +762,7 @@ 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->i_stream_id = 0xbd;
-                p_es->i_type = DVD_SPU_ES;
+                p_es->i_fourcc = VLC_FOURCC('s','p','u',' ');
                 p_es->i_cat = SPU_ES;
                 strcpy( p_es->psz_desc, DecodeLanguage(
                     p_vts->vtsi_mat->vts_subp_attr[i-1].lang_code ) ); 
@@ -1224,13 +1221,14 @@ static void DvdReadLauchDecoders( input_thread_t * p_input )
                  == REQUESTED_AC3 )
             {
                 int     i_ac3 = i_audio;
-                while( ( p_input->stream.pp_es[i_ac3]->i_type !=
-                       AC3_AUDIO_ES ) && ( i_ac3 <=
+                while( ( p_input->stream.pp_es[i_ac3]->i_fourcc !=
+                       VLC_FOURCC('a','5','2',' ') ) && ( i_ac3 <=
                        p_dvd->p_vts_file->vtsi_mat->nr_of_vts_audio_streams ) )
                 {
                     i_ac3++;
                 }
-                if( p_input->stream.pp_es[i_ac3]->i_type == AC3_AUDIO_ES )
+                if( p_input->stream.pp_es[i_ac3]->i_fourcc
+                     == VLC_FOURCC('a','5','2',' ') )
                 {
                     input_SelectES( p_input,
                                     p_input->stream.pp_es[i_ac3] );
index 59573ac..fb12103 100644 (file)
@@ -2,7 +2,7 @@
  * fb.c : framebuffer plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: fb.c,v 1.20 2002/07/20 18:01:42 sam Exp $
+ * $Id: fb.c,v 1.21 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *      
@@ -254,15 +254,15 @@ static int vout_Init( vout_thread_t *p_vout )
     switch( p_vout->p_sys->var_info.bits_per_pixel )
     {
         case 8: /* FIXME: set the palette */
-            p_vout->output.i_chroma = FOURCC_RGB2; break;
+            p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2'); break;
         case 15:
-            p_vout->output.i_chroma = FOURCC_RV15; break;
+            p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5'); break;
         case 16:
-            p_vout->output.i_chroma = FOURCC_RV16; break;
+            p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); break;
         case 24:
-            p_vout->output.i_chroma = FOURCC_RV24; break;
+            p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); break;
         case 32:
-            p_vout->output.i_chroma = FOURCC_RV32; break;
+            p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); break;
         default:
             msg_Err( p_vout, "unknown screen depth %i",
                      p_vout->p_sys->var_info.bits_per_pixel );
@@ -309,25 +309,23 @@ static int vout_Init( vout_thread_t *p_vout )
     /* We know the chroma, allocate a buffer which will be used
      * directly by the decoder */
     p_pic->p->p_pixels = p_vout->p_sys->p_video;
-    p_pic->p->i_pixel_bytes = p_vout->p_sys->i_bytes_per_pixel;
+    p_pic->p->i_pixel_pitch = p_vout->p_sys->i_bytes_per_pixel;
     p_pic->p->i_lines = p_vout->p_sys->var_info.yres;
 
     if( p_vout->p_sys->var_info.xres_virtual )
     {
-        p_pic->p->b_margin = 1;
-        p_pic->p->b_hidden = 1;
         p_pic->p->i_pitch = p_vout->p_sys->var_info.xres_virtual
                              * p_vout->p_sys->i_bytes_per_pixel;
-        p_pic->p->i_visible_bytes = p_vout->p_sys->var_info.xres
-                                     * p_vout->p_sys->i_bytes_per_pixel;
     }
     else
     {
-        p_pic->p->b_margin = 0;
         p_pic->p->i_pitch = p_vout->p_sys->var_info.xres
                              * p_vout->p_sys->i_bytes_per_pixel;
     }
 
+    p_pic->p->i_visible_pitch = p_vout->p_sys->var_info.xres
+                                 * p_vout->p_sys->i_bytes_per_pixel;
+
     p_pic->i_planes = 1;
 
     p_pic->i_status = DESTROYED_PICTURE;
@@ -337,7 +335,7 @@ static int vout_Init( vout_thread_t *p_vout )
 
     I_OUTPUTPICTURES++;
 
-    return( 0 );
+    return 0;
 }
 
 /*****************************************************************************
index 5fbb88b..1ea72b0 100644 (file)
@@ -2,7 +2,7 @@
  * ffmpeg.c: video decoder using ffmpeg library
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: ffmpeg.c,v 1.18 2002/07/21 15:07:39 fenrir Exp $
+ * $Id: ffmpeg.c,v 1.19 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -49,7 +49,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      ( videodec_thread_t * );
 static void     EndThread       ( videodec_thread_t * );
@@ -113,7 +113,7 @@ 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( ffmpeg_GetFfmpegCodec( *pi_type, NULL, NULL ) ? 0 : -1 );
 }
@@ -290,9 +290,9 @@ static int i_ffmpeg_PixFmtToChroma[] =
    PIX_FMT_RGB24, PIX_FMT_BGR24, PIX_FMT_YUV422P, 
    PIX_FMT_YUV444P, PIX_FMT_YUV410P */
 
-    0, FOURCC_I420, FOURCC_I420
-    FOURCC_RV24, 0, FOURCC_Y422
-    FOURCC_I444, 0 
+    0, VLC_FOURCC('I','4','2','0'), VLC_FOURCC('I','4','2','0')
+    VLC_FOURCC('R','V','2','4'), 0, VLC_FOURCC('Y','4','2','2')
+    VLC_FOURCC('I','4','4','4'), 0 
 };
 
 static inline u32 ffmpeg_PixFmtToChroma( int i_ffmpegchroma )
@@ -335,7 +335,8 @@ static int ffmpeg_CheckVout( vout_thread_t *p_vout,
     }
     if( !i_chroma )
     {
-        i_chroma = FOURCC_I420; /* we will try to make conversion */
+        /* we will try to make conversion */
+        i_chroma = VLC_FOURCC('I','4','2','0');
     } 
     
     if( ( p_vout->render.i_width != i_width )||
@@ -369,7 +370,8 @@ static vout_thread_t *ffmpeg_CreateVout( videodec_thread_t *p_vdec,
 
     if( !i_chroma )
     {
-        i_chroma = FOURCC_I420; /* we make conversion if possible*/
+        /* we make conversion if possible*/
+        i_chroma = VLC_FOURCC('I','4','2','0');
         msg_Warn( p_vdec->p_fifo, "Internal chroma conversion (FIXME)");
         /* It's mainly for I410 -> I420 conversion that I've made,
            it's buggy and very slow */
@@ -697,7 +699,7 @@ static int InitThread( videodec_thread_t *p_vdec )
     {
         msg_Dbg( p_vdec->p_fifo, "library ffmpeg already initialized" );
     }
-    ffmpeg_GetFfmpegCodec( p_vdec->p_fifo->i_type,
+    ffmpeg_GetFfmpegCodec( p_vdec->p_fifo->i_fourcc,
                            &i_ffmpeg_codec,
                            &p_vdec->psz_namecodec );
     p_vdec->p_codec = 
index 24dbab1..79eb22f 100644 (file)
@@ -2,7 +2,7 @@
  * ffmpeg_vdec.h: video decoder using ffmpeg library
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: ffmpeg.h,v 1.6 2002/07/21 15:07:39 fenrir Exp $
+ * $Id: ffmpeg.h,v 1.7 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  * 
@@ -37,55 +37,156 @@ typedef struct bitmapinfoheader_s
     u32 i_clrimportant;
 } bitmapinfoheader_t;
 
-static struct 
+/* MPEG4 video */
+#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')
+
+/* Sorenson v1 */
+#define FOURCC_SVQ1 VLC_FOURCC( 'S', 'V', 'Q', '1' )
+
+static int ffmpeg_GetFfmpegCodec( vlc_fourcc_t i_fourcc,
+                                  int *pi_ffmpeg_codec,
+                                  char **ppsz_name )
 {
-    int i_vlc_codec;
-    int i_ffmpeg_codec;
-    char *psz_name;
-} ffmpeg_Codecs [] = {
+    int i_codec = 0;
+    char *psz_name = NULL;
+
+    switch( i_fourcc )
+    {
+#if LIBAVCODEC_BUILD >= 4608 
+        case FOURCC_DIV1:
+        case FOURCC_div1:
+        case FOURCC_MPG4:
+        case FOURCC_mpg4:
+            i_codec = CODEC_ID_MSMPEG4V1;
+            psz_name = "MS MPEG-4 v1";
+            break;
+
+        case FOURCC_DIV2:
+        case FOURCC_div2:
+        case FOURCC_MP42:
+        case FOURCC_mp42:
+            i_codec = CODEC_ID_MSMPEG4V2;
+            psz_name = "MS MPEG-4 v2";
+            break;
+#endif
 
+        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:
 #if LIBAVCODEC_BUILD >= 4608 
-    { MSMPEG4v1_VIDEO_ES,   CODEC_ID_MSMPEG4V1, "MS MPEG-4 v1" },
-    { MSMPEG4v2_VIDEO_ES,   CODEC_ID_MSMPEG4V2, "MS MPEG-4 v2" },
-    { MSMPEG4v3_VIDEO_ES,   CODEC_ID_MSMPEG4V3, "MS MPEG-4 v3" },
+            i_codec = CODEC_ID_MSMPEG4V3;
 #else
-    { MSMPEG4v3_VIDEO_ES,   CODEC_ID_MSMPEG4,   "MS MPEG-4 v3" },
+            i_codec = CODEC_ID_MSMPEG4;
 #endif
+            psz_name = "MS MPEG-4 v3";
+            break;
+
 #if LIBAVCODEC_BUILD >= 4615
-    { SVQ1_VIDEO_ES,    CODEC_ID_SVQ1,  "SVQ-1 (Sorenson Video v1)" },
+        case FOURCC_SVQ1:
+            i_codec = CODEC_ID_SVQ1;
+            psz_name = "SVQ-1 (Sorenson Video v1)";
+            break;
 #endif
-    { MPEG4_VIDEO_ES,   CODEC_ID_MPEG4, "MPEG-4" },
-    { H263_VIDEO_ES,    CODEC_ID_H263,  "H263" },
-    { I263_VIDEO_ES,    CODEC_ID_H263I, "H263.I" },
-/* this entry is to recognize the end */
-    { 0,                CODEC_ID_NONE,  "Unknown" }
-};
 
+        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:
+            i_codec = CODEC_ID_MPEG4;
+            psz_name = "MPEG-4";
+            break;
 
-static int ffmpeg_GetFfmpegCodec( int i_vlc_codec, 
-                                  int *pi_ffmpeg_codec,
-                                  char **ppsz_name )
-{
-    int i_codec;
+        case FOURCC_H263:
+        case FOURCC_h263:
+        case FOURCC_U263:
+            i_codec = CODEC_ID_H263;
+            psz_name = "H263";
+            break;
 
-    for( i_codec = 0; ; i_codec++ )
-    {
-        if( ( ffmpeg_Codecs[i_codec].i_vlc_codec == i_vlc_codec )||
-            ( ffmpeg_Codecs[i_codec].i_ffmpeg_codec == CODEC_ID_NONE ) )
-        {
+        case FOURCC_I263:
+        case FOURCC_i263:
+            i_codec = CODEC_ID_H263I;
+            psz_name = "I263.I";
             break;
-        }
     }
-    if( pi_ffmpeg_codec )
-        *pi_ffmpeg_codec = ffmpeg_Codecs[i_codec].i_ffmpeg_codec;
-    if( ppsz_name )
-        *ppsz_name = ffmpeg_Codecs[i_codec].psz_name;
-
-    return( ffmpeg_Codecs[i_codec].i_ffmpeg_codec 
-                == CODEC_ID_NONE ? 0 : 1);
-}
 
+    if( i_codec )
+    {
+        if( pi_ffmpeg_codec ) *pi_ffmpeg_codec = i_codec;
+        if( ppsz_name ) *ppsz_name = psz_name;
+        return VLC_TRUE;
+    }
 
+    return VLC_FALSE;
+}
 
 
 typedef struct videodec_thread_s
index 4ade5d6..eb25557 100644 (file)
@@ -2,7 +2,7 @@
  * crop.c : Crop video plugin for vlc
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: crop.c,v 1.4 2002/07/20 18:01:42 sam Exp $
+ * $Id: crop.c,v 1.5 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -419,7 +419,7 @@ static void UpdateStats( vout_thread_t *p_vout, picture_t *p_pic )
     /* Determine where black borders are */
     switch( p_vout->output.i_chroma )
     {
-    case FOURCC_I420:
+    case VLC_FOURCC('I','4','2','0'):
         /* XXX: Do not laugh ! I know this is very naive. But it's just a
          *      proof of concept code snippet... */
         for( i = i_lines ; i-- ; )
index b819fea..59b90ee 100644 (file)
@@ -2,7 +2,7 @@
  * deinterlace.c : deinterlacer plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: deinterlace.c,v 1.18 2002/07/20 18:01:42 sam Exp $
+ * $Id: deinterlace.c,v 1.19 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -206,10 +206,10 @@ static int vout_Init( vout_thread_t *p_vout )
      * the decoder to output directly to our structures. */
     switch( p_vout->render.i_chroma )
     {
-        case FOURCC_I420:
-        case FOURCC_IYUV:
-        case FOURCC_YV12:
-        case FOURCC_I422:
+        case VLC_FOURCC('I','4','2','0'):
+        case VLC_FOURCC('I','Y','U','V'):
+        case VLC_FOURCC('Y','V','1','2'):
+        case VLC_FOURCC('I','4','2','2'):
             p_vout->output.i_chroma = p_vout->render.i_chroma;
             p_vout->output.i_width  = p_vout->render.i_width;
             p_vout->output.i_height = p_vout->render.i_height;
@@ -226,9 +226,9 @@ static int vout_Init( vout_thread_t *p_vout )
 
     switch( p_vout->render.i_chroma )
     {
-    case FOURCC_I420:
-    case FOURCC_IYUV:
-    case FOURCC_YV12:
+    case VLC_FOURCC('I','4','2','0'):
+    case VLC_FOURCC('I','Y','U','V'):
+    case VLC_FOURCC('Y','V','1','2'):
         switch( p_vout->p_sys->i_mode )
         {
         case DEINTERLACE_BOB:
@@ -250,11 +250,11 @@ static int vout_Init( vout_thread_t *p_vout )
         }
         break;
 
-    case FOURCC_I422:
+    case VLC_FOURCC('I','4','2','2'):
         p_vout->p_sys->p_vout =
             vout_CreateThread( p_vout,
                        p_vout->output.i_width, p_vout->output.i_height,
-                       FOURCC_I420, p_vout->output.i_aspect );
+                       VLC_FOURCC('I','4','2','0'), p_vout->output.i_aspect );
         break;
 
     default:
@@ -432,9 +432,9 @@ static void RenderBob( vout_thread_t *p_vout,
 
         switch( p_vout->render.i_chroma )
         {
-        case FOURCC_I420:
-        case FOURCC_IYUV:
-        case FOURCC_YV12:
+        case VLC_FOURCC('I','4','2','0'):
+        case VLC_FOURCC('I','Y','U','V'):
+        case VLC_FOURCC('Y','V','1','2'):
 
             for( ; p_out < p_out_end ; )
             {
@@ -446,7 +446,7 @@ static void RenderBob( vout_thread_t *p_vout,
             }
             break;
 
-        case FOURCC_I422:
+        case VLC_FOURCC('I','4','2','2'):
 
             i_increment = 2 * p_pic->p[i_plane].i_pitch;
 
index 61e1934..2dcf46c 100644 (file)
@@ -2,7 +2,7 @@
  * scope.c : Scope effect module
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: scope.c,v 1.9 2002/07/20 18:01:42 sam Exp $
+ * $Id: scope.c,v 1.10 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -126,7 +126,7 @@ static int aout_Open( aout_thread_t *p_aout )
     /* Open video output */
     p_aout->p_sys->p_vout =
         vout_CreateThread( p_aout, SCOPE_WIDTH, SCOPE_HEIGHT,
-                           FOURCC_I420, SCOPE_ASPECT );
+                           VLC_FOURCC('I','4','2','0'), SCOPE_ASPECT );
 
     if( p_aout->p_sys->p_vout == NULL )
     {
index 1f7e45b..87e7354 100644 (file)
@@ -2,7 +2,7 @@
  * ggi.c : GGI plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: ggi.c,v 1.23 2002/07/20 18:01:42 sam Exp $
+ * $Id: ggi.c,v 1.24 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -163,17 +163,17 @@ int vout_Init( vout_thread_t *p_vout )
     switch( p_vout->p_sys->i_bits_per_pixel )
     {
         case 8:
-            p_vout->output.i_chroma = FOURCC_RGB2;
+            p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2');
             p_vout->output.pf_setpalette = SetPalette;
             break;
         case 15:
-            p_vout->output.i_chroma = FOURCC_RV15; break;
+            p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5'); break;
         case 16:
-            p_vout->output.i_chroma = FOURCC_RV16; break;
+            p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); break;
         case 24:
-            p_vout->output.i_chroma = FOURCC_RV24; break;
+            p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); break;
         case 32:
-            p_vout->output.i_chroma = FOURCC_RV32; break;
+            p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); break;
         default:
             msg_Err( p_vout, "unknown screen depth %i",
                      p_vout->p_sys->i_bits_per_pixel );
@@ -206,23 +206,21 @@ int vout_Init( vout_thread_t *p_vout )
      * directly by the decoder */
     p_vout->p_sys->i_index = 0;
     p_pic->p->p_pixels = p_b[ 0 ]->write;
-    p_pic->p->i_pixel_bytes = p_b[ 0 ]->buffer.plb.pixelformat->size / 8;
+    p_pic->p->i_pixel_pitch = p_b[ 0 ]->buffer.plb.pixelformat->size / 8;
     p_pic->p->i_lines = p_vout->p_sys->mode.visible.y;
 
+    p_pic->p->i_pitch = p_b[ 0 ]->buffer.plb.stride;
+
     if( p_b[ 0 ]->buffer.plb.pixelformat->size / 8
          * p_vout->p_sys->mode.visible.x
         != p_b[ 0 ]->buffer.plb.stride )
     {
-        p_pic->p->b_margin = 1;
-        p_pic->p->b_hidden = 1;
-        p_pic->p->i_pitch = p_b[ 0 ]->buffer.plb.stride;
-        p_pic->p->i_visible_bytes = p_b[ 0 ]->buffer.plb.pixelformat->size
+        p_pic->p->i_visible_pitch = p_b[ 0 ]->buffer.plb.pixelformat->size
                                      / 8 * p_vout->p_sys->mode.visible.x;
     }
     else
     {
-        p_pic->p->b_margin = 0;
-        p_pic->p->i_pitch = p_b[ 0 ]->buffer.plb.stride;
+        p_pic->p->i_visible_pitch = p_b[ 0 ]->buffer.plb.stride;
     }
 
     p_pic->i_planes = 1;
index ae73ac5..3fc9cec 100644 (file)
@@ -2,7 +2,7 @@
  * glide.c : 3dfx Glide plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: glide.c,v 1.16 2002/07/20 18:01:42 sam Exp $
+ * $Id: glide.c,v 1.17 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -170,14 +170,11 @@ int vout_Init( vout_thread_t *p_vout )
     p_pic->i_planes = 1;
 
     p_pic->p->p_pixels = p_vout->p_sys->pp_buffer[p_vout->p_sys->i_index];
-    p_pic->p->i_pixel_bytes = GLIDE_BYTES_PER_PIXEL;
     p_pic->p->i_lines = GLIDE_HEIGHT;
-
-    p_pic->p->b_margin = 1;
-    p_pic->p->b_hidden = 1;
-    p_pic->p->i_visible_bytes = GLIDE_WIDTH * GLIDE_BYTES_PER_PIXEL;
     p_pic->p->i_pitch = p_vout->p_sys->p_buffer_info.strideInBytes;
                          /*1024 * GLIDE_BYTES_PER_PIXEL*/
+    p_pic->p->i_pixel_pitch = GLIDE_BYTES_PER_PIXEL;
+    p_pic->p->i_visible_pitch = GLIDE_WIDTH * GLIDE_BYTES_PER_PIXEL;
 
     p_pic->i_status = DESTROYED_PICTURE;
     p_pic->i_type   = DIRECT_PICTURE;
index 1a2c2e1..1a479c0 100644 (file)
@@ -2,7 +2,7 @@
  * lpcm_adec.c: lpcm decoder thread
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: lpcm_adec.c,v 1.18 2002/07/17 21:24:06 stef Exp $
+ * $Id: lpcm_adec.c,v 1.19 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Henri Fallon <henri@videolan.org>
@@ -41,7 +41,7 @@
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-static int  decoder_Probe  ( u8 * );
+static int  decoder_Probe  ( vlc_fourcc_t * );
 static int  decoder_Run    ( decoder_fifo_t * );
        void DecodeFrame    ( lpcmdec_thread_t * );
 static int  InitThread     ( lpcmdec_thread_t * );
@@ -78,9 +78,9 @@ MODULE_DEACTIVATE_STOP
 /*****************************************************************************
  * decoder_Probe: probe the decoder and return score
  *****************************************************************************/
-static int decoder_Probe( u8 *pi_type )
+static int decoder_Probe( vlc_fourcc_t *pi_type )
 {
-    return ( *pi_type == LPCM_AUDIO_ES ) ? 0 : -1;
+    return ( *pi_type == VLC_FOURCC('l','p','c','m') ) ? 0 : -1;
 }
 
 /*****************************************************************************
index 10e14ba..a8b6589 100644 (file)
@@ -2,7 +2,7 @@
  * vout_macosx.m: MacOS X video output plugin
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: vout_macosx.m,v 1.13 2002/07/20 18:01:42 sam Exp $
+ * $Id: vout_macosx.m,v 1.14 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Florian G. Pflug <fgp@phlo.org>
@@ -145,13 +145,13 @@ static int vout_Create( vout_thread_t *p_vout )
         return( 1 );
     } 
 
-    if( vout_ChromaCmp( p_vout->render.i_chroma, FOURCC_I420 ) )
+    if( vout_ChromaCmp( p_vout->render.i_chroma, VLC_FOURCC('I','4','2','0') ) )
     {
         err = FindCodec( kYUV420CodecType, bestSpeedCodec,
                          nil, &p_vout->p_sys->img_dc );
         if( err == noErr && p_vout->p_sys->img_dc != 0 )
         {
-            p_vout->output.i_chroma = FOURCC_I420;
+            p_vout->output.i_chroma = VLC_FOURCC('I','4','2','0');
             p_vout->p_sys->i_codec = kYUV420CodecType;
         }
         else
@@ -620,7 +620,7 @@ static int QTNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
 
     switch( p_vout->output.i_chroma )
     {
-        case FOURCC_I420:
+        case VLC_FOURCC('I','4','2','0'):
 
             p_pic->p_sys->p_info = (void *)&p_pic->p_sys->pixmap_i420;
             p_pic->p_sys->i_size = sizeof(PlanarPixmapInfoYUV420);
@@ -633,22 +633,22 @@ static int QTNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
             p_pic->Y_PIXELS = p_pic->p_data; 
             p_pic->p[Y_PLANE].i_lines = i_height;
             p_pic->p[Y_PLANE].i_pitch = i_width;
-            p_pic->p[Y_PLANE].i_pixel_bytes = 1;
-            p_pic->p[Y_PLANE].b_margin = 0;
+            p_pic->p[Y_PLANE].i_pixel_pitch = 1;
+            p_pic->p[Y_PLANE].i_visible_pitch = i_width;
 
             /* U buffer */
             p_pic->U_PIXELS = p_pic->Y_PIXELS + i_height * i_width;
             p_pic->p[U_PLANE].i_lines = i_height / 2;
             p_pic->p[U_PLANE].i_pitch = i_width / 2;
-            p_pic->p[U_PLANE].i_pixel_bytes = 1;
-            p_pic->p[U_PLANE].b_margin = 0;
+            p_pic->p[U_PLANE].i_pixel_pitch = 1;
+            p_pic->p[U_PLANE].i_visible_pitch = i_width / 2;
 
             /* V buffer */
             p_pic->V_PIXELS = p_pic->U_PIXELS + i_height * i_width / 4;
             p_pic->p[V_PLANE].i_lines = i_height / 2;
             p_pic->p[V_PLANE].i_pitch = i_width / 2;
-            p_pic->p[V_PLANE].i_pixel_bytes = 1;
-            p_pic->p[V_PLANE].b_margin = 0;
+            p_pic->p[V_PLANE].i_pixel_pitch = 1;
+            p_pic->p[V_PLANE].i_visible_pitch = i_width / 2;
 
             /* We allocated 3 planes */
             p_pic->i_planes = 3;
@@ -687,7 +687,7 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
 {
     switch( p_vout->output.i_chroma )
     {
-        case FOURCC_I420:
+        case VLC_FOURCC('I','4','2','0'):
             free( p_pic->p_data_orig );
             break;
     }
index 092fb61..4f43ef9 100644 (file)
@@ -40,7 +40,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     ( mad_adec_thread_t * p_mad_adec );
 static void EndThread      ( mad_adec_thread_t * p_mad_adec );
@@ -85,14 +85,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 )
 {
-    if( *pi_type == MPEG1_AUDIO_ES || *pi_type == MPEG2_AUDIO_ES )
-    {
-        return 0;
-    }
-
-    return -1;
+    return *pi_type == VLC_FOURCC('m','p','g','a') ? 0 : -1;
 }
 
 /*****************************************************************************
index 79d51c8..da28acf 100644 (file)
@@ -2,7 +2,7 @@
  * mga.c : Matrox Graphic Array plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: mga.c,v 1.19 2002/07/20 18:01:43 sam Exp $
+ * $Id: mga.c,v 1.20 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
  *          Samuel Hocevar <sam@zoy.org>
@@ -207,7 +207,7 @@ static int vout_Init( vout_thread_t *p_vout )
 
     /* Assume we only do YMGA for the moment. XXX: mga_vid calls this
      * YV12, but it's actually some strange format with packed UV. */
-    p_vout->output.i_chroma = FOURCC_YMGA;
+    p_vout->output.i_chroma = VLC_FOURCC('Y','M','G','A');
     p_vout->p_sys->mga.format = MGA_VID_FORMAT_YV12;
     
     if( ioctl(p_vout->p_sys->i_fd, MGA_VID_CONFIG, &p_vout->p_sys->mga) )
@@ -359,29 +359,20 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
     p_pic->Y_PIXELS = p_pic->p_data;
     p_pic->p[Y_PLANE].i_lines = p_vout->output.i_height;
     p_pic->p[Y_PLANE].i_pitch = CEIL32( p_vout->output.i_width );
-    p_pic->p[Y_PLANE].i_pixel_bytes = 1;
-
-    if( p_pic->p[Y_PLANE].i_pitch == p_vout->output.i_width )
-    {
-        p_pic->p[Y_PLANE].b_margin = 0;
-    }
-    else
-    {
-        /* FIXME: do something here */
-        p_pic->p[Y_PLANE].b_margin = 0;
-    }
+    p_pic->p[Y_PLANE].i_pixel_pitch = 1;
+    p_pic->p[Y_PLANE].i_visible_pitch = p_vout->output.i_width;
 
     p_pic->U_PIXELS = p_pic->p_data + p_vout->p_sys->mga.frame_size * 2/4;
     p_pic->p[U_PLANE].i_lines = p_vout->output.i_height / 2;
     p_pic->p[U_PLANE].i_pitch = CEIL32( p_vout->output.i_width ) / 2;
-    p_pic->p[U_PLANE].i_pixel_bytes = 1;
-    p_pic->p[U_PLANE].b_margin = 0;
+    p_pic->p[U_PLANE].i_pixel_pitch = 1;
+    p_pic->p[U_PLANE].i_visible_pitch = p_pic->p[U_PLANE].i_pitch;
 
     p_pic->V_PIXELS = p_pic->p_data + p_vout->p_sys->mga.frame_size * 3/4;
     p_pic->p[V_PLANE].i_lines = p_vout->output.i_height / 2;
     p_pic->p[V_PLANE].i_pitch = CEIL32( p_vout->output.i_width ) / 2;
-    p_pic->p[V_PLANE].i_pixel_bytes = 1;
-    p_pic->p[V_PLANE].b_margin = 0;
+    p_pic->p[V_PLANE].i_pixel_pitch = 1;
+    p_pic->p[V_PLANE].i_visible_pitch = p_pic->p[V_PLANE].i_pitch;
 
     p_pic->p_sys->i_frame = I_OUTPUTPICTURES;
 
index f67ede2..5aad30d 100644 (file)
@@ -2,7 +2,7 @@
  * xmga.c : X11 MGA plugin for vlc
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: xmga.c,v 1.18 2002/07/20 18:01:43 sam Exp $
+ * $Id: xmga.c,v 1.19 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -337,15 +337,15 @@ static int vout_Init( vout_thread_t *p_vout )
     switch( p_vout->p_sys->i_screen_depth )
     {
         case 8: /* FIXME: set the palette */
-            p_vout->output.i_chroma = FOURCC_RGB2; break;
+            p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2'); break;
         case 15:
-            p_vout->output.i_chroma = FOURCC_RV15; break;
+            p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5'); break;
         case 16:
-            p_vout->output.i_chroma = FOURCC_RV16; break;
+            p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); break;
         case 24:
-            p_vout->output.i_chroma = FOURCC_RV24; break;
+            p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); break;
         case 32:
-            p_vout->output.i_chroma = FOURCC_RV32; break;
+            p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); break;
         default:
             msg_Err( p_vout, "unknown screen depth %i",
                              p_vout->p_sys->i_screen_depth );
index 372ca64..c965f81 100644 (file)
@@ -2,7 +2,7 @@
  * libmp4.c : LibMP4 library for mp4 module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: libmp4.c,v 1.3 2002/07/21 18:47:22 fenrir Exp $
+ * $Id: libmp4.c,v 1.4 2002/07/23 00:39:17 sam Exp $
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  * 
  * This program is free software; you can redistribute it and/or modify
@@ -2154,7 +2154,7 @@ int MP4_ReadBoxRoot( input_thread_t *p_input, MP4_Box_t *p_root )
     
     MP4_SeekAbsolute( p_input, 0 );     /* Go to the begining */
     p_root->i_pos = 0;
-    p_root->i_type = MP4_FOURCC( 'r', 'o', 'o', 't' );
+    p_root->i_type = VLC_FOURCC( 'r', 'o', 'o', 't' );
     p_root->i_shortsize = 1;
     p_root->i_size = p_input->stream.p_selected_area->i_size;
     CreateUUID( &p_root->i_uuid, p_root->i_type );
index 936304f..f1b7472 100644 (file)
@@ -2,7 +2,7 @@
  * libmp4.h : LibMP4 library for mp4 module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: libmp4.h,v 1.3 2002/07/21 18:47:22 fenrir Exp $
+ * $Id: libmp4.h,v 1.4 2002/07/23 00:39:17 sam Exp $
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  * 
  * This program is free software; you can redistribute it and/or modify
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
-
-
-/* XXX It's not the same than VLC_FOURCC */
-#if 0
-#define MP4_FOURCC( a, b, c, d ) \
-    ( ((u32)d) | ( ((u32)c) << 8 ) | ( ((u32)b) << 16 ) | ( ((u32)a) << 24 ) )
-#endif         
-
-#define MP4_FOURCC( a, b, c, d ) \
-    ( ((u32)a) | ( ((u32)b) << 8 ) | ( ((u32)c) << 16 ) | ( ((u32)d) << 24 ) )
-    
-#define FOURCC_uuid MP4_FOURCC( 'u', 'u', 'i', 'd' )
-
-#define FOURCC_ftyp MP4_FOURCC( 'f', 't', 'y', 'p' )
-#define FOURCC_moov MP4_FOURCC( 'm', 'o', 'o', 'v' )
-#define FOURCC_cmov MP4_FOURCC( 'c', 'm', 'o', 'v' )
-#define FOURCC_dcom MP4_FOURCC( 'd', 'c', 'o', 'm' )
-#define FOURCC_cmvd MP4_FOURCC( 'c', 'm', 'v', 'd' )
-    
-#define FOURCC_moof MP4_FOURCC( 'm', 'o', 'o', 'f' )
-#define FOURCC_mdat MP4_FOURCC( 'm', 'd', 'a', 't' )
-#define FOURCC_skip MP4_FOURCC( 's', 'k', 'i', 'p' )
-#define FOURCC_free MP4_FOURCC( 'f', 'r', 'e', 'e' )
-#define FOURCC_udta MP4_FOURCC( 'u', 'd', 't', 'a' )
-#define FOURCC_wide MP4_FOURCC( 'w', 'i', 'd', 'e' )
-
-#define FOURCC_trak MP4_FOURCC( 't', 'r', 'a', 'k' )
-#define FOURCC_mvhd MP4_FOURCC( 'm', 'v', 'h', 'd' )
-#define FOURCC_tkhd MP4_FOURCC( 't', 'k', 'h', 'd' )
-#define FOURCC_tref MP4_FOURCC( 't', 'r', 'e', 'f' )
-#define FOURCC_mdia MP4_FOURCC( 'm', 'd', 'i', 'a' )
-#define FOURCC_mdhd MP4_FOURCC( 'm', 'd', 'h', 'd' )
-#define FOURCC_hdlr MP4_FOURCC( 'h', 'd', 'l', 'r' )
-#define FOURCC_minf MP4_FOURCC( 'm', 'i', 'n', 'f' )
-#define FOURCC_vmhd MP4_FOURCC( 'v', 'm', 'h', 'd' )
-#define FOURCC_smhd MP4_FOURCC( 's', 'm', 'h', 'd' )
-#define FOURCC_hmhd MP4_FOURCC( 'h', 'm', 'h', 'd' )
-#define FOURCC_dinf MP4_FOURCC( 'd', 'i', 'n', 'f' )
-#define FOURCC_url  MP4_FOURCC( 'u', 'r', 'l', ' ' )
-#define FOURCC_urn  MP4_FOURCC( 'u', 'r', 'n', ' ' )
-#define FOURCC_dref MP4_FOURCC( 'd', 'r', 'e', 'f' )
-#define FOURCC_stbl MP4_FOURCC( 's', 't', 'b', 'l' )
-#define FOURCC_stts MP4_FOURCC( 's', 't', 't', 's' )
-#define FOURCC_ctts MP4_FOURCC( 'c', 't', 't', 's' )
-#define FOURCC_stsd MP4_FOURCC( 's', 't', 's', 'd' )
-#define FOURCC_stsz MP4_FOURCC( 's', 't', 's', 'z' )
-#define FOURCC_stz2 MP4_FOURCC( 's', 't', 'z', '2' )
-#define FOURCC_stsc MP4_FOURCC( 's', 't', 's', 'c' )
-#define FOURCC_stco MP4_FOURCC( 's', 't', 'c', 'o' )
-#define FOURCC_co64 MP4_FOURCC( 'c', 'o', '6', '4' )
-#define FOURCC_stss MP4_FOURCC( 's', 't', 's', 's' )
-#define FOURCC_stsh MP4_FOURCC( 's', 't', 's', 'h' )
-#define FOURCC_stdp MP4_FOURCC( 's', 't', 'd', 'p' )
-#define FOURCC_padb MP4_FOURCC( 'p', 'a', 'd', 'b' )
-#define FOURCC_edts MP4_FOURCC( 'e', 'd', 't', 's' )
-#define FOURCC_elst MP4_FOURCC( 'e', 'l', 's', 't' )
-#define FOURCC_udta MP4_FOURCC( 'u', 'd', 't', 'a' )
-#define FOURCC_mvex MP4_FOURCC( 'm', 'v', 'e', 'x' )
-#define FOURCC_trex MP4_FOURCC( 't', 'r', 'e', 'x' )
-#define FOURCC_mfhd MP4_FOURCC( 'm', 'f', 'h', 'd' )
-#define FOURCC_traf MP4_FOURCC( 't', 'r', 'a', 'f' )
-#define FOURCC_tfhd MP4_FOURCC( 't', 'f', 'h', 'd' )
-#define FOURCC_trun MP4_FOURCC( 't', 'r', 'u', 'n' )
-#define FOURCC_cprt MP4_FOURCC( 'c', 'p', 'r', 't' )
-#define FOURCC_iods MP4_FOURCC( 'i', 'o', 'd', 's' )
-
-#define FOURCC_nmhd MP4_FOURCC( 'n', 'm', 'h', 'd' )
-#define FOURCC_mp4v MP4_FOURCC( 'm', 'p', '4', 'v' )
-#define FOURCC_mp4a MP4_FOURCC( 'm', 'p', '4', 'a' )
-#define FOURCC_mp4s MP4_FOURCC( 'm', 'p', '4', 's' )
-#define FOURCC_vide MP4_FOURCC( 'v', 'i', 'd', 'e' )
-#define FOURCC_soun MP4_FOURCC( 's', 'o', 'u', 'n' )
-#define FOURCC_hint MP4_FOURCC( 'h', 'i', 'n', 't' )
-    
-#define FOURCC_dpnd MP4_FOURCC( 'd', 'p', 'n', 'd' )
-#define FOURCC_ipir MP4_FOURCC( 'i', 'p', 'i', 'r' )
-#define FOURCC_mpod MP4_FOURCC( 'm', 'p', 'o', 'd' )
-#define FOURCC_hnti MP4_FOURCC( 'h', 'n', 't', 'i' )
-#define FOURCC_rtp  MP4_FOURCC( 'r', 't', 'p', ' ' )
-
-#define FOURCC_isom MP4_FOURCC( 'i', 's', 'o', 'm' )
-#define FOURCC_esds MP4_FOURCC( 'e', 's', 'd', 's' )
-
-#define FOURCC_zlib MP4_FOURCC( 'z', 'l', 'i', 'b' )
-#define FOURCC_SVQ1 MP4_FOURCC( 'S', 'V', 'Q', '1' )
-#define FOURCC__mp3 MP4_FOURCC( '.', 'm', 'p', '3' )
-#define FOURCC_3IV1 MP4_FOURCC( '3', 'I', 'V', '1' )
-#define FOURCC_h263 MP4_FOURCC( 'h', '2', '6', '3' )
-#define FOURCC_DIVX MP4_FOURCC( 'D', 'I', 'V', 'X' )
-#define FOURCC_cvid MP4_FOURCC( 'c', 'v', 'i', 'd' )
-#define FOURCC_mjpa MP4_FOURCC( 'm', 'j', 'p', 'a' )
-#define FOURCC_mjpb MP4_FOURCC( 'm', 'j', 'q', 't' )
-#define FOURCC_mjqt MP4_FOURCC( 'm', 'j', 'h', 't' )
-#define FOURCC_mjht MP4_FOURCC( 'm', 'j', 'p', 'b' )
+#define FOURCC_uuid VLC_FOURCC( 'u', 'u', 'i', 'd' )
+
+#define FOURCC_ftyp VLC_FOURCC( 'f', 't', 'y', 'p' )
+#define FOURCC_moov VLC_FOURCC( 'm', 'o', 'o', 'v' )
+#define FOURCC_cmov VLC_FOURCC( 'c', 'm', 'o', 'v' )
+#define FOURCC_dcom VLC_FOURCC( 'd', 'c', 'o', 'm' )
+#define FOURCC_cmvd VLC_FOURCC( 'c', 'm', 'v', 'd' )
+    
+#define FOURCC_moof VLC_FOURCC( 'm', 'o', 'o', 'f' )
+#define FOURCC_mdat VLC_FOURCC( 'm', 'd', 'a', 't' )
+#define FOURCC_skip VLC_FOURCC( 's', 'k', 'i', 'p' )
+#define FOURCC_free VLC_FOURCC( 'f', 'r', 'e', 'e' )
+#define FOURCC_udta VLC_FOURCC( 'u', 'd', 't', 'a' )
+#define FOURCC_wide VLC_FOURCC( 'w', 'i', 'd', 'e' )
+
+#define FOURCC_trak VLC_FOURCC( 't', 'r', 'a', 'k' )
+#define FOURCC_mvhd VLC_FOURCC( 'm', 'v', 'h', 'd' )
+#define FOURCC_tkhd VLC_FOURCC( 't', 'k', 'h', 'd' )
+#define FOURCC_tref VLC_FOURCC( 't', 'r', 'e', 'f' )
+#define FOURCC_mdia VLC_FOURCC( 'm', 'd', 'i', 'a' )
+#define FOURCC_mdhd VLC_FOURCC( 'm', 'd', 'h', 'd' )
+#define FOURCC_hdlr VLC_FOURCC( 'h', 'd', 'l', 'r' )
+#define FOURCC_minf VLC_FOURCC( 'm', 'i', 'n', 'f' )
+#define FOURCC_vmhd VLC_FOURCC( 'v', 'm', 'h', 'd' )
+#define FOURCC_smhd VLC_FOURCC( 's', 'm', 'h', 'd' )
+#define FOURCC_hmhd VLC_FOURCC( 'h', 'm', 'h', 'd' )
+#define FOURCC_dinf VLC_FOURCC( 'd', 'i', 'n', 'f' )
+#define FOURCC_url  VLC_FOURCC( 'u', 'r', 'l', ' ' )
+#define FOURCC_urn  VLC_FOURCC( 'u', 'r', 'n', ' ' )
+#define FOURCC_dref VLC_FOURCC( 'd', 'r', 'e', 'f' )
+#define FOURCC_stbl VLC_FOURCC( 's', 't', 'b', 'l' )
+#define FOURCC_stts VLC_FOURCC( 's', 't', 't', 's' )
+#define FOURCC_ctts VLC_FOURCC( 'c', 't', 't', 's' )
+#define FOURCC_stsd VLC_FOURCC( 's', 't', 's', 'd' )
+#define FOURCC_stsz VLC_FOURCC( 's', 't', 's', 'z' )
+#define FOURCC_stz2 VLC_FOURCC( 's', 't', 'z', '2' )
+#define FOURCC_stsc VLC_FOURCC( 's', 't', 's', 'c' )
+#define FOURCC_stco VLC_FOURCC( 's', 't', 'c', 'o' )
+#define FOURCC_co64 VLC_FOURCC( 'c', 'o', '6', '4' )
+#define FOURCC_stss VLC_FOURCC( 's', 't', 's', 's' )
+#define FOURCC_stsh VLC_FOURCC( 's', 't', 's', 'h' )
+#define FOURCC_stdp VLC_FOURCC( 's', 't', 'd', 'p' )
+#define FOURCC_padb VLC_FOURCC( 'p', 'a', 'd', 'b' )
+#define FOURCC_edts VLC_FOURCC( 'e', 'd', 't', 's' )
+#define FOURCC_elst VLC_FOURCC( 'e', 'l', 's', 't' )
+#define FOURCC_udta VLC_FOURCC( 'u', 'd', 't', 'a' )
+#define FOURCC_mvex VLC_FOURCC( 'm', 'v', 'e', 'x' )
+#define FOURCC_trex VLC_FOURCC( 't', 'r', 'e', 'x' )
+#define FOURCC_mfhd VLC_FOURCC( 'm', 'f', 'h', 'd' )
+#define FOURCC_traf VLC_FOURCC( 't', 'r', 'a', 'f' )
+#define FOURCC_tfhd VLC_FOURCC( 't', 'f', 'h', 'd' )
+#define FOURCC_trun VLC_FOURCC( 't', 'r', 'u', 'n' )
+#define FOURCC_cprt VLC_FOURCC( 'c', 'p', 'r', 't' )
+#define FOURCC_iods VLC_FOURCC( 'i', 'o', 'd', 's' )
+
+#define FOURCC_nmhd VLC_FOURCC( 'n', 'm', 'h', 'd' )
+#define FOURCC_mp4v VLC_FOURCC( 'm', 'p', '4', 'v' )
+#define FOURCC_mp4a VLC_FOURCC( 'm', 'p', '4', 'a' )
+#define FOURCC_mp4s VLC_FOURCC( 'm', 'p', '4', 's' )
+#define FOURCC_vide VLC_FOURCC( 'v', 'i', 'd', 'e' )
+#define FOURCC_soun VLC_FOURCC( 's', 'o', 'u', 'n' )
+#define FOURCC_hint VLC_FOURCC( 'h', 'i', 'n', 't' )
+    
+#define FOURCC_dpnd VLC_FOURCC( 'd', 'p', 'n', 'd' )
+#define FOURCC_ipir VLC_FOURCC( 'i', 'p', 'i', 'r' )
+#define FOURCC_mpod VLC_FOURCC( 'm', 'p', 'o', 'd' )
+#define FOURCC_hnti VLC_FOURCC( 'h', 'n', 't', 'i' )
+#define FOURCC_rtp  VLC_FOURCC( 'r', 't', 'p', ' ' )
+
+#define FOURCC_isom VLC_FOURCC( 'i', 's', 'o', 'm' )
+#define FOURCC_esds VLC_FOURCC( 'e', 's', 'd', 's' )
+
+#define FOURCC_zlib VLC_FOURCC( 'z', 'l', 'i', 'b' )
+#define FOURCC_SVQ1 VLC_FOURCC( 'S', 'V', 'Q', '1' )
+#define FOURCC__mp3 VLC_FOURCC( '.', 'm', 'p', '3' )
+#define FOURCC_3IV1 VLC_FOURCC( '3', 'I', 'V', '1' )
+#define FOURCC_h263 VLC_FOURCC( 'h', '2', '6', '3' )
+#define FOURCC_DIVX VLC_FOURCC( 'D', 'I', 'V', 'X' )
+#define FOURCC_cvid VLC_FOURCC( 'c', 'v', 'i', 'd' )
+#define FOURCC_mjpa VLC_FOURCC( 'm', 'j', 'p', 'a' )
+#define FOURCC_mjpb VLC_FOURCC( 'm', 'j', 'q', 't' )
+#define FOURCC_mjqt VLC_FOURCC( 'm', 'j', 'h', 't' )
+#define FOURCC_mjht VLC_FOURCC( 'm', 'j', 'p', 'b' )
  
-#define FOURCC_jpeg MP4_FOURCC( 'j', 'p', 'e', 'g' )
-   
-/*
-#define FOURCC_  MP4_FOURCC( '', '', '', '' )
-*/    
+#define FOURCC_jpeg VLC_FOURCC( 'j', 'p', 'e', 'g' )
+
 /* Do you want some debug information on all read boxes ? */
 #define MP4_VERBOSE  1
 
index 048c227..366ce71 100644 (file)
@@ -2,7 +2,7 @@
  * mp4.c : MP4 file input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: mp4.c,v 1.4 2002/07/21 21:18:15 fenrir Exp $
+ * $Id: mp4.c,v 1.5 2002/07/23 00:39:17 sam Exp $
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  * 
  * This program is free software; you can redistribute it and/or modify
@@ -756,9 +756,6 @@ static void MP4_StartDecoder( input_thread_t *p_input,
     int i_chunk;
     u8  *p_bmih;
  
-    int i_codec;
-    char *psz_name;
-    
     MP4_Box_t *p_esds;
 
     
@@ -804,120 +801,41 @@ static void MP4_StartDecoder( input_thread_t *p_input,
     
     p_demux_track->p_es->i_stream_id = p_demux_track->i_track_ID;
 
-    p_demux_track->p_es->i_type = UNKNOWN_ES;
+    p_demux_track->p_es->i_fourcc = p_sample->i_type;
     p_demux_track->p_es->i_cat = p_demux_track->i_cat;
 
-    /* search for the codec */
-    if( !MP4_GetCodec( p_sample->i_type, &i_codec, &psz_name ) )
-    {
-        msg_Warn( p_input, "%s (%c%c%c%c) unsupported", 
-                  psz_name,
-                  (p_sample->i_type )&0xff,
-                  (p_sample->i_type >> 8)&0xff,
-                  (p_sample->i_type >> 16)&0xff,
-                  (p_sample->i_type >> 24)&0xff);
-        p_demux_track->b_ok = 0;
-        return;
-    }
-    else
-    {
-        p_demux_track->p_es->i_type = i_codec;
-        msg_Info( p_input, "%s supported(or a subpart)", psz_name );
-    }
-
-
     /* now see if esds is present and if so create a data packet 
         with decoder_specific_info  */
-    if( ( p_esds = MP4_FindBox( p_sample, FOURCC_esds ) )&&
-        ( p_esds->data.p_esds->es_descriptor.p_decConfigDescr ) )
+#define p_decconfig p_esds->data.p_esds->es_descriptor.p_decConfigDescr
+    if( ( p_esds = MP4_FindBox( p_sample, FOURCC_esds ) )
+         && p_decconfig && p_decconfig->i_decoder_specific_info_len )
     {
-#define es_descriptor p_esds->data.p_esds->es_descriptor
-        /* First update information based on i_objectTypeIndication */
-        switch( es_descriptor.p_decConfigDescr->i_objectTypeIndication )
-        {
-            case( 0x20 ):
-                p_demux_track->p_es->i_type = MPEG4_VIDEO_ES;
-                break;
-            case( 0x40):
-                p_demux_track->p_es->i_type = UNKNOWN_ES; /* In fact AAC */
-                break;
-            case( 0x60):
-            case( 0x61):
-            case( 0x62):
-            case( 0x63):
-            case( 0x64):
-            case( 0x65):
-                p_demux_track->p_es->i_type = MPEG2_VIDEO_ES;
-                break;
-            /* Theses are MPEG2-AAC */
-            case( 0x66): /* main profile */
-            case( 0x67): /* Low complexity profile */
-            case( 0x68): /* Scaleable Sampling rate profile */
-                p_demux_track->p_es->i_type = UNKNOWN_ES; 
-                break;
-            /* true MPEG 2 audio */
-            case( 0x69): 
-                p_demux_track->p_es->i_type = MPEG2_AUDIO_ES;
-                break;
-            case( 0x6a):
-                p_demux_track->p_es->i_type = MPEG1_VIDEO_ES;
-                break;
-            case( 0x6b):
-                p_demux_track->p_es->i_type = MPEG1_AUDIO_ES;
-                break;
-            case( 0x6c ):
-                p_demux_track->p_es->i_type = UNKNOWN_ES; /* in fact jpeg */
-                break;
-            default:
-                /* Unknown entry, don't touch i_type */
-                msg_Warn( p_input, "objectTypeIndication(0x%x) unknow",
-                      es_descriptor.p_decConfigDescr->i_objectTypeIndication );
-                break;
-        }
+        data_packet_t *p_data;
+        int i_size = p_decconfig->i_decoder_specific_info_len;
 
-        /* Create a packet to init the decoder, send with the first frame */
-        if( ( es_descriptor.p_decConfigDescr->i_decoder_specific_info_len )&&
-            ( p_demux_track->p_es->i_type != UNKNOWN_ES ) )
+        /* data packet for the data */
+        if( !(p_data = input_NewPacket( p_input->p_method_data, i_size ) ) )
         {
-            data_packet_t *p_data;
-            int i_size = 
-            
-            i_size = 
-                es_descriptor.p_decConfigDescr->i_decoder_specific_info_len;
-    
-            /* data packet for the data */
-            if( !(p_data = input_NewPacket( p_input->p_method_data, i_size ) ) )
-            {
-                return;
-            }
-
-            memcpy( p_data->p_payload_start,
-                    es_descriptor.p_decConfigDescr->p_decoder_specific_info,
-                    i_size ); 
-            p_demux_track->p_data_init = p_data;
+            return;
         }
 
-#undef es_descriptor
-    }
-
-    if( p_demux_track->p_es->i_type == UNKNOWN_ES )
-    {
-        msg_Warn( p_input, "SampleEntry in fact not supported" );
-        p_demux_track->b_ok = 0;
-        return;
+        memcpy( p_data->p_payload_start,
+                p_decconfig->p_decoder_specific_info,
+                i_size ); 
+        p_demux_track->p_data_init = p_data;
     }
+#undef p_decconfig
 
     /* some last initialisation */
     switch( p_demux_track->i_cat )
     {
         case( VIDEO_ES ):    
-            p_demux_track->p_es->b_audio = 0;
-
             /* now create a bitmapinfoheader_t for decoder */
             p_bmih = malloc( 40 );
             memset( p_bmih, 0, 40);
             MP4_Set4BytesLE( p_bmih, 40 );
-            if( p_sample->data.p_sample_mp4v->i_width )
+            if( p_sample->data.p_sample_mp4v
+                 && p_sample->data.p_sample_mp4v->i_width )
             {
                 MP4_Set4BytesLE( p_bmih + 4, 
                                  p_sample->data.p_sample_mp4v->i_width );
@@ -927,7 +845,8 @@ static void MP4_StartDecoder( input_thread_t *p_input,
                 /* use display size */
                 MP4_Set4BytesLE( p_bmih + 4, p_demux_track->i_width );
             }
-            if( p_sample->data.p_sample_mp4v->i_height )
+            if( p_sample->data.p_sample_mp4v
+                 && p_sample->data.p_sample_mp4v->i_height )
             {
                 MP4_Set4BytesLE( p_bmih + 8, 
                                  p_sample->data.p_sample_mp4v->i_height );
@@ -940,7 +859,6 @@ static void MP4_StartDecoder( input_thread_t *p_input,
             p_demux_track->p_es->p_demux_data = p_bmih;
             break;
         case( AUDIO_ES ):
-            p_demux_track->p_es->b_audio = 1;
             break;
         default:
             break;
index 03ab88a..20bcc32 100644 (file)
@@ -2,7 +2,7 @@
  * mp4.h : MP4 file input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: mp4.h,v 1.4 2002/07/21 19:57:22 fenrir Exp $
+ * $Id: mp4.h,v 1.5 2002/07/23 00:39:17 sam Exp $
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  * 
  * This program is free software; you can redistribute it and/or modify
@@ -199,58 +199,4 @@ static inline mtime_t MP4_GetMoviePTS(demux_data_mp4_t *p_demux )
                 (mtime_t)p_demux->i_timescale )
           );
 }
-    
-static struct
-{
-    u32 i_fourcc;
-    int i_codec;
-    char *psz_name;
-} MP4_Codecs [] = {
-    /* Video codec */
-    { FOURCC_vide,  UNKNOWN_ES,     "Generic VisualSampleEntry" },
-    { FOURCC_DIVX,  MPEG4_VIDEO_ES, "DIVX SampleEntry (MPEG-4)" },
-    { FOURCC_h263,  H263_VIDEO_ES,  "H263 SampleEntry" },
-    { FOURCC_SVQ1,  SVQ1_VIDEO_ES,  "SVQ1 SampleEntry (Sorenson Video v1" },
-    { FOURCC_mp4v,  MPEG4_VIDEO_ES, "MP4VisualSampleEntry (MPEG-4)" },
-    { FOURCC_3IV1,  UNKNOWN_ES,     "3IV1 SampleEntry" },
-    { FOURCC_cvid,  CINEPAK_VIDEO_ES,"cvid SampleEntry (Cinepak Video Codec)" },
-    { FOURCC_mjpa,  UNKNOWN_ES,     "MJPEG-A SampleEntry (Motion JPEG)" },
-    { FOURCC_mjpb,  UNKNOWN_ES,     "MJPEG-A SampleEntry (Motion JPEG)" },
-    { FOURCC_jpeg,  UNKNOWN_ES,     "JPEG (ISO) SampleEntry" },
-
-    /* Audio codec */
-    { FOURCC_soun,  UNKNOWN_ES,     "Generic AudioSampleEntry" },
-    /* The things with mp4a is that we could have aac audio but
-       also mpeg audio, depend on objectTypeIndication,
-       it would be probe later */
-    { FOURCC_mp4a,  MPEG2_AUDIO_ES, "MP4AudioSampleEntry (MPEGAUDIO-AAC)" },
-    { FOURCC__mp3,  MPEG2_AUDIO_ES, ".mp3 SampleEntry (MPEG-I/II layer 3)" },
-    
-    /* Last entry with fourcc == 0 */
-    { 0,            UNKNOWN_ES,     "Unknown SampleEntry" }
-};
 
-static int MP4_GetCodec( u32  i_fourcc,
-                         int  *pi_codec,
-                         char **ppsz_name )
-{
-   int i;
-
-    for( i = 0; ; i++ )
-    {
-        if( ( MP4_Codecs[i].i_fourcc == i_fourcc )||
-            ( MP4_Codecs[i].i_fourcc == 0) )
-        {
-            break;
-        }
-    }
-
-    if( pi_codec )
-        *pi_codec = MP4_Codecs[i].i_codec;
-    
-    if( ppsz_name )
-        *ppsz_name = MP4_Codecs[i].psz_name;
-
-    return( MP4_Codecs[i].i_codec == UNKNOWN_ES ? 0 : 1 );
-}
-                        
index 18a7be9..653bbb5 100644 (file)
@@ -2,7 +2,7 @@
  * mpeg_adec.c: MPEG audio decoder thread
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: mpeg_adec.c,v 1.25 2002/06/01 18:04:49 sam Exp $
+ * $Id: mpeg_adec.c,v 1.26 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *          Michel Lespinasse <walken@via.ecp.fr>
@@ -42,7 +42,7 @@
 /*****************************************************************************
  * Local Prototypes
  *****************************************************************************/
-static int   decoder_Probe ( u8 * );
+static int   decoder_Probe ( vlc_fourcc_t * );
 static int   decoder_Run   ( decoder_fifo_t * );
 static void  EndThread     ( adec_thread_t * );
 static void  DecodeThread  ( adec_thread_t * );
@@ -79,10 +79,9 @@ MODULE_DEACTIVATE_STOP
 /*****************************************************************************
  * decoder_Probe: probe the decoder and return score
  *****************************************************************************/
-static int decoder_Probe( u8 *pi_type )
+static int decoder_Probe( vlc_fourcc_t *pi_type )
 {
-    return( ( *pi_type == MPEG1_AUDIO_ES
-               || *pi_type == MPEG2_AUDIO_ES ) ? 0 : -1 );
+    return *pi_type == VLC_FOURCC('m','p','g','a') ? 0 : -1;
 }
 
 /*****************************************************************************
index e728413..e4b252b 100644 (file)
@@ -2,7 +2,7 @@
  * mpeg_audio.c : mpeg_audio Stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: mpeg_audio.c,v 1.12 2002/07/21 18:57:02 sigmunau Exp $
+ * $Id: mpeg_audio.c,v 1.13 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  * 
@@ -519,9 +519,9 @@ static int MPEGAudioInit( input_thread_t * p_input )
         return( -1 );
     }
     p_es->i_stream_id = 1;
-    p_es->i_type = !mpeg.i_layer ? MPEG1_AUDIO_ES : MPEG2_AUDIO_ES;
+    p_es->i_fourcc = !mpeg.i_layer ? VLC_FOURCC('m','p','g','a') /* layer 1 */
+                                   : VLC_FOURCC('m','p','g','a'); /* layer 2 */
     p_es->i_cat = AUDIO_ES;
-    p_es->b_audio = 1;
     input_SelectES( p_input, p_es );
 
     p_input->stream.p_selected_program->b_is_ok = 1;
index 565ed29..a9828cf 100644 (file)
@@ -2,7 +2,7 @@
  * mpeg_es.c : Elementary Stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: mpeg_es.c,v 1.9 2002/06/01 12:32:00 sam Exp $
+ * $Id: mpeg_es.c,v 1.10 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -143,7 +143,7 @@ static int ESInit( 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, 0xE0, 0 );
     p_es->i_stream_id = 0xE0;
-    p_es->i_type = MPEG1_VIDEO_ES;
+    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;
index 85e43ec..909d6a1 100644 (file)
@@ -2,7 +2,7 @@
  * mpeg_ps.c : Program Stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: mpeg_ps.c,v 1.15 2002/06/01 12:32:00 sam Exp $
+ * $Id: mpeg_ps.c,v 1.16 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -199,15 +199,13 @@ static int PSInit( input_thread_t * p_input )
                  i_es++ )
             {
 #define p_es p_input->stream.pp_programs[0]->pp_es[i_es]
-                switch( p_es->i_type )
+                switch( p_es->i_fourcc )
                 {
-                    case MPEG1_VIDEO_ES:
-                    case MPEG2_VIDEO_ES:
+                    case VLC_FOURCC('m','p','g','v'):
                         input_SelectES( p_input, p_es );
                         break;
 
-                    case MPEG1_AUDIO_ES:
-                    case MPEG2_AUDIO_ES:
+                    case VLC_FOURCC('m','p','g','a'):
                         if( config_GetInt( p_input, "audio-channel" )
                                 == (p_es->i_id & 0x1F) ||
                            ( config_GetInt( p_input, "audio-channel" ) < 0
@@ -220,7 +218,7 @@ static int PSInit( input_thread_t * p_input )
                         }
                         break;
 
-                    case AC3_AUDIO_ES:
+                    case VLC_FOURCC('a','5','2',' '):
                         if( config_GetInt( p_input, "audio-channel" )
                                 == ((p_es->i_id & 0xF00) >> 8) ||
                            ( config_GetInt( p_input, "audio-channel" ) < 0
@@ -233,7 +231,7 @@ static int PSInit( input_thread_t * p_input )
                         }
                         break;
 
-                    case DVD_SPU_ES:
+                    case VLC_FOURCC('s','p','u',' '):
                         if( config_GetInt( p_input, "spu-channel" )
                                 == ((p_es->i_id & 0x1F00) >> 8) )
                         {
@@ -241,7 +239,7 @@ static int PSInit( input_thread_t * p_input )
                         }
                         break;
 
-                    case LPCM_AUDIO_ES:
+                    case VLC_FOURCC('l','p','c','m'):
                         if( config_GetInt( p_input, "audio-channel" )
                                 == ((p_es->i_id & 0x1F00) >> 8) ||
                            ( config_GetInt( p_input, "audio-channel" ) < 0
index 354d5ec..d2ff7c9 100644 (file)
@@ -2,7 +2,7 @@
  * mpeg_ts.c : Transport Stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: mpeg_ts.c,v 1.15 2002/06/04 00:11:12 sam Exp $
+ * $Id: mpeg_ts.c,v 1.16 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Henri Fallon <henri@via.ecp.fr>
  *          Johan Bilien <jobi@via.ecp.fr>
@@ -593,9 +593,6 @@ static void TSDecodePMT( input_thread_t * p_input, es_descriptor_t * p_es )
                 p_new_es = input_AddES( p_input, p_es->p_pgrm, 
                                         (u16)i_pid, sizeof( es_ts_data_t ) );
 
-                /* Tell the decoders what kind of stream it is */
-                p_new_es->i_type = i_stream_type;
-
                 /* Tell the interface what kind of stream it is and select 
                  * the required ones */
                 {
@@ -603,23 +600,32 @@ static void TSDecodePMT( input_thread_t * p_input, es_descriptor_t * p_es )
                     {
                         case MPEG1_VIDEO_ES:
                         case MPEG2_VIDEO_ES:
+                            p_new_es->i_fourcc = VLC_FOURCC('m','p','g','v');
                             p_new_es->i_cat = VIDEO_ES;
                             break;
                         case MPEG1_AUDIO_ES:
                         case MPEG2_AUDIO_ES:
+                            p_new_es->i_fourcc = VLC_FOURCC('m','p','g','a');
+                            p_new_es->i_cat = AUDIO_ES;
+                            break;
+                        case LPCM_AUDIO_ES:
+                            p_new_es->i_fourcc = VLC_FOURCC('l','p','c','m');
+                            p_new_es->i_stream_id = 0xBD;
                             p_new_es->i_cat = AUDIO_ES;
                             break;
-                        case LPCM_AUDIO_ES :
-                        case AC3_AUDIO_ES :
+                        case AC3_AUDIO_ES:
+                            p_new_es->i_fourcc = VLC_FOURCC('a','5','2',' ');
                             p_new_es->i_stream_id = 0xBD;
                             p_new_es->i_cat = AUDIO_ES;
                             break;
                         /* Not sure this one is fully specification-compliant */
-                        case DVD_SPU_ES :
+                        case DVD_SPU_ES:
+                            p_new_es->i_fourcc = VLC_FOURCC('s','p','u',' ');
                             p_new_es->i_stream_id = 0xBD;
                             p_new_es->i_cat = SPU_ES;
                             break;
                         default :
+                            p_new_es->i_fourcc = 0;
                             p_new_es->i_cat = UNKNOWN_ES;
                             break;
                     }
@@ -823,27 +829,35 @@ void TS_DVBPSI_HandlePMT( input_thread_t * p_input, dvbpsi_pmt_t * p_new_pmt )
                 return;
             }
 
-            p_new_es->i_type = p_es->i_type;
             switch( p_es->i_type )
             {
                 case MPEG1_VIDEO_ES:
                 case MPEG2_VIDEO_ES:
+                    p_new_es->i_fourcc = VLC_FOURCC('m','p','g','v');
                     p_new_es->i_cat = VIDEO_ES;
                     break;
                 case MPEG1_AUDIO_ES:
                 case MPEG2_AUDIO_ES:
+                    p_new_es->i_fourcc = VLC_FOURCC('m','p','g','a');
                     p_new_es->i_cat = AUDIO_ES;
                     break;
                 case LPCM_AUDIO_ES:
+                    p_new_es->i_fourcc = VLC_FOURCC('l','p','c','m');
+                    p_new_es->i_cat = AUDIO_ES;
+                    p_new_es->i_stream_id = 0xBD;
+                    break;
                 case AC3_AUDIO_ES:
+                    p_new_es->i_fourcc = VLC_FOURCC('a','5','2',' ');
                     p_new_es->i_cat = AUDIO_ES;
                     p_new_es->i_stream_id = 0xBD;
                     break;
                 case DVD_SPU_ES:
+                    p_new_es->i_fourcc = VLC_FOURCC('s','p','u',' ');
                     p_new_es->i_cat = SPU_ES;
                     p_new_es->i_stream_id = 0xBD;
                     break;
                 default:
+                    p_new_es->i_fourcc = 0;
                     p_new_es->i_cat = UNKNOWN_ES;
             }
 
index df36b76..7a2145b 100644 (file)
@@ -2,7 +2,7 @@
  * video_parser.c : video parser thread
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: video_parser.c,v 1.25 2002/07/16 21:25:43 sam Exp $
+ * $Id: video_parser.c,v 1.26 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Samuel Hocevar <sam@via.ecp.fr>
@@ -50,7 +50,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        ( vpar_thread_t * );
 static void     EndThread         ( vpar_thread_t * );
@@ -122,10 +122,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 == MPEG1_VIDEO_ES
-               || *pi_type == MPEG2_VIDEO_ES ) ? 0 : -1 );
+    return *pi_type == VLC_FOURCC('m','p','g','v') ? 0 : -1;
 }
 
 /*****************************************************************************
index fc2817b..79b2054 100644 (file)
@@ -2,7 +2,7 @@
  * vpar_headers.c : headers parsing
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: vpar_headers.c,v 1.27 2002/06/07 14:30:41 sam Exp $
+ * $Id: vpar_headers.c,v 1.28 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -212,13 +212,13 @@ static inline u64 ChromaToFourCC( int i_chroma )
     switch( i_chroma )
     {
         case CHROMA_420:
-            return FOURCC_I420;
+            return VLC_FOURCC('I','4','2','0');
 
         case CHROMA_422:
-            return FOURCC_I422;
+            return VLC_FOURCC('I','4','2','2');
 
         case CHROMA_444:
-            return FOURCC_I444;
+            return VLC_FOURCC('I','4','4','4');
 
         default:
             /* This can't happen */
index d502fdd..52fe0e4 100644 (file)
@@ -628,13 +628,13 @@ static int QNXInitDisplay( vout_thread_t * p_vout )
     switch( p_vout->p_sys->i_screen_depth )
     {
         case 8:
-            p_vout->output.i_chroma = FOURCC_RGB2;
+            p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2');
             p_vout->p_sys->i_bytes_per_pixel = 1;
             p_vout->output.pf_setpalette = SetPalette;
             break;
 
         case 15:
-            p_vout->output.i_chroma = FOURCC_RV15;
+            p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5');
             p_vout->p_sys->i_bytes_per_pixel = 2;
             p_vout->output.i_rmask = 0x7c00;
             p_vout->output.i_gmask = 0x03e0;
@@ -642,7 +642,7 @@ static int QNXInitDisplay( vout_thread_t * p_vout )
             break;
 
         case 16:
-            p_vout->output.i_chroma = FOURCC_RV16;
+            p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6');
             p_vout->p_sys->i_bytes_per_pixel = 2;
             p_vout->output.i_rmask = 0xf800;
             p_vout->output.i_gmask = 0x07e0;
@@ -650,7 +650,7 @@ static int QNXInitDisplay( vout_thread_t * p_vout )
             break;
 
         case 24:
-            p_vout->output.i_chroma = FOURCC_RV24;
+            p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4');
             p_vout->p_sys->i_bytes_per_pixel = 3;
             p_vout->output.i_rmask = 0xff0000;
             p_vout->output.i_gmask = 0x00ff00;
@@ -659,7 +659,7 @@ static int QNXInitDisplay( vout_thread_t * p_vout )
 
         case 32:
         default:
-            p_vout->output.i_chroma = FOURCC_RV32;
+            p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2');
             p_vout->p_sys->i_bytes_per_pixel = 4;
             p_vout->output.i_rmask = 0xff0000;
             p_vout->output.i_gmask = 0x00ff00;
@@ -788,19 +788,9 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index )
         p_pic->p->p_pixels = p_pic->p_sys->p_image->image;
         p_pic->p->i_lines = p_pic->p_sys->p_image->size.h;
         p_pic->p->i_pitch = p_pic->p_sys->p_image->bpl;
-        p_pic->p->i_pixel_bytes = p_vout->p_sys->i_bytes_per_pixel;
-
-        if( p_pic->p->i_pitch == p_vout->p_sys->i_bytes_per_pixel * p_pic->p_sys->p_image->size.w )
-        {
-            p_pic->p->b_margin = 0;
-        }
-        else
-        {
-            p_pic->p->b_margin = 1;
-            p_pic->p->b_hidden = 1;
-            p_pic->p->i_visible_bytes = p_vout->p_sys->i_bytes_per_pixel * p_pic->p_sys->p_image->size.w;
-        }
-
+        p_pic->p->i_pixel_pitch = p_vout->p_sys->i_bytes_per_pixel;
+        p_pic->p->i_visible_pitch = p_vout->p_sys->i_bytes_per_pixel
+                                     * p_pic->p_sys->p_image->size.w;
         p_pic->i_planes = 1;
         break;
 
@@ -833,19 +823,9 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index )
         p_pic->p->p_pixels = p_pic->p_sys->p_buf[0];
         p_pic->p->i_lines = p_pic->p_sys->p_ctx[0]->dim.h;
         p_pic->p->i_pitch = p_pic->p_sys->p_ctx[0]->pitch;
-        p_pic->p->i_pixel_bytes = p_vout->p_sys->i_bytes_per_pixel;
-
-        if( p_pic->p->i_pitch == p_vout->p_sys->i_bytes_per_pixel * p_pic->p_sys->p_ctx[0]->dim.w )
-        {
-            p_pic->p->b_margin = 0;
-        }
-        else
-        {
-            p_pic->p->b_margin = 1;
-            p_pic->p->b_hidden = 1;
-            p_pic->p->i_visible_bytes = p_vout->p_sys->i_bytes_per_pixel * p_pic->p_sys->p_ctx[0]->dim.w;
-        }
-
+        p_pic->p->i_pixel_pitch = p_vout->p_sys->i_bytes_per_pixel;
+        p_pic->p->i_visible_pitch = p_vout->p_sys->i_bytes_per_pixel
+                                     * p_pic->p_sys->p_ctx[0]->dim.w;
         p_pic->i_planes = 1;
         break;
 
@@ -873,7 +853,7 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index )
         switch (p_vout->p_sys->i_vc_format)
         {
             case Pg_VIDEO_FORMAT_YUV420:
-                p_vout->output.i_chroma = FOURCC_I420;
+                p_vout->output.i_chroma = VLC_FOURCC('I','4','2','0');
 
                 p_pic->p_sys->p_buf[U_PLANE] = PdGetOffscreenContextPtr( p_pic->p_sys->p_ctx[U_PLANE] );
                 p_pic->p_sys->p_buf[V_PLANE] = PdGetOffscreenContextPtr( p_pic->p_sys->p_ctx[V_PLANE] );
@@ -888,26 +868,26 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index )
                 p_pic->Y_PIXELS = p_pic->p_sys->p_buf[Y_PLANE];
                 p_pic->p[Y_PLANE].i_lines = p_pic->p_sys->p_ctx[Y_PLANE]->dim.h;
                 p_pic->p[Y_PLANE].i_pitch = p_pic->p_sys->p_ctx[Y_PLANE]->pitch;
-                p_pic->p[Y_PLANE].i_pixel_bytes = 1;
-                p_pic->p[Y_PLANE].b_margin = 0;
+                p_pic->p[Y_PLANE].i_pixel_pitch = 1;
+                p_pic->p[Y_PLANE].i_visible_pitch = p_pic->p[Y_PLANE].i_pitch;
 
                 p_pic->U_PIXELS = p_pic->p_sys->p_buf[U_PLANE];
                 p_pic->p[U_PLANE].i_lines = p_pic->p_sys->p_ctx[U_PLANE]->dim.h;
                 p_pic->p[U_PLANE].i_pitch = p_pic->p_sys->p_ctx[U_PLANE]->pitch;
-                p_pic->p[U_PLANE].i_pixel_bytes = 1;
-                p_pic->p[U_PLANE].b_margin = 0;
+                p_pic->p[U_PLANE].i_pixel_pitch = 1;
+                p_pic->p[U_PLANE].i_visible_pitch = p_pic->p[U_PLANE].i_pitch;
 
                 p_pic->V_PIXELS = p_pic->p_sys->p_buf[V_PLANE];
                 p_pic->p[V_PLANE].i_lines = p_pic->p_sys->p_ctx[V_PLANE]->dim.h;
                 p_pic->p[V_PLANE].i_pitch = p_pic->p_sys->p_ctx[V_PLANE]->pitch;
-                p_pic->p[V_PLANE].i_pixel_bytes = 1;
-                p_pic->p[V_PLANE].b_margin = 0;
+                p_pic->p[V_PLANE].i_pixel_pitch = 1;
+                p_pic->p[V_PLANE].i_visible_pitch = p_pic->p[V_PLANE].i_pitch;
 
                 p_pic->i_planes = 3;
                 break;
 
             case Pg_VIDEO_FORMAT_YV12:
-                p_vout->output.i_chroma = FOURCC_YV12;
+                p_vout->output.i_chroma = VLC_FOURCC('Y','V','1','2');
 
                 p_pic->p_sys->p_buf[U_PLANE] = PdGetOffscreenContextPtr( p_pic->p_sys->p_ctx[U_PLANE] );
                 p_pic->p_sys->p_buf[V_PLANE] = PdGetOffscreenContextPtr( p_pic->p_sys->p_ctx[V_PLANE] );
@@ -922,20 +902,20 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index )
                 p_pic->Y_PIXELS = p_pic->p_sys->p_buf[Y_PLANE];
                 p_pic->p[Y_PLANE].i_lines = p_pic->p_sys->p_ctx[Y_PLANE]->dim.h;
                 p_pic->p[Y_PLANE].i_pitch = p_pic->p_sys->p_ctx[Y_PLANE]->pitch;
-                p_pic->p[Y_PLANE].i_pixel_bytes = 1;
-                p_pic->p[Y_PLANE].b_margin = 0;
+                p_pic->p[Y_PLANE].i_pixel_pitch = 1;
+                p_pic->p[Y_PLANE].i_visible_pitch = p_pic->p[Y_PLANE].i_pitch;
 
                 p_pic->U_PIXELS = p_pic->p_sys->p_buf[U_PLANE];
                 p_pic->p[U_PLANE].i_lines = p_pic->p_sys->p_ctx[U_PLANE]->dim.h;
                 p_pic->p[U_PLANE].i_pitch = p_pic->p_sys->p_ctx[U_PLANE]->pitch;
-                p_pic->p[U_PLANE].i_pixel_bytes = 1;
-                p_pic->p[U_PLANE].b_margin = 0;
+                p_pic->p[U_PLANE].i_pixel_pitch = 1;
+                p_pic->p[U_PLANE].i_visible_pitch = p_pic->p[U_PLANE].i_pitch;
 
                 p_pic->V_PIXELS = p_pic->p_sys->p_buf[V_PLANE];
                 p_pic->p[V_PLANE].i_lines = p_pic->p_sys->p_ctx[V_PLANE]->dim.h;
                 p_pic->p[V_PLANE].i_pitch = p_pic->p_sys->p_ctx[V_PLANE]->pitch;
-                p_pic->p[V_PLANE].i_pixel_bytes = 1;
-                p_pic->p[V_PLANE].b_margin = 0;
+                p_pic->p[V_PLANE].i_pixel_pitch = 1;
+                p_pic->p[V_PLANE].i_visible_pitch = p_pic->p[V_PLANE].i_pitch;
 
                 p_pic->i_planes = 3;
                 break;
@@ -944,24 +924,24 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index )
             case Pg_VIDEO_FORMAT_YUY2:
                 if (p_vout->p_sys->i_vc_format == Pg_VIDEO_FORMAT_UYVY)
                 {
-                    p_vout->output.i_chroma = FOURCC_UYVY;
+                    p_vout->output.i_chroma = VLC_FOURCC('U','Y','V','Y');
                 }
                 else
                 {
-                    p_vout->output.i_chroma = FOURCC_YUY2;
+                    p_vout->output.i_chroma = VLC_FOURCC('Y','U','Y','2');
                 }
 
                 p_pic->p->p_pixels = p_pic->p_sys->p_buf[Y_PLANE];
                 p_pic->p->i_lines = p_pic->p_sys->p_ctx[Y_PLANE]->dim.h;
                 p_pic->p->i_pitch = p_pic->p_sys->p_ctx[Y_PLANE]->pitch;
-                p_pic->p->i_pixel_bytes = 4;
-                p_pic->p->b_margin = 0;
+                p_pic->p->i_pixel_pitch = 4;
+                p_pic->p->i_visible_pitch = p_pic->p->i_pitch;
 
                 p_pic->i_planes = 1;
                 break;
 
             case Pg_VIDEO_FORMAT_RGB555:
-                p_vout->output.i_chroma = FOURCC_RV15;
+                p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5');
                 p_vout->output.i_rmask = 0x001f;
                 p_vout->output.i_gmask = 0x03e0;
                 p_vout->output.i_bmask = 0x7c00;
@@ -969,24 +949,14 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index )
                 p_pic->p->p_pixels = p_pic->p_sys->p_buf[Y_PLANE];
                 p_pic->p->i_lines = p_pic->p_sys->p_ctx[Y_PLANE]->dim.h;
                 p_pic->p->i_pitch = p_pic->p_sys->p_ctx[Y_PLANE]->pitch;
-                p_pic->p->i_pixel_bytes = 2;
-
-                if( p_pic->p->i_pitch == 2 * p_pic->p_sys->p_ctx[Y_PLANE]->dim.w )
-                {
-                    p_pic->p->b_margin = 0;
-                }
-                else
-                {
-                    p_pic->p->b_margin = 1;
-                    p_pic->p->b_hidden = 1;
-                    p_pic->p->i_visible_bytes = 2 * p_pic->p_sys->p_ctx[Y_PLANE]->dim.w;
-                }
+                p_pic->p->i_pixel_pitch = 2;
+                p_pic->p->i_visible_pitch = 2 * p_pic->p_sys->p_ctx[Y_PLANE]->dim.w;
 
                 p_pic->i_planes = 1;
                 break;
 
             case Pg_VIDEO_FORMAT_RGB565:
-                p_vout->output.i_chroma = FOURCC_RV16;
+                p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6');
                 p_vout->output.i_rmask = 0x001f;
                 p_vout->output.i_gmask = 0x07e0;
                 p_vout->output.i_bmask = 0xf800;
@@ -994,24 +964,14 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index )
                 p_pic->p->p_pixels = p_pic->p_sys->p_buf[Y_PLANE];
                 p_pic->p->i_lines = p_pic->p_sys->p_ctx[Y_PLANE]->dim.h;
                 p_pic->p->i_pitch = p_pic->p_sys->p_ctx[Y_PLANE]->pitch;
-                p_pic->p->i_pixel_bytes = 4;
-
-                if( p_pic->p->i_pitch == 4 * p_pic->p_sys->p_ctx[Y_PLANE]->dim.w )
-                {
-                    p_pic->p->b_margin = 0;
-                }
-                else
-                {
-                    p_pic->p->b_margin = 1;
-                    p_pic->p->b_hidden = 1;
-                    p_pic->p->i_visible_bytes = 4 * p_pic->p_sys->p_ctx[Y_PLANE]->dim.w;
-                }
+                p_pic->p->i_pixel_pitch = 4;
+                p_pic->p->i_visible_pitch = 4 * p_pic->p_sys->p_ctx[Y_PLANE]->dim.w;
 
                 p_pic->i_planes = 1;
                 break;
 
             case Pg_VIDEO_FORMAT_RGB8888:
-                p_vout->output.i_chroma = FOURCC_RV32;
+                p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2');
                 p_vout->output.i_rmask = 0x000000ff;
                 p_vout->output.i_gmask = 0x0000ff00;
                 p_vout->output.i_bmask = 0x00ff0000;
@@ -1019,18 +979,8 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index )
                 p_pic->p->p_pixels = p_pic->p_sys->p_buf[Y_PLANE];
                 p_pic->p->i_lines = p_pic->p_sys->p_ctx[Y_PLANE]->dim.h;
                 p_pic->p->i_pitch = p_pic->p_sys->p_ctx[Y_PLANE]->pitch;
-                p_pic->p->i_pixel_bytes = 4;
-
-                if( p_pic->p->i_pitch == 4 * p_pic->p_sys->p_ctx[Y_PLANE]->dim.w )
-                {
-                    p_pic->p->b_margin = 0;
-                }
-                else
-                {
-                    p_pic->p->b_margin = 1;
-                    p_pic->p->b_hidden = 1;
-                    p_pic->p->i_visible_bytes = 4 * p_pic->p_sys->p_ctx[Y_PLANE]->dim.w;
-                }
+                p_pic->p->i_pixel_pitch = 4;
+                p_pic->p->i_visible_pitch = 4 * p_pic->p_sys->p_ctx[Y_PLANE]->dim.w;
 
                 p_pic->i_planes = 1;
                 break;
@@ -1040,15 +990,15 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic, int index )
     switch( p_vout->output.i_chroma )
     {
 #ifdef MODULE_NAME_IS_xvideo
-        case FOURCC_Y211:
+        case VLC_FOURCC('Y','2','1','1'):
 
             p_pic->p->p_pixels = p_pic->p_sys->p_image->data
                                   + p_pic->p_sys->p_image->offsets[0];
             p_pic->p->i_lines = p_vout->output.i_height;
             /* XXX: this just looks so plain wrong... check it out ! */
             p_pic->p->i_pitch = p_pic->p_sys->p_image->pitches[0] / 4;
-            p_pic->p->i_pixel_bytes = 4;
-            p_pic->p->b_margin = 0;
+            p_pic->p->i_pixel_pitch = 4;
+            p_pic->p->i_visible_pitch = p_pic->p->i_pitch;
 
             p_pic->i_planes = 1;
             break;
index 758aa19..62ed23f 100644 (file)
@@ -2,7 +2,7 @@
  * vout_sdl.c: SDL video output display method
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: vout_sdl.c,v 1.96 2002/07/20 18:01:43 sam Exp $
+ * $Id: vout_sdl.c,v 1.97 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Pierre Baillet <oct@zoy.org>
@@ -602,21 +602,21 @@ static int OpenDisplay( vout_thread_t *p_vout )
     /* Choose the chroma we will try first. */
     switch( p_vout->render.i_chroma )
     {
-        case FOURCC_YUY2:
-        case FOURCC_YUNV:
+        case VLC_FOURCC('Y','U','Y','2'):
+        case VLC_FOURCC('Y','U','N','V'):
             p_vout->output.i_chroma = SDL_YUY2_OVERLAY;
             break;
-        case FOURCC_UYVY:
-        case FOURCC_UYNV:
-        case FOURCC_Y422:
+        case VLC_FOURCC('U','Y','V','Y'):
+        case VLC_FOURCC('U','Y','N','V'):
+        case VLC_FOURCC('Y','4','2','2'):
             p_vout->output.i_chroma = SDL_UYVY_OVERLAY;
             break;
-        case FOURCC_YVYU:
+        case VLC_FOURCC('Y','V','Y','U'):
             p_vout->output.i_chroma = SDL_YVYU_OVERLAY;
             break;
-        case FOURCC_YV12:
-        case FOURCC_I420:
-        case FOURCC_IYUV:
+        case VLC_FOURCC('Y','V','1','2'):
+        case VLC_FOURCC('I','4','2','0'):
+        case VLC_FOURCC('I','Y','U','V'):
         default:
             p_vout->output.i_chroma = SDL_YV12_OVERLAY;
             break;
@@ -661,20 +661,20 @@ static int OpenDisplay( vout_thread_t *p_vout )
         switch( p_vout->p_sys->p_display->format->BitsPerPixel )
         {
             case 8:
-                p_vout->output.i_chroma = FOURCC_RGB2;
+                p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2');
                 p_vout->output.pf_setpalette = SetPalette;
                 break;
             case 15:
-                p_vout->output.i_chroma = FOURCC_RV15;
+                p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5');
                 break;
             case 16:
-                p_vout->output.i_chroma = FOURCC_RV16;
+                p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6');
                 break;
             case 24:
-                p_vout->output.i_chroma = FOURCC_RV24;
+                p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4');
                 break;
             case 32:
-                p_vout->output.i_chroma = FOURCC_RV32;
+                p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2');
                 break;
             default:
                 msg_Err( p_vout, "unknown screen depth %i",
@@ -752,15 +752,15 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
         switch( p_vout->p_sys->p_display->format->BitsPerPixel )
         {
             case 8:
-                p_pic->p->i_pixel_bytes = 1;
+                p_pic->p->i_pixel_pitch = 1;
                 break;
             case 15:
             case 16:
-                p_pic->p->i_pixel_bytes = 2;
+                p_pic->p->i_pixel_pitch = 2;
                 break;
             case 24:
             case 32:
-                p_pic->p->i_pixel_bytes = 4;
+                p_pic->p->i_pixel_pitch = 4;
                 break;
             default:
                 return( -1 );
@@ -769,19 +769,8 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
         p_pic->p->p_pixels = p_vout->p_sys->p_display->pixels;
         p_pic->p->i_lines = p_vout->p_sys->p_display->h;
         p_pic->p->i_pitch = p_vout->p_sys->p_display->pitch;
-
-        if( p_pic->p->i_pitch ==
-                p_pic->p->i_pixel_bytes * p_vout->p_sys->p_display->w )
-        {
-            p_pic->p->b_margin = 0;
-        }
-        else
-        {
-            p_pic->p->b_margin = 1;
-            p_pic->p->b_hidden = 1;
-            p_pic->p->i_visible_bytes =
-                p_pic->p->i_pixel_bytes * p_vout->p_sys->p_display->w;
-        }
+        p_pic->p->i_visible_pitch =
+            p_pic->p->i_pixel_pitch * p_vout->p_sys->p_display->w;
 
         p_vout->p_sys->i_surfaces++;
 
@@ -816,46 +805,46 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
         switch( p_vout->output.i_chroma )
         {
         case SDL_YV12_OVERLAY:
-            p_pic->p[Y_PLANE].i_pixel_bytes = 1;
-            p_pic->p[Y_PLANE].b_margin = 0;
+            p_pic->p[Y_PLANE].i_pixel_pitch = 1;
+            p_pic->p[Y_PLANE].i_visible_pitch = p_pic->p[Y_PLANE].i_pitch;
 
             p_pic->U_PIXELS = p_pic->p_sys->p_overlay->pixels[2];
             p_pic->p[U_PLANE].i_lines = p_pic->p_sys->p_overlay->h / 2;
             p_pic->p[U_PLANE].i_pitch = p_pic->p_sys->p_overlay->pitches[2];
-            p_pic->p[U_PLANE].i_pixel_bytes = 1;
-            p_pic->p[U_PLANE].b_margin = 0;
+            p_pic->p[U_PLANE].i_pixel_pitch = 1;
+            p_pic->p[U_PLANE].i_visible_pitch = p_pic->p[U_PLANE].i_pitch;
 
             p_pic->V_PIXELS = p_pic->p_sys->p_overlay->pixels[1];
             p_pic->p[V_PLANE].i_lines = p_pic->p_sys->p_overlay->h / 2;
             p_pic->p[V_PLANE].i_pitch = p_pic->p_sys->p_overlay->pitches[1];
-            p_pic->p[V_PLANE].i_pixel_bytes = 1;
-            p_pic->p[V_PLANE].b_margin = 0;
+            p_pic->p[V_PLANE].i_pixel_pitch = 1;
+            p_pic->p[V_PLANE].i_visible_pitch = p_pic->p[V_PLANE].i_pitch;
 
             p_pic->i_planes = 3;
             break;
 
         case SDL_IYUV_OVERLAY:
-            p_pic->p[Y_PLANE].i_pixel_bytes = 1;
-            p_pic->p[Y_PLANE].b_margin = 0;
+            p_pic->p[Y_PLANE].i_pixel_pitch = 1;
+            p_pic->p[Y_PLANE].i_visible_pitch = p_pic->p[Y_PLANE].i_pitch;
 
             p_pic->U_PIXELS = p_pic->p_sys->p_overlay->pixels[1];
             p_pic->p[U_PLANE].i_lines = p_pic->p_sys->p_overlay->h / 2;
             p_pic->p[U_PLANE].i_pitch = p_pic->p_sys->p_overlay->pitches[1];
-            p_pic->p[U_PLANE].i_pixel_bytes = 1;
-            p_pic->p[U_PLANE].b_margin = 0;
+            p_pic->p[U_PLANE].i_pixel_pitch = 1;
+            p_pic->p[U_PLANE].i_visible_pitch = p_pic->p[U_PLANE].i_pitch;
 
             p_pic->V_PIXELS = p_pic->p_sys->p_overlay->pixels[2];
             p_pic->p[V_PLANE].i_lines = p_pic->p_sys->p_overlay->h / 2;
             p_pic->p[V_PLANE].i_pitch = p_pic->p_sys->p_overlay->pitches[2];
-            p_pic->p[V_PLANE].i_pixel_bytes = 1;
-            p_pic->p[V_PLANE].b_margin = 0;
+            p_pic->p[V_PLANE].i_pixel_pitch = 1;
+            p_pic->p[V_PLANE].i_visible_pitch = p_pic->p[V_PLANE].i_pitch;
 
             p_pic->i_planes = 3;
             break;
 
         default:
-            p_pic->p[Y_PLANE].i_pixel_bytes = 2;
-            p_pic->p[Y_PLANE].b_margin = 0;
+            p_pic->p[Y_PLANE].i_pixel_pitch = 2;
+            p_pic->p[Y_PLANE].i_visible_pitch = p_pic->p[Y_PLANE].i_pitch;
 
             p_pic->i_planes = 1;
             break;
index ac68502..15d6b14 100644 (file)
@@ -2,7 +2,7 @@
  * spu_decoder.c : spu decoder thread
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: spu_decoder.c,v 1.29 2002/06/27 19:46:32 sam Exp $
+ * $Id: spu_decoder.c,v 1.30 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Rudolf Cornelissen <rag.cornelissen@inter.nl.net>
@@ -45,7 +45,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    ( spudec_thread_t * );
 static void EndThread     ( spudec_thread_t * );
@@ -90,9 +90,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 == DVD_SPU_ES ) ? 0 : -1;
+    return ( *pi_type == VLC_FOURCC('s','p','u',' ') ) ? 0 : -1;
 }
 
 /*****************************************************************************
@@ -862,9 +862,9 @@ static void RenderSPU( vout_thread_t *p_vout, picture_t *p_pic,
     switch( p_vout->output.i_chroma )
     {
     /* I420 target, no scaling */
-    case FOURCC_I420:
-    case FOURCC_IYUV:
-    case FOURCC_YV12:
+    case VLC_FOURCC('I','4','2','0'):
+    case VLC_FOURCC('I','Y','U','V'):
+    case VLC_FOURCC('Y','V','1','2'):
 
     p_dest = p_pic->Y_PIXELS + p_spu->i_x + p_spu->i_width
               + p_pic->Y_PITCH * ( p_spu->i_y + p_spu->i_height );
@@ -916,7 +916,7 @@ static void RenderSPU( vout_thread_t *p_vout, picture_t *p_pic,
     break;
 
     /* RV16 target, scaling */
-    case FOURCC_RV16:
+    case VLC_FOURCC('R','V','1','6'):
 
     /* XXX: this is a COMPLETE HACK, memcpy is unable to do u16s anyway */
     /* FIXME: get this from the DVD */
@@ -1030,8 +1030,8 @@ static void RenderSPU( vout_thread_t *p_vout, picture_t *p_pic,
     break;
 
     /* RV32 target, scaling */
-    case FOURCC_RV24:
-    case FOURCC_RV32:
+    case VLC_FOURCC('R','V','2','4'):
+    case VLC_FOURCC('R','V','3','2'):
 
     /* XXX: this is a COMPLETE HACK, memcpy is unable to do u32s anyway */
     /* FIXME: get this from the DVD */
@@ -1143,7 +1143,7 @@ static void RenderSPU( vout_thread_t *p_vout, picture_t *p_pic,
     break;
 
     /* NVidia overlay, no scaling */
-    case FOURCC_YUY2:
+    case VLC_FOURCC('Y','U','Y','2'):
 
     p_dest = p_pic->p->p_pixels +
               (p_spu->i_x + p_spu->i_width +
index 7973649..fee4365 100644 (file)
@@ -2,7 +2,7 @@
  * xcommon.c: Functions common to the X11 and XVideo plugins
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: xcommon.c,v 1.44 2002/07/20 18:01:43 sam Exp $
+ * $Id: xcommon.c,v 1.45 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -124,8 +124,8 @@ static void DestroyCursor  ( vout_thread_t * );
 static void ToggleCursor   ( vout_thread_t * );
 
 #ifdef MODULE_NAME_IS_xvideo
-static int  XVideoGetPort         ( vout_thread_t *, u32, u32 * );
-static void XVideoReleasePort     ( vout_thread_t *, int );
+static int  XVideoGetPort    ( vout_thread_t *, vlc_fourcc_t, vlc_fourcc_t * );
+static void XVideoReleasePort( vout_thread_t *, int );
 #endif
 
 #ifdef MODULE_NAME_IS_x11
@@ -268,11 +268,11 @@ void _M( vout_getfunctions )( function_list_t * p_function_list )
  *****************************************************************************/
 static int vout_Create( vout_thread_t *p_vout )
 {
-    char *     psz_display;
+    char *       psz_display;
 #ifdef MODULE_NAME_IS_xvideo
-    char *     psz_chroma;
-    u32        i_chroma = 0;
-    vlc_bool_t b_chroma = 0;
+    char *       psz_chroma;
+    vlc_fourcc_t i_chroma = 0;
+    vlc_bool_t   b_chroma = 0;
 #endif
 
     /* Allocate structure */
@@ -346,15 +346,17 @@ static int vout_Create( vout_thread_t *p_vout )
         /* It failed, but it's not completely lost ! We try to open an
          * XVideo port for an YUY2 picture. We'll need to do an YUV
          * conversion, but at least it has got scaling. */
-        p_vout->p_sys->i_xvport = XVideoGetPort( p_vout, FOURCC_YUY2,
-                                                 &p_vout->output.i_chroma );
+        p_vout->p_sys->i_xvport =
+                        XVideoGetPort( p_vout, VLC_FOURCC('Y','U','Y','2'),
+                                               &p_vout->output.i_chroma );
         if( p_vout->p_sys->i_xvport < 0 )
         {
             /* It failed, but it's not completely lost ! We try to open an
              * XVideo port for a simple 16bpp RGB picture. We'll need to do
              * an YUV conversion, but at least it has got scaling. */
-            p_vout->p_sys->i_xvport = XVideoGetPort( p_vout, FOURCC_RV16,
-                                                     &p_vout->output.i_chroma );
+            p_vout->p_sys->i_xvport =
+                            XVideoGetPort( p_vout, VLC_FOURCC('R','V','1','6'),
+                                                   &p_vout->output.i_chroma );
             if( p_vout->p_sys->i_xvport < 0 )
             {
                 XCloseDisplay( p_vout->p_sys->p_display );
@@ -468,12 +470,12 @@ static int vout_Init( vout_thread_t *p_vout )
 
     switch( p_vout->output.i_chroma )
     {
-        case FOURCC_RV15:
+        case VLC_FOURCC('R','V','1','5'):
             p_vout->output.i_rmask = 0x001f;
             p_vout->output.i_gmask = 0x07e0;
             p_vout->output.i_bmask = 0xf800;
             break;
-        case FOURCC_RV16:
+        case VLC_FOURCC('R','V','1','6'):
             p_vout->output.i_rmask = 0x001f;
             p_vout->output.i_gmask = 0x03e0;
             p_vout->output.i_bmask = 0x7c00;
@@ -486,15 +488,15 @@ static int vout_Init( vout_thread_t *p_vout )
     switch( p_vout->p_sys->i_screen_depth )
     {
         case 8: /* FIXME: set the palette */
-            p_vout->output.i_chroma = FOURCC_RGB2; break;
+            p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2'); break;
         case 15:
-            p_vout->output.i_chroma = FOURCC_RV15; break;
+            p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5'); break;
         case 16:
-            p_vout->output.i_chroma = FOURCC_RV16; break;
+            p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); break;
         case 24:
-            p_vout->output.i_chroma = FOURCC_RV24; break;
+            p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); break;
         case 32:
-            p_vout->output.i_chroma = FOURCC_RV24; break;
+            p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); break;
         default:
             msg_Err( p_vout, "unknown screen depth %i",
                      p_vout->p_sys->i_screen_depth );
@@ -1231,175 +1233,145 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
     switch( p_vout->output.i_chroma )
     {
 #ifdef MODULE_NAME_IS_xvideo
-        case FOURCC_I420:
+        case VLC_FOURCC('I','4','2','0'):
 
             p_pic->Y_PIXELS = p_pic->p_sys->p_image->data
                                + p_pic->p_sys->p_image->offsets[0];
             p_pic->p[Y_PLANE].i_lines = p_vout->output.i_height;
             p_pic->p[Y_PLANE].i_pitch = p_pic->p_sys->p_image->pitches[0];
-            p_pic->p[Y_PLANE].i_pixel_bytes = 1;
-            p_pic->p[Y_PLANE].b_margin = 0;
+            p_pic->p[Y_PLANE].i_pixel_pitch = 1;
+            p_pic->p[Y_PLANE].i_visible_pitch = p_pic->p[Y_PLANE].i_pitch;
 
             p_pic->U_PIXELS = p_pic->p_sys->p_image->data
                                + p_pic->p_sys->p_image->offsets[1];
             p_pic->p[U_PLANE].i_lines = p_vout->output.i_height / 2;
             p_pic->p[U_PLANE].i_pitch = p_pic->p_sys->p_image->pitches[1];
-            p_pic->p[U_PLANE].i_pixel_bytes = 1;
-            p_pic->p[U_PLANE].b_margin = 0;
+            p_pic->p[U_PLANE].i_pixel_pitch = 1;
+            p_pic->p[U_PLANE].i_visible_pitch = p_pic->p[U_PLANE].i_pitch;
 
             p_pic->V_PIXELS = p_pic->p_sys->p_image->data
                                + p_pic->p_sys->p_image->offsets[2];
             p_pic->p[V_PLANE].i_lines = p_vout->output.i_height / 2;
             p_pic->p[V_PLANE].i_pitch = p_pic->p_sys->p_image->pitches[2];
-            p_pic->p[V_PLANE].i_pixel_bytes = 1;
-            p_pic->p[V_PLANE].b_margin = 0;
+            p_pic->p[V_PLANE].i_pixel_pitch = 1;
+            p_pic->p[V_PLANE].i_visible_pitch = p_pic->p[V_PLANE].i_pitch;
 
             p_pic->i_planes = 3;
             break;
 
-        case FOURCC_YV12:
+        case VLC_FOURCC('Y','V','1','2'):
 
             p_pic->Y_PIXELS = p_pic->p_sys->p_image->data
                                + p_pic->p_sys->p_image->offsets[0];
             p_pic->p[Y_PLANE].i_lines = p_vout->output.i_height;
             p_pic->p[Y_PLANE].i_pitch = p_pic->p_sys->p_image->pitches[0];
-            p_pic->p[Y_PLANE].i_pixel_bytes = 1;
-            p_pic->p[Y_PLANE].b_margin = 0;
+            p_pic->p[Y_PLANE].i_pixel_pitch = 1;
+            p_pic->p[Y_PLANE].i_visible_pitch = p_pic->p[Y_PLANE].i_pitch;
 
             p_pic->U_PIXELS = p_pic->p_sys->p_image->data
                                + p_pic->p_sys->p_image->offsets[2];
             p_pic->p[U_PLANE].i_lines = p_vout->output.i_height / 2;
             p_pic->p[U_PLANE].i_pitch = p_pic->p_sys->p_image->pitches[2];
-            p_pic->p[U_PLANE].i_pixel_bytes = 1;
-            p_pic->p[U_PLANE].b_margin = 0;
+            p_pic->p[U_PLANE].i_pixel_pitch = 1;
+            p_pic->p[U_PLANE].i_visible_pitch = p_pic->p[U_PLANE].i_pitch;
 
             p_pic->V_PIXELS = p_pic->p_sys->p_image->data
                                + p_pic->p_sys->p_image->offsets[1];
             p_pic->p[V_PLANE].i_lines = p_vout->output.i_height / 2;
             p_pic->p[V_PLANE].i_pitch = p_pic->p_sys->p_image->pitches[1];
-            p_pic->p[V_PLANE].i_pixel_bytes = 1;
-            p_pic->p[V_PLANE].b_margin = 0;
+            p_pic->p[V_PLANE].i_pixel_pitch = 1;
+            p_pic->p[V_PLANE].i_visible_pitch = p_pic->p[V_PLANE].i_pitch;
 
             p_pic->i_planes = 3;
             break;
 
-        case FOURCC_Y211:
+        case VLC_FOURCC('Y','2','1','1'):
 
             p_pic->p->p_pixels = p_pic->p_sys->p_image->data
                                   + p_pic->p_sys->p_image->offsets[0];
             p_pic->p->i_lines = p_vout->output.i_height;
             /* XXX: this just looks so plain wrong... check it out ! */
             p_pic->p->i_pitch = p_pic->p_sys->p_image->pitches[0] / 4;
-            p_pic->p->i_pixel_bytes = 4;
-            p_pic->p->b_margin = 0;
+            p_pic->p->i_pixel_pitch = 4;
+            p_pic->p->i_visible_pitch = p_pic->p->i_pitch;
 
             p_pic->i_planes = 1;
             break;
 
-        case FOURCC_YUY2:
-        case FOURCC_UYVY:
+        case VLC_FOURCC('Y','U','Y','2'):
+        case VLC_FOURCC('U','Y','V','Y'):
 
             p_pic->p->p_pixels = p_pic->p_sys->p_image->data
                                   + p_pic->p_sys->p_image->offsets[0];
             p_pic->p->i_lines = p_vout->output.i_height;
             p_pic->p->i_pitch = p_pic->p_sys->p_image->pitches[0];
-            p_pic->p->i_pixel_bytes = 4;
-            p_pic->p->b_margin = 0;
+            p_pic->p->i_pixel_pitch = 4;
+            p_pic->p->i_visible_pitch = p_pic->p->i_pitch;
 
             p_pic->i_planes = 1;
             break;
 
-        case FOURCC_RV15:
+        case VLC_FOURCC('R','V','1','5'):
 
             p_pic->p->p_pixels = p_pic->p_sys->p_image->data
                                   + p_pic->p_sys->p_image->offsets[0];
             p_pic->p->i_lines = p_vout->output.i_height;
             p_pic->p->i_pitch = p_pic->p_sys->p_image->pitches[0];
-            p_pic->p->i_pixel_bytes = 2;
-            p_pic->p->b_margin = 0;
+            p_pic->p->i_pixel_pitch = 2;
+            p_pic->p->i_visible_pitch = p_pic->p->i_pitch;
 
             p_pic->i_planes = 1;
             break;
 
-        case FOURCC_RV16:
+        case VLC_FOURCC('R','V','1','6'):
 
             p_pic->p->p_pixels = p_pic->p_sys->p_image->data
                                   + p_pic->p_sys->p_image->offsets[0];
             p_pic->p->i_lines = p_vout->output.i_height;
             p_pic->p->i_pitch = p_pic->p_sys->p_image->pitches[0];
-            p_pic->p->i_pixel_bytes = 2;
-            p_pic->p->b_margin = 0;
+            p_pic->p->i_pixel_pitch = 2;
+            p_pic->p->i_visible_pitch = p_pic->p->i_pitch;
 
             p_pic->i_planes = 1;
             break;
 
 #else
-        case FOURCC_RGB2:
+        case VLC_FOURCC('R','G','B','2'):
 
             p_pic->p->p_pixels = p_pic->p_sys->p_image->data
                                   + p_pic->p_sys->p_image->xoffset;
             p_pic->p->i_lines = p_pic->p_sys->p_image->height;
             p_pic->p->i_pitch = p_pic->p_sys->p_image->bytes_per_line;
-            p_pic->p->i_pixel_bytes = p_pic->p_sys->p_image->depth;
-
-            if( p_pic->p->i_pitch == p_pic->p_sys->p_image->width )
-            {
-                p_pic->p->b_margin = 0;
-            }
-            else
-            {
-                p_pic->p->b_margin = 1;
-                p_pic->p->b_hidden = 1;
-                p_pic->p->i_visible_bytes = p_pic->p_sys->p_image->width;
-            }
+            p_pic->p->i_pixel_pitch = p_pic->p_sys->p_image->depth;
+            p_pic->p->i_visible_pitch = p_pic->p_sys->p_image->width;
 
             p_pic->i_planes = 1;
 
             break;
 
-        case FOURCC_RV16:
-        case FOURCC_RV15:
+        case VLC_FOURCC('R','V','1','6'):
+        case VLC_FOURCC('R','V','1','5'):
 
             p_pic->p->p_pixels = p_pic->p_sys->p_image->data
                                   + p_pic->p_sys->p_image->xoffset;
             p_pic->p->i_lines = p_pic->p_sys->p_image->height;
             p_pic->p->i_pitch = p_pic->p_sys->p_image->bytes_per_line;
-            p_pic->p->i_pixel_bytes = p_pic->p_sys->p_image->depth;
-
-            if( p_pic->p->i_pitch == 2 * p_pic->p_sys->p_image->width )
-            {
-                p_pic->p->b_margin = 0;
-            }
-            else
-            {
-                p_pic->p->b_margin = 1;
-                p_pic->p->b_hidden = 1;
-                p_pic->p->i_visible_bytes = 2 * p_pic->p_sys->p_image->width;
-            }
+            p_pic->p->i_pixel_pitch = p_pic->p_sys->p_image->depth;
+            p_pic->p->i_visible_pitch = 2 * p_pic->p_sys->p_image->width;
 
             p_pic->i_planes = 1;
 
             break;
 
-        case FOURCC_RV32:
-        case FOURCC_RV24:
+        case VLC_FOURCC('R','V','3','2'):
+        case VLC_FOURCC('R','V','2','4'):
 
             p_pic->p->p_pixels = p_pic->p_sys->p_image->data
                                   + p_pic->p_sys->p_image->xoffset;
             p_pic->p->i_lines = p_pic->p_sys->p_image->height;
             p_pic->p->i_pitch = p_pic->p_sys->p_image->bytes_per_line;
-            p_pic->p->i_pixel_bytes = p_pic->p_sys->p_image->depth;
-
-            if( p_pic->p->i_pitch == 4 * p_pic->p_sys->p_image->width )
-            {
-                p_pic->p->b_margin = 0;
-            }
-            else
-            {
-                p_pic->p->b_margin = 1;
-                p_pic->p->b_hidden = 1;
-                p_pic->p->i_visible_bytes = 4 * p_pic->p_sys->p_image->width;
-            }
+            p_pic->p->i_pixel_pitch = p_pic->p_sys->p_image->depth;
+            p_pic->p->i_visible_pitch = 4 * p_pic->p_sys->p_image->width;
 
             p_pic->i_planes = 1;
 
@@ -1679,7 +1651,7 @@ static void ToggleCursor( vout_thread_t *p_vout )
  * XVideoGetPort: get YUV12 port
  *****************************************************************************/
 static int XVideoGetPort( vout_thread_t *p_vout,
-                          u32 i_chroma, u32 *pi_newchroma )
+                          vlc_fourcc_t i_chroma, vlc_fourcc_t *pi_newchroma )
 {
     XvAdaptorInfo *p_adaptor;
     unsigned int i;
index f9a37f9..8b601dc 100644 (file)
@@ -2,7 +2,7 @@
  * input_dec.c: Functions for the management of decoders
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: input_dec.c,v 1.39 2002/06/08 14:08:46 sam Exp $
+ * $Id: input_dec.c,v 1.40 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -45,25 +45,16 @@ static void             DeleteDecoderFifo( decoder_fifo_t * );
 decoder_fifo_t * input_RunDecoder( input_thread_t * p_input,
                                    es_descriptor_t * p_es )
 {
-    char * psz_plugin = NULL;
-
-    if( p_es->i_type == MPEG1_AUDIO_ES || p_es->i_type == MPEG2_AUDIO_ES )
-    {
-        psz_plugin = config_GetPsz( p_input, "mpeg-adec" );
-    }
-    if( p_es->i_type == AC3_AUDIO_ES )
-    {
-        psz_plugin = config_GetPsz( p_input, "ac3-adec" );
-    }
+    char * psz_plugin = config_GetPsz( p_input, "codec" );
 
     /* Get a suitable module */
     p_es->p_module = module_Need( p_input, MODULE_CAPABILITY_DECODER,
-                                  psz_plugin, (void *)&p_es->i_type );
+                                  psz_plugin, (void *)&p_es->i_fourcc );
     if( psz_plugin ) free( psz_plugin );
     if( p_es->p_module == NULL )
     {
-        msg_Err( p_input, "no suitable decoder module for type 0x%x",
-                          p_es->i_type );
+        msg_Err( p_input, "no suitable decoder module for fourcc `%4.4s'",
+                          (char*)&p_es->i_fourcc );
         return NULL;
     }
 
@@ -185,7 +176,7 @@ void input_EscapeAudioDiscontinuity( input_thread_t * p_input )
     {
         es_descriptor_t * p_es = p_input->stream.pp_selected_es[i_es];
 
-        if( p_es->p_decoder_fifo != NULL && p_es->b_audio )
+        if( p_es->p_decoder_fifo != NULL && p_es->i_cat == AUDIO_ES )
         {
             for( i = 0; i < PADDING_PACKET_NUMBER; i++ )
             {
@@ -233,7 +224,7 @@ static decoder_fifo_t * CreateDecoderFifo( input_thread_t * p_input,
     p_es->p_decoder_fifo = p_fifo;
 
     p_fifo->i_id = p_es->i_id;
-    p_fifo->i_type = p_es->i_type;
+    p_fifo->i_fourcc = p_es->i_fourcc;
     p_fifo->p_demux_data = p_es->p_demux_data;
     
     p_fifo->p_stream_ctrl = &p_input->stream.control;
@@ -256,8 +247,8 @@ static void DeleteDecoderFifo( decoder_fifo_t * p_fifo )
 {
     vlc_object_detach_all( p_fifo );
 
-    msg_Dbg( p_fifo, "killing decoder for 0x%x, type 0x%x, %d PES in FIFO",
-                     p_fifo->i_id, p_fifo->i_type, p_fifo->i_depth );
+    msg_Dbg( p_fifo, "killing decoder for 0x%x, fourcc `%4.4s', %d PES in FIFO",
+                     p_fifo->i_id, (char*)&p_fifo->i_fourcc, p_fifo->i_depth );
 
     /* Free all packets still in the decoder fifo. */
     input_DeletePES( p_fifo->p_packets_mgt,
index 56e10d8..d820a4a 100644 (file)
@@ -2,7 +2,7 @@
  * input_ext-intf.c: services to the interface
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: input_ext-intf.c,v 1.38 2002/06/04 00:11:12 sam Exp $
+ * $Id: input_ext-intf.c,v 1.39 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -301,8 +301,8 @@ void input_DumpStream( input_thread_t * p_input )
         {
 #define ES  p_input->stream.pp_programs[i]->pp_es[j]
             msg_Dbg( p_input,
-                     "ES 0x%x, stream 0x%x, type 0x%x, %s [OK:%d/ERR:%d]",
-                     ES->i_id, ES->i_stream_id, ES->i_type,
+                     "ES 0x%x, stream 0x%x, fourcc `%4.4s', %s [OK:%d/ERR:%d]",
+                     ES->i_id, ES->i_stream_id, (char*)&ES->i_fourcc,
                      ES->p_decoder_fifo != NULL ? "selected" : "not selected",
                      ES->c_packets, ES->c_invalid_packets );
 #undef ES
@@ -310,73 +310,6 @@ void input_DumpStream( input_thread_t * p_input )
     }
 }
 
-/*****************************************************************************
- * input_ChangeES: answers to a user request with calls to (Un)SelectES
- *****************************************************************************
- * Useful since the interface plugins know p_es
- * This functon is deprecated, use input_ToggleEs instead.
- *****************************************************************************/
-int input_ChangeES( input_thread_t * p_input, es_descriptor_t * p_es,
-                    u8 i_cat )
-{
-    int                     i_index;
-    int                     i;
-
-    i_index = -1;
-
-    vlc_mutex_lock( &p_input->stream.stream_lock );
-
-    for( i = 0 ; i < p_input->stream.i_selected_es_number ; i++ )
-    {
-        if( p_input->stream.pp_selected_es[i]->i_cat == i_cat )
-        {
-            i_index = i;
-            break;
-        }
-    }
-
-
-    if( p_es != NULL )
-    {
-
-    
-        if( i_index != -1 )
-        {
-            
-            if( p_input->stream.pp_selected_es[i_index] != p_es )
-            {
-                input_UnselectES( p_input,
-                                  p_input->stream.pp_selected_es[i_index] );
-                input_SelectES( p_input, p_es );
-                msg_Dbg( p_input, "es selected -> %s (0x%x)",
-                                  p_es->psz_desc, p_es->i_id );
-            }
-        }
-        else
-        {
-            input_SelectES( p_input, p_es );
-            msg_Dbg( p_input, "es selected -> %s (0x%x)",
-                              p_es->psz_desc, p_es->i_id );
-        }
-    }
-    else
-    {
-        if( i_index != -1 )
-        {
-            msg_Dbg( p_input, "es unselected -> %s (0x%x)",
-                     p_input->stream.pp_selected_es[i_index]->psz_desc,
-                     p_input->stream.pp_selected_es[i_index]->i_id );
-
-            input_UnselectES( p_input,
-                              p_input->stream.pp_selected_es[i_index] );
-        }
-    }
-
-    vlc_mutex_unlock( &p_input->stream.stream_lock );
-
-    return 0;
-}
-
 /*****************************************************************************
  * input_ToggleES: answers to a user request with calls to (Un)SelectES
  *****************************************************************************
index 65b32ed..4fe43ca 100644 (file)
@@ -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.92 2002/07/21 15:18:29 fenrir Exp $
+ * $Id: input_programs.c,v 1.93 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -352,7 +352,7 @@ int input_SetProgram( input_thread_t * p_input, pgrm_descriptor_t * p_new_prg )
         i_required_spu_es = 0;
     }
 
-    for (i_es_index = 0 ; i_es_index < p_new_prg->i_es_number ; i_es_index ++ )
+    fori_es_index = 0 ; i_es_index < p_new_prg->i_es_number ; i_es_index ++ )
     {
         switch( p_new_prg->pp_es[i_es_index]->i_cat )
         {
@@ -500,7 +500,6 @@ es_descriptor_t * input_AddES( input_thread_t * p_input,
     p_es->psz_desc[0] = '\0';
     p_es->p_pes = NULL;
     p_es->p_decoder_fifo = NULL;
-    p_es->b_audio = 0;
     p_es->i_cat = UNKNOWN_ES;
     p_es->i_demux_fd = 0;
     p_es->c_packets = 0;
@@ -652,6 +651,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 )
 {
+    decoder_fifo_t *p_fifo;
+
     if( p_es == NULL )
     {
         msg_Err( p_input, "nothing to do in input_SelectES" );
@@ -663,60 +664,23 @@ int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es )
     if( p_es->p_decoder_fifo != NULL )
     {
         msg_Err( p_input, "ES 0x%x is already selected", p_es->i_id );
-        return( -1 );
+        return -1;
     }
 
-    p_es->p_decoder_fifo = NULL;
+    /* Release the lock, not to block the input thread during
+     * the creation of the thread. */
+    vlc_mutex_unlock( &p_input->stream.stream_lock );
+    p_fifo = input_RunDecoder( p_input, p_es );
+    vlc_mutex_lock( &p_input->stream.stream_lock );
 
-    switch( p_es->i_type )
+    if( p_fifo == NULL )
     {
-    case AC3_AUDIO_ES:
-    case MPEG1_AUDIO_ES:
-    case MPEG2_AUDIO_ES:
-    case LPCM_AUDIO_ES:
-        if( config_GetInt( p_input, "audio" ) )
-        {
-            /* Release the lock, not to block the input thread during
-             * the creation of the thread. */
-            vlc_mutex_unlock( &p_input->stream.stream_lock );
-            p_es->p_decoder_fifo = input_RunDecoder( p_input, p_es );
-            vlc_mutex_lock( &p_input->stream.stream_lock );
-        }
-        break;
-
-    case MPEG1_VIDEO_ES:
-    case MPEG2_VIDEO_ES:
-    case MPEG4_VIDEO_ES:
-    case MSMPEG4v1_VIDEO_ES:
-    case MSMPEG4v2_VIDEO_ES:
-    case MSMPEG4v3_VIDEO_ES:
-    case SVQ1_VIDEO_ES:
-    case H263_VIDEO_ES:
-    case I263_VIDEO_ES:
-    case CINEPAK_VIDEO_ES:
-    case DVD_SPU_ES:
-        if( config_GetInt( p_input, "video" ) )
-        {
-            /* Release the lock, not to block the input thread during
-             * the creation of the thread. */
-            vlc_mutex_unlock( &p_input->stream.stream_lock );
-            p_es->p_decoder_fifo = input_RunDecoder( p_input, p_es );
-            vlc_mutex_lock( &p_input->stream.stream_lock );
-        }
-        break;
-
-    default:
-        msg_Err( p_input, "unknown stream type 0x%x", p_es->i_type );
-        return( -1 );
-        break;
+        return -1;
     }
 
-    if( p_es->p_decoder_fifo == NULL )
-    {
-        return( -1 );
-    }
+    p_es->p_decoder_fifo = p_fifo;
 
-    return( 0 );
+    return 0;
 }
 
 /*****************************************************************************
index 40ac5ab..329b84e 100644 (file)
@@ -2,7 +2,7 @@
  * mpeg_system.c: TS, PS and PES management
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: mpeg_system.c,v 1.99 2002/06/02 11:59:46 sam Exp $
+ * $Id: mpeg_system.c,v 1.100 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Michel Lespinasse <walken@via.ecp.fr>
@@ -337,7 +337,7 @@ void input_ParsePES( input_thread_t * p_input, es_descriptor_t * p_es )
             i_pes_header_size++;
         }
 
-        if( p_es->i_type == AC3_AUDIO_ES )
+        if( p_es->i_fourcc == VLC_FOURCC('a','5','2',' ') )
         {
             /* With ac3 audio, we need to skip first 3 bytes */
             i_pes_header_size += 3;
@@ -573,12 +573,15 @@ static void DecodePSM( input_thread_t * p_input, data_packet_t * p_data )
                     == i_stream_id )
             {
                 p_es = p_input->stream.pp_programs[0]->pp_es[i];
+                /* FIXME: do something below */
+#if 0
                 if( p_es->i_type != p_byte[0] )
                 {
                     input_DelES( p_input, p_es );
                     p_es = NULL;
                 }
                 else
+#endif
                 {
                     /* Move the ES to the beginning. */
                     p_input->stream.pp_programs[0]->pp_es[i]
@@ -598,12 +601,34 @@ static void DecodePSM( input_thread_t * p_input, data_packet_t * p_data )
         {
             p_es = input_AddES( p_input, p_input->stream.pp_programs[0],
                                 i_stream_id, 0 );
-            p_es->i_type = p_byte[0];
-            p_es->b_audio = ( p_es->i_type == MPEG1_AUDIO_ES
-                              || p_es->i_type == MPEG2_AUDIO_ES
-                              || p_es->i_type == AC3_AUDIO_ES
-                              || p_es->i_type == LPCM_AUDIO_ES
-                            );
+            switch( p_byte[0] )
+            {
+            case MPEG1_VIDEO_ES:
+            case MPEG2_VIDEO_ES:
+                p_es->i_fourcc = VLC_FOURCC('m','p','g','v');
+                p_es->i_cat = VIDEO_ES;
+                break;
+            case DVD_SPU_ES:
+                p_es->i_fourcc = VLC_FOURCC('s','p','u',' ');
+                p_es->i_cat = SPU_ES;
+                break;
+            case MPEG1_AUDIO_ES:
+            case MPEG2_AUDIO_ES:
+                p_es->i_fourcc = VLC_FOURCC('m','p','g','a');
+                p_es->i_cat = AUDIO_ES;
+                break;
+            case AC3_AUDIO_ES:
+                p_es->i_fourcc = VLC_FOURCC('a','5','2',' ');
+                p_es->i_cat = AUDIO_ES;
+                break;
+            case LPCM_AUDIO_ES:
+                p_es->i_fourcc = VLC_FOURCC('l','p','c','m');
+                p_es->i_cat = AUDIO_ES;
+                break;
+            default:
+                p_es->i_fourcc = 0;
+                break;
+            }
 
             /* input_AddES has inserted the new element at the end. */
             p_input->stream.pp_programs[0]->pp_es[
@@ -789,7 +814,7 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input,
                     if( (i_id & 0xF0) == 0xE0 )
                     {
                         /* MPEG video */
-                        p_es->i_type = MPEG2_VIDEO_ES;
+                        p_es->i_fourcc = VLC_FOURCC('m','p','g','v');
                         p_es->i_cat = VIDEO_ES;
 #ifdef AUTO_SPAWN
                         if( !p_input->stream.b_seekable )
@@ -799,8 +824,7 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input,
                     else if( (i_id & 0xE0) == 0xC0 )
                     {
                         /* MPEG audio */
-                        p_es->i_type = MPEG2_AUDIO_ES;
-                        p_es->b_audio = 1;
+                        p_es->i_fourcc = VLC_FOURCC('m','p','g','a');
                         p_es->i_cat = AUDIO_ES;
 #ifdef AUTO_SPAWN
                         if( !p_input->stream.b_seekable )
@@ -819,8 +843,7 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input,
                     else if( (i_id & 0xF0FF) == 0x80BD )
                     {
                         /* AC3 audio (0x80->0x8F) */
-                        p_es->i_type = AC3_AUDIO_ES;
-                        p_es->b_audio = 1;
+                        p_es->i_fourcc = VLC_FOURCC('a','5','2',' ');
                         p_es->i_cat = AUDIO_ES;
 #ifdef AUTO_SPAWN
                         if( !p_input->stream.b_seekable )
@@ -839,7 +862,7 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input,
                     else if( (i_id & 0xE0FF) == 0x20BD )
                     {
                         /* Subtitles video (0x20->0x3F) */
-                        p_es->i_type = DVD_SPU_ES;
+                        p_es->i_fourcc = VLC_FOURCC('s','p','u',' ');
                         p_es->i_cat = SPU_ES;
 #ifdef AUTO_SPAWN
                         if( config_GetInt( p_input, "spu-channel" )
@@ -853,13 +876,12 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input,
                     else if( (i_id & 0xF0FF) == 0xA0BD )
                     {
                         /* LPCM audio (0xA0->0xAF) */
-                        p_es->i_type = LPCM_AUDIO_ES;
-                        p_es->b_audio = 1;
+                        p_es->i_fourcc = VLC_FOURCC('l','p','c','m');
                         p_es->i_cat = AUDIO_ES;
                     }
                     else
                     {
-                        p_es->i_type = UNKNOWN_ES;
+                        p_es->i_fourcc = 0;
                     }
                 }
 
@@ -994,7 +1016,7 @@ void input_DemuxPS( input_thread_t * p_input, data_packet_t * p_data )
 
         vlc_mutex_lock( &p_input->stream.control.control_lock );
         if( p_es != NULL && p_es->p_decoder_fifo != NULL
-             && (!p_es->b_audio || !p_input->stream.control.b_mute) )
+             && (p_es->i_cat != AUDIO_ES || !p_input->stream.control.b_mute) )
         {
             vlc_mutex_unlock( &p_input->stream.control.control_lock );
             p_es->c_packets++;
@@ -1133,7 +1155,8 @@ void input_DemuxTS( input_thread_t * p_input, data_packet_t * p_data,
     }
 
     vlc_mutex_lock( &p_input->stream.control.control_lock );
-    if( ( p_es == NULL ) || (p_es->b_audio && p_input->stream.control.b_mute) )
+    if( ( p_es == NULL ) || (p_es->i_cat == AUDIO_ES
+                              && p_input->stream.control.b_mute) )
     {
         /* Not selected. Just read the adaptation field for a PCR. */
         b_trash = 1;
index 4470e36..d9aa7e7 100644 (file)
@@ -2,7 +2,7 @@
  * libvlc.h: main libvlc header
  *****************************************************************************
  * Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.h,v 1.6 2002/07/19 21:14:13 massiot Exp $
+ * $Id: libvlc.h,v 1.7 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
     "If you check this box, IPv4 will be used by default for all UDP and " \
     "HTTP connections.")
 
-#define ADEC_MPEG_TEXT N_("choose MPEG audio decoder")
-#define ADEC_MPEG_LONGTEXT N_( \
-    "This allows you to select the MPEG audio decoder you want to use. " \
-    "Common choices are builtin and mad.")
-
-#define ADEC_AC3_TEXT N_("choose AC3 audio decoder")
-#define ADEC_AC3_LONGTEXT N_( \
-    "This allows you to select the AC3/A52 audio decoder you want to use. " \
-    "Common choices are builtin and a52.")
+#define CODEC_TEXT N_("choose preferred codec list")
+#define CODEC_LONGTEXT N_( \
+    "This allows you to select the order in which vlc will choose its " \
+    "codecs. For instance, 'a52,ac3,any' will try the a52 codec before " \
+    "the ac3 one. Please be aware that vlc does not make any difference " \
+    "between audio or video codecs, so you should always specify 'any' at " \
+    "the end of the list to make sure there is a fallback for all types.")
 
 #define MMX_TEXT N_("enable CPU MMX support")
 #define MMX_LONGTEXT N_( \
@@ -375,8 +373,7 @@ ADD_BOOL_WITH_SHORT ( "ipv4", '4', 0, NULL, IPV4_TEXT, IPV4_LONGTEXT )
 
 /* Decoder options */
 ADD_CATEGORY_HINT( N_("Decoders"), NULL )
-ADD_MODULE  ( "mpeg-adec", MODULE_CAPABILITY_DECODER, NULL, NULL, ADEC_MPEG_TEXT, ADEC_MPEG_LONGTEXT )
-ADD_MODULE  ( "ac3-adec", MODULE_CAPABILITY_DECODER, NULL, NULL, ADEC_AC3_TEXT, ADEC_AC3_LONGTEXT )
+ADD_MODULE  ( "codec", MODULE_CAPABILITY_DECODER, NULL, NULL, CODEC_TEXT, CODEC_LONGTEXT )
 
 /* CPU options */
 ADD_CATEGORY_HINT( N_("CPU"), NULL )
index 138e092..b5b3b31 100644 (file)
@@ -2,7 +2,7 @@
  * modules.c : Builtin and plugin modules management functions
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: modules.c,v 1.73 2002/07/22 22:19:49 sam Exp $
+ * $Id: modules.c,v 1.74 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Ethan C. Baldridge <BaldridgeE@cadmus.com>
@@ -479,7 +479,7 @@ module_t * __module_Need( vlc_object_t *p_this, int i_capability,
 
             case MODULE_CAPABILITY_DECODER:
                 i_ret = p_tmp->p_module->p_functions->dec.functions.
-                              dec.pf_probe( (u8 *)p_data );
+                              dec.pf_probe( (vlc_fourcc_t *)p_data );
                 break;
 
             case MODULE_CAPABILITY_INTF:
index 0a0f320..6f3bbe3 100644 (file)
@@ -208,7 +208,6 @@ static inline const char * module_error( char *psz_buffer )
     (p_symbols)->__input_Tell_inner = __input_Tell; \
     (p_symbols)->input_DumpStream_inner = input_DumpStream; \
     (p_symbols)->input_OffsetToTime_inner = input_OffsetToTime; \
-    (p_symbols)->input_ChangeES_inner = input_ChangeES; \
     (p_symbols)->input_ToggleES_inner = input_ToggleES; \
     (p_symbols)->input_ChangeArea_inner = input_ChangeArea; \
     (p_symbols)->input_ChangeProgram_inner = input_ChangeProgram; \
index 5b7f351..b2197ec 100644 (file)
@@ -5,7 +5,7 @@
  * thread, and destroy a previously oppened video output thread.
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: video_output.c,v 1.186 2002/07/02 22:07:02 jlj Exp $
+ * $Id: video_output.c,v 1.187 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
@@ -67,7 +67,7 @@ static void     InitWindowSize    ( vout_thread_t *, int *, int * );
  *****************************************************************************/
 vout_thread_t * __vout_CreateThread ( vlc_object_t *p_parent,
                                       int i_width, int i_height,
-                                      u32 i_chroma, int i_aspect )
+                                      vlc_fourcc_t i_chroma, int i_aspect )
 {
     vout_thread_t * p_vout;                             /* thread descriptor */
     int             i_index;                                /* loop variable */
@@ -246,68 +246,6 @@ void vout_DestroyThread( vout_thread_t *p_vout )
     vlc_object_destroy( p_vout );
 }
 
-/*****************************************************************************
- * vout_ChromaCmp: compare two chroma values
- *****************************************************************************
- * This function returns 1 if the two fourcc values given as argument are
- * the same format (eg. UYVY / UYNV) or almost the same format (eg. I420/YV12)
- *****************************************************************************/
-int vout_ChromaCmp( u32 i_chroma, u32 i_amorhc )
-{
-    /* If they are the same, they are the same ! */
-    if( i_chroma == i_amorhc )
-    {
-        return 1;
-    }
-
-    /* Check for equivalence classes */
-    switch( i_chroma )
-    {
-        case FOURCC_I420:
-        case FOURCC_IYUV:
-        case FOURCC_YV12:
-            switch( i_amorhc )
-            {
-                case FOURCC_I420:
-                case FOURCC_IYUV:
-                case FOURCC_YV12:
-                    return 1;
-
-                default:
-                    return 0;
-            }
-
-        case FOURCC_UYVY:
-        case FOURCC_UYNV:
-        case FOURCC_Y422:
-            switch( i_amorhc )
-            {
-                case FOURCC_UYVY:
-                case FOURCC_UYNV:
-                case FOURCC_Y422:
-                    return 1;
-
-                default:
-                    return 0;
-            }
-
-        case FOURCC_YUY2:
-        case FOURCC_YUNV:
-            switch( i_amorhc )
-            {
-                case FOURCC_YUY2:
-                case FOURCC_YUNV:
-                    return 1;
-
-                default:
-                    return 0;
-            }
-
-        default:
-            return 0;
-    }
-}
-
 /*****************************************************************************
  * InitThread: initialize video output thread
  *****************************************************************************
index 852214c..aba7ae9 100644 (file)
@@ -2,7 +2,7 @@
  * vout_pictures.c : picture management functions
  *****************************************************************************
  * Copyright (C) 2000 VideoLAN
- * $Id: vout_pictures.c,v 1.27 2002/06/01 12:32:02 sam Exp $
+ * $Id: vout_pictures.c,v 1.28 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
 #include "video.h"
 #include "video_output.h"
 
+#include "vout_pictures.h"
+
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-static void vout_CopyPicture( vout_thread_t *, picture_t *, picture_t * );
+static void CopyPicture( vout_thread_t *, picture_t *, picture_t * );
 
 /*****************************************************************************
  * vout_DisplayPicture: display a picture
@@ -305,7 +307,7 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
                 /* We have subtitles. First copy the picture to
                  * the spare direct buffer, then render the
                  * subtitles. */
-                vout_CopyPicture( p_vout, p_pic, PP_OUTPUTPICTURE[0] );
+                CopyPicture( p_vout, p_pic, PP_OUTPUTPICTURE[0] );
 
                 vout_RenderSubPictures( p_vout, PP_OUTPUTPICTURE[0], p_subpic );
 
@@ -333,7 +335,7 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
         /* Picture is not in a direct buffer, but is exactly the
          * same size as the direct buffers. A memcpy() is enough,
          * then render the subtitles. */
-        vout_CopyPicture( p_vout, p_pic, PP_OUTPUTPICTURE[0] );
+        CopyPicture( p_vout, p_pic, PP_OUTPUTPICTURE[0] );
 
         vout_RenderSubPictures( p_vout, PP_OUTPUTPICTURE[0], p_subpic );
 
@@ -414,7 +416,7 @@ void vout_PlacePicture( vout_thread_t *p_vout, int i_width, int i_height,
  * how it gets displayed.
  *****************************************************************************/
 void vout_AllocatePicture( vout_thread_t *p_vout, picture_t *p_pic,
-                           int i_width, int i_height, u32 i_chroma )
+                           int i_width, int i_height, vlc_fourcc_t i_chroma )
 {
     int i_bytes, i_index;
 
@@ -422,75 +424,87 @@ void vout_AllocatePicture( vout_thread_t *p_vout, picture_t *p_pic,
     for( i_index = 0; i_index < VOUT_MAX_PLANES; i_index++ )
     {
         p_pic->p[i_index].p_pixels = NULL;
-        p_pic->p[i_index].b_margin = 0;
-        p_pic->p[i_index].i_pixel_bytes = 1;
+        p_pic->p[i_index].i_pixel_pitch = 1;
     }
 
     /* Calculate coordinates */
     switch( i_chroma )
     {
+        case FOURCC_I410:
+            p_pic->p[ Y_PLANE ].i_lines = i_height;
+            p_pic->p[ Y_PLANE ].i_pitch = i_width;
+            p_pic->p[ Y_PLANE ].i_visible_pitch = p_pic->p[ Y_PLANE ].i_pitch;
+            p_pic->p[ U_PLANE ].i_lines = i_height / 4;
+            p_pic->p[ U_PLANE ].i_pitch = i_width / 4;
+            p_pic->p[ U_PLANE ].i_visible_pitch = p_pic->p[ U_PLANE ].i_pitch;
+            p_pic->p[ V_PLANE ].i_lines = i_height / 4;
+            p_pic->p[ V_PLANE ].i_pitch = i_width / 4;
+            p_pic->p[ V_PLANE ].i_visible_pitch = p_pic->p[ V_PLANE ].i_pitch;
+            p_pic->i_planes = 3;
+            break;
+
         case FOURCC_YV12:
         case FOURCC_I420:
         case FOURCC_IYUV:
             p_pic->p[ Y_PLANE ].i_lines = i_height;
             p_pic->p[ Y_PLANE ].i_pitch = i_width;
-            p_pic->p[ Y_PLANE ].i_visible_bytes = p_pic->p[ Y_PLANE ].i_pitch;
+            p_pic->p[ Y_PLANE ].i_visible_pitch = p_pic->p[ Y_PLANE ].i_pitch;
             p_pic->p[ U_PLANE ].i_lines = i_height / 2;
             p_pic->p[ U_PLANE ].i_pitch = i_width / 2;
-            p_pic->p[ U_PLANE ].i_visible_bytes = p_pic->p[ U_PLANE ].i_pitch;
+            p_pic->p[ U_PLANE ].i_visible_pitch = p_pic->p[ U_PLANE ].i_pitch;
             p_pic->p[ V_PLANE ].i_lines = i_height / 2;
             p_pic->p[ V_PLANE ].i_pitch = i_width / 2;
-            p_pic->p[ V_PLANE ].i_visible_bytes = p_pic->p[ V_PLANE ].i_pitch;
+            p_pic->p[ V_PLANE ].i_visible_pitch = p_pic->p[ V_PLANE ].i_pitch;
             p_pic->i_planes = 3;
             break;
 
         case FOURCC_I422:
             p_pic->p[ Y_PLANE ].i_lines = i_height;
             p_pic->p[ Y_PLANE ].i_pitch = i_width;
-            p_pic->p[ Y_PLANE ].i_visible_bytes = p_pic->p[ Y_PLANE ].i_pitch;
+            p_pic->p[ Y_PLANE ].i_visible_pitch = p_pic->p[ Y_PLANE ].i_pitch;
             p_pic->p[ U_PLANE ].i_lines = i_height;
             p_pic->p[ U_PLANE ].i_pitch = i_width / 2;
-            p_pic->p[ U_PLANE ].i_visible_bytes = p_pic->p[ U_PLANE ].i_pitch;
+            p_pic->p[ U_PLANE ].i_visible_pitch = p_pic->p[ U_PLANE ].i_pitch;
             p_pic->p[ V_PLANE ].i_lines = i_height;
             p_pic->p[ V_PLANE ].i_pitch = i_width / 2;
-            p_pic->p[ V_PLANE ].i_visible_bytes = p_pic->p[ V_PLANE ].i_pitch;
+            p_pic->p[ V_PLANE ].i_visible_pitch = p_pic->p[ V_PLANE ].i_pitch;
             p_pic->i_planes = 3;
             break;
 
         case FOURCC_I444:
             p_pic->p[ Y_PLANE ].i_lines = i_height;
             p_pic->p[ Y_PLANE ].i_pitch = i_width;
-            p_pic->p[ Y_PLANE ].i_visible_bytes = p_pic->p[ Y_PLANE ].i_pitch;
+            p_pic->p[ Y_PLANE ].i_visible_pitch = p_pic->p[ Y_PLANE ].i_pitch;
             p_pic->p[ U_PLANE ].i_lines = i_height;
             p_pic->p[ U_PLANE ].i_pitch = i_width;
-            p_pic->p[ U_PLANE ].i_visible_bytes = p_pic->p[ U_PLANE ].i_pitch;
+            p_pic->p[ U_PLANE ].i_visible_pitch = p_pic->p[ U_PLANE ].i_pitch;
             p_pic->p[ V_PLANE ].i_lines = i_height;
             p_pic->p[ V_PLANE ].i_pitch = i_width;
-            p_pic->p[ V_PLANE ].i_visible_bytes = p_pic->p[ V_PLANE ].i_pitch;
+            p_pic->p[ V_PLANE ].i_visible_pitch = p_pic->p[ V_PLANE ].i_pitch;
             p_pic->i_planes = 3;
             break;
 
         case FOURCC_Y211:
             p_pic->p->i_lines = i_height;
             p_pic->p->i_pitch = i_width;
-            p_pic->p->i_visible_bytes = p_pic->p->i_pitch;
-            p_pic->p->i_pixel_bytes = 4;
+            p_pic->p->i_visible_pitch = p_pic->p->i_pitch;
+            p_pic->p->i_pixel_pitch = 4;
             p_pic->i_planes = 1;
             break;
 
         case FOURCC_YUY2:
             p_pic->p->i_lines = i_height;
             p_pic->p->i_pitch = i_width * 2;
-            p_pic->p->i_visible_bytes = p_pic->p->i_pitch;
-            p_pic->p->i_pixel_bytes = 4;
+            p_pic->p->i_visible_pitch = p_pic->p->i_pitch;
+            p_pic->p->i_pixel_pitch = 4;
             p_pic->i_planes = 1;
             break;
 
         case FOURCC_RV15:
             p_pic->p->i_lines = i_height;
             p_pic->p->i_pitch = i_width * 2;
-            p_pic->p->i_visible_bytes = p_pic->p->i_pitch;
-            p_pic->p->i_pixel_bytes = 2;
+            p_pic->p->i_visible_pitch = p_pic->p->i_pitch;
+            p_pic->p->i_pixel_pitch = 2;
 /* FIXME: p_heap isn't always reachable
             p_pic->p_heap->i_rmask = 0x001f;
             p_pic->p_heap->i_gmask = 0x03e0;
@@ -501,8 +515,8 @@ void vout_AllocatePicture( vout_thread_t *p_vout, picture_t *p_pic,
         case FOURCC_RV16:
             p_pic->p->i_lines = i_height;
             p_pic->p->i_pitch = i_width * 2;
-            p_pic->p->i_visible_bytes = p_pic->p->i_pitch;
-            p_pic->p->i_pixel_bytes = 2;
+            p_pic->p->i_visible_pitch = p_pic->p->i_pitch;
+            p_pic->p->i_pixel_pitch = 2;
 /* FIXME: p_heap isn't always reachable
             p_pic->p_heap->i_rmask = 0x001f;
             p_pic->p_heap->i_gmask = 0x07e0;
@@ -513,8 +527,8 @@ void vout_AllocatePicture( vout_thread_t *p_vout, picture_t *p_pic,
         case FOURCC_RV32:
             p_pic->p->i_lines = i_height;
             p_pic->p->i_pitch = i_width * 4;
-            p_pic->p->i_visible_bytes = p_pic->p->i_pitch;
-            p_pic->p->i_pixel_bytes = 4;
+            p_pic->p->i_visible_pitch = p_pic->p->i_pitch;
+            p_pic->p->i_pixel_pitch = 4;
 /* FIXME: p_heap isn't always reachable
             p_pic->p_heap->i_rmask = 0xff0000;
             p_pic->p_heap->i_gmask = 0x00ff00;
@@ -554,17 +568,79 @@ void vout_AllocatePicture( vout_thread_t *p_vout, picture_t *p_pic,
     }
 }
 
+/*****************************************************************************
+ * vout_ChromaCmp: compare two chroma values
+ *****************************************************************************
+ * This function returns 1 if the two fourcc values given as argument are
+ * the same format (eg. UYVY / UYNV) or almost the same format (eg. I420/YV12)
+ *****************************************************************************/
+int vout_ChromaCmp( vlc_fourcc_t i_chroma, vlc_fourcc_t i_amorhc )
+{
+    /* If they are the same, they are the same ! */
+    if( i_chroma == i_amorhc )
+    {
+        return 1;
+    }
+
+    /* Check for equivalence classes */
+    switch( i_chroma )
+    {
+        case FOURCC_I420:
+        case FOURCC_IYUV:
+        case FOURCC_YV12:
+            switch( i_amorhc )
+            {
+                case FOURCC_I420:
+                case FOURCC_IYUV:
+                case FOURCC_YV12:
+                    return 1;
+
+                default:
+                    return 0;
+            }
+
+        case FOURCC_UYVY:
+        case FOURCC_UYNV:
+        case FOURCC_Y422:
+            switch( i_amorhc )
+            {
+                case FOURCC_UYVY:
+                case FOURCC_UYNV:
+                case FOURCC_Y422:
+                    return 1;
+
+                default:
+                    return 0;
+            }
+
+        case FOURCC_YUY2:
+        case FOURCC_YUNV:
+            switch( i_amorhc )
+            {
+                case FOURCC_YUY2:
+                case FOURCC_YUNV:
+                    return 1;
+
+                default:
+                    return 0;
+            }
+
+        default:
+            return 0;
+    }
+}
+
 /* Following functions are local */
 
 /*****************************************************************************
- * vout_CopyPicture: copy a picture to another one
+ * CopyPicture: copy a picture to another one
  *****************************************************************************
  * This function takes advantage of the image format, and reduces the
  * number of calls to memcpy() to the minimum. Source and destination
- * images must have same width, height, and chroma.
+ * images must have same width (hence i_visible_pitch), height, and chroma.
  *****************************************************************************/
-static void vout_CopyPicture( vout_thread_t * p_vout,
-                              picture_t *p_src, picture_t *p_dest )
+static void CopyPicture( vout_thread_t * p_vout,
+                         picture_t *p_src, picture_t *p_dest )
 {
     int i;
 
@@ -572,45 +648,21 @@ static void vout_CopyPicture( vout_thread_t * p_vout,
     {
         if( p_src->p[i].i_pitch == p_dest->p[i].i_pitch )
         {
-            if( p_src->p[i].b_margin )
-            {
-                /* If p_src->b_margin is set, p_dest->b_margin must be set */
-                if( p_dest->p[i].b_hidden )
-                {
-                    /* There are margins, but they are hidden : perfect ! */
-                    p_vout->p_vlc->pf_memcpy(
-                                 p_dest->p[i].p_pixels, p_src->p[i].p_pixels,
-                                 p_src->p[i].i_pitch * p_src->p[i].i_lines );
-                    continue;
-                }
-                else
-                {
-                    /* We can't directly copy the margin. Too bad. */
-                }
-            }
-            else
-            {
-                /* Same pitch, no margins : perfect ! */
-                p_vout->p_vlc->pf_memcpy(
-                                 p_dest->p[i].p_pixels, p_src->p[i].p_pixels,
-                                 p_src->p[i].i_pitch * p_src->p[i].i_lines );
-                continue;
-            }
+            /* There are margins, but with the same width : perfect ! */
+            p_vout->p_vlc->pf_memcpy(
+                         p_dest->p[i].p_pixels, p_src->p[i].p_pixels,
+                         p_src->p[i].i_pitch * p_src->p[i].i_lines );
         }
         else
         {
-            /* Pitch values are different */
-        }
-
-        /* We need to proceed line by line */
-        {
+            /* We need to proceed line by line */
             u8 *p_in = p_src->p[i].p_pixels, *p_out = p_dest->p[i].p_pixels;
             int i_line;
 
             for( i_line = p_src->p[i].i_lines; i_line--; )
             {
                 p_vout->p_vlc->pf_memcpy( p_out, p_in,
-                                          p_src->p[i].i_visible_bytes );
+                                          p_src->p[i].i_visible_pitch );
                 p_in += p_src->p[i].i_pitch;
                 p_out += p_dest->p[i].i_pitch;
             }
diff --git a/src/video_output/vout_pictures.h b/src/video_output/vout_pictures.h
new file mode 100644 (file)
index 0000000..8f30704
--- /dev/null
@@ -0,0 +1,86 @@
+/*****************************************************************************
+ * vout_pictures.h : picture management definitions
+ *****************************************************************************
+ * Copyright (C) 2002 VideoLAN
+ * $Id: vout_pictures.h,v 1.1 2002/07/23 00:39:17 sam Exp $
+ *
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Fourcc definitions that we can handle internally
+ *****************************************************************************/
+
+/* 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')
+
+/* Planar YUV 4:1:0, Y:U:V */
+#define FOURCC_I410         VLC_FOURCC('I','4','1','0')
+
+/* 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')
+
index 6a130be..5147b8f 100644 (file)
--- a/src/vlc.c
+++ b/src/vlc.c
@@ -2,7 +2,7 @@
  * vlc.c: the vlc player
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: vlc.c,v 1.6 2002/07/20 18:01:43 sam Exp $
+ * $Id: vlc.c,v 1.7 2002/07/23 00:39:17 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -70,7 +70,7 @@ int main(int i_argc, char *ppsz_argv[], char *ppsz_env[])
     //vlc_add_intf( NULL, "xosd", VLC_FALSE );
     //vlc_add_intf( NULL, "gtk", VLC_FALSE );
     //vlc_add_intf( NULL, "kde", VLC_FALSE );
-    vlc_add_intf( "rc", VLC_FALSE );
+    //vlc_add_intf( "rc", VLC_FALSE );
 
     /* Add a blocking interface and keep the return value */
     err = vlc_add_intf( NULL, VLC_TRUE );