From 9ad362d2dd562ca3f15b7e9b9600db68066500ac Mon Sep 17 00:00:00 2001 From: Marco Zuehlke Date: Thu, 13 Nov 2003 15:23:00 +0000 Subject: define FOURCC only once CVS patchset: 5729 CVS date: 2003/11/13 15:23:00 --- src/demuxers/demux_4xm.c | 9 ++------- src/demuxers/demux_aiff.c | 9 ++------- src/demuxers/demux_eawve.c | 8 ++------ src/demuxers/demux_film.c | 7 ++----- src/demuxers/demux_mpeg.c | 10 +++------- src/demuxers/demux_mpgaudio.c | 7 ++----- src/demuxers/demux_nsv.c | 9 ++------- src/demuxers/demux_qt.c | 9 ++------- src/demuxers/demux_real.c | 9 ++------- src/demuxers/demux_smjpeg.c | 7 ++----- src/demuxers/demux_str.c | 9 ++------- src/demuxers/demux_vqa.c | 9 ++------- src/demuxers/demux_wc3movie.c | 9 ++------- src/libw32dll/qt_decoder.c | 9 +++------ src/xine-engine/bswap.h | 14 ++++++++++++++ src/xine-engine/buffer_types.c | 14 +++----------- 16 files changed, 47 insertions(+), 101 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_4xm.c b/src/demuxers/demux_4xm.c index cf92f9668..0844e56c7 100644 --- a/src/demuxers/demux_4xm.c +++ b/src/demuxers/demux_4xm.c @@ -23,7 +23,7 @@ * For more information on the 4xm file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_4xm.c,v 1.7 2003/11/11 18:44:51 f1rmb Exp $ + * $Id: demux_4xm.c,v 1.8 2003/11/13 15:23:00 andruil Exp $ */ #ifdef HAVE_CONFIG_H @@ -48,12 +48,7 @@ #include "bswap.h" #include "group_games.h" -#define FOURCC_TAG( ch0, ch1, ch2, ch3 ) \ - ( (long)(unsigned char)(ch0) | \ - ( (long)(unsigned char)(ch1) << 8 ) | \ - ( (long)(unsigned char)(ch2) << 16 ) | \ - ( (long)(unsigned char)(ch3) << 24 ) ) - +#define FOURCC_TAG LE_FOURCC #define RIFF_TAG FOURCC_TAG('R', 'I', 'F', 'F') #define _4XMV_TAG FOURCC_TAG('4', 'X', 'M', 'V') #define LIST_TAG FOURCC_TAG('L', 'I', 'S', 'T') diff --git a/src/demuxers/demux_aiff.c b/src/demuxers/demux_aiff.c index c4d4ad1d9..53cf5acc4 100644 --- a/src/demuxers/demux_aiff.c +++ b/src/demuxers/demux_aiff.c @@ -21,7 +21,7 @@ /* * AIFF File Demuxer by Mike Melanson (melanson@pcisys.net) * - * $Id: demux_aiff.c,v 1.34 2003/11/11 18:44:51 f1rmb Exp $ + * $Id: demux_aiff.c,v 1.35 2003/11/13 15:23:00 andruil Exp $ * */ @@ -43,12 +43,7 @@ #include "bswap.h" #include "group_audio.h" -#define FOURCC_TAG( ch0, ch1, ch2, ch3 ) \ - ( (long)(unsigned char)(ch3) | \ - ( (long)(unsigned char)(ch2) << 8 ) | \ - ( (long)(unsigned char)(ch1) << 16 ) | \ - ( (long)(unsigned char)(ch0) << 24 ) ) - +#define FOURCC_TAG BE_FOURCC #define FORM_TAG FOURCC_TAG('F', 'O', 'R', 'M') #define AIFF_TAG FOURCC_TAG('A', 'I', 'F', 'F') #define COMM_TAG FOURCC_TAG('C', 'O', 'M', 'M') diff --git a/src/demuxers/demux_eawve.c b/src/demuxers/demux_eawve.c index 5de0ded35..2a3c1fd39 100644 --- a/src/demuxers/demux_eawve.c +++ b/src/demuxers/demux_eawve.c @@ -19,7 +19,7 @@ */ /* - * $Id: demux_eawve.c,v 1.22 2003/11/11 18:44:51 f1rmb Exp $ + * $Id: demux_eawve.c,v 1.23 2003/11/13 15:23:01 andruil Exp $ * * demux_eawve.c, Demuxer plugin for Electronic Arts' WVE file format * @@ -46,11 +46,7 @@ #include "demux.h" #include "group_games.h" -#define FOURCC_TAG(ch0, ch1, ch2, ch3) \ - (((uint32_t)(ch3)) | \ - ((uint32_t)(ch2) << 8) | \ - ((uint32_t)(ch1) << 16) | \ - ((uint32_t)(ch0) << 24)) +#define FOURCC_TAG BE_FOURCC typedef struct { demux_plugin_t demux_plugin; diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c index 56cf19efc..a987277f7 100644 --- a/src/demuxers/demux_film.c +++ b/src/demuxers/demux_film.c @@ -21,7 +21,7 @@ * For more information on the FILM file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_film.c,v 1.67 2003/11/11 18:44:51 f1rmb Exp $ + * $Id: demux_film.c,v 1.68 2003/11/13 15:23:01 andruil Exp $ */ #ifdef HAVE_CONFIG_H @@ -53,10 +53,7 @@ #include "bswap.h" #include "group_games.h" -#define FOURCC_TAG( ch0, ch1, ch2, ch3 ) \ - ( (long)(unsigned char)(ch3) | ( (long)(unsigned char)(ch2) << 8 ) | \ - ( (long)(unsigned char)(ch1) << 16 ) | ( (long)(unsigned char)(ch0) << 24 ) ) - +#define FOURCC_TAG BE_FOURCC #define FILM_TAG FOURCC_TAG('F', 'I', 'L', 'M') #define FDSC_TAG FOURCC_TAG('F', 'D', 'S', 'C') #define STAB_TAG FOURCC_TAG('S', 'T', 'A', 'B') diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c index 0cf5fb16b..760f7aba1 100644 --- a/src/demuxers/demux_mpeg.c +++ b/src/demuxers/demux_mpeg.c @@ -19,7 +19,7 @@ */ /* - * $Id: demux_mpeg.c,v 1.126 2003/11/11 18:44:52 f1rmb Exp $ + * $Id: demux_mpeg.c,v 1.127 2003/11/13 15:23:01 andruil Exp $ * * demultiplexer for mpeg 1/2 program streams * reads streams of variable blocksizes @@ -80,10 +80,7 @@ typedef struct { */ #include "bswap.h" -#define QT_ATOM( ch0, ch1, ch2, ch3 ) \ - ( (long)(unsigned char)(ch3) | ( (long)(unsigned char)(ch2) << 8 ) | \ - ( (long)(unsigned char)(ch1) << 16 ) | ( (long)(unsigned char)(ch0) << 24 ) ) - +#define QT_ATOM BE_FOURCC /* these are the known top-level QT atoms */ #define FREE_ATOM QT_ATOM('f', 'r', 'e', 'e') #define JUNK_ATOM QT_ATOM('j', 'u', 'n', 'k') @@ -97,8 +94,7 @@ typedef struct { /* a little something for dealing with RIFF headers */ -#define FOURCC_TAG(ch0, ch1, ch2, ch3) QT_ATOM(ch0, ch1, ch2, ch3) - +#define FOURCC_TAG BE_FOURCC #define RIFF_TAG FOURCC_TAG('R', 'I', 'F', 'F') #define WAVE_TAG FOURCC_TAG('W', 'A', 'V', 'E') #define AVI_TAG FOURCC_TAG('A', 'V', 'I', ' ') diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c index 25ccfb2fb..df37de69d 100644 --- a/src/demuxers/demux_mpgaudio.c +++ b/src/demuxers/demux_mpgaudio.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_mpgaudio.c,v 1.122 2003/11/11 18:44:52 f1rmb Exp $ + * $Id: demux_mpgaudio.c,v 1.123 2003/11/13 15:23:01 andruil Exp $ * * demultiplexer for mpeg audio (i.e. mp3) streams * @@ -55,10 +55,7 @@ #define WRAP_THRESHOLD 120000 -#define FOURCC_TAG( ch0, ch1, ch2, ch3 ) \ - ( (long)(unsigned char)(ch3) | ( (long)(unsigned char)(ch2) << 8 ) | \ - ( (long)(unsigned char)(ch1) << 16 ) | ( (long)(unsigned char)(ch0) << 24 ) ) - +#define FOURCC_TAG BE_FOURCC #define RIFF_CHECK_BYTES 1024 #define RIFF_TAG FOURCC_TAG('R', 'I', 'F', 'F') #define AVI_TAG FOURCC_TAG('A', 'V', 'I', ' ') diff --git a/src/demuxers/demux_nsv.c b/src/demuxers/demux_nsv.c index 8b7c936ee..7b3ca9627 100644 --- a/src/demuxers/demux_nsv.c +++ b/src/demuxers/demux_nsv.c @@ -23,7 +23,7 @@ * For more information regarding the NSV file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_nsv.c,v 1.7 2003/11/11 18:44:52 f1rmb Exp $ + * $Id: demux_nsv.c,v 1.8 2003/11/13 15:23:01 andruil Exp $ */ #ifdef HAVE_CONFIG_H @@ -48,12 +48,7 @@ #include "bswap.h" #include "buffer.h" -#define FOURCC_TAG( ch0, ch1, ch2, ch3 ) \ - ( (long)(unsigned char)(ch3) | \ - ( (long)(unsigned char)(ch2) << 8 ) | \ - ( (long)(unsigned char)(ch1) << 16 ) | \ - ( (long)(unsigned char)(ch0) << 24 ) ) - +#define FOURCC_TAG BE_FOURCC #define NSVf_TAG FOURCC_TAG('N', 'S', 'V', 'f') #define NSVs_TAG FOURCC_TAG('N', 'S', 'V', 's') #define NONE_TAG FOURCC_TAG('N', 'O', 'N', 'E') diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c index 4e40da96d..e88dc8cf8 100644 --- a/src/demuxers/demux_qt.c +++ b/src/demuxers/demux_qt.c @@ -30,7 +30,7 @@ * build_frame_table * free_qt_info * - * $Id: demux_qt.c,v 1.170 2003/11/11 18:44:52 f1rmb Exp $ + * $Id: demux_qt.c,v 1.171 2003/11/13 15:23:01 andruil Exp $ * */ @@ -56,12 +56,7 @@ typedef unsigned int qt_atom; -#define QT_ATOM( ch0, ch1, ch2, ch3 ) \ - ( (unsigned char)(ch3) | \ - ( (unsigned char)(ch2) << 8 ) | \ - ( (unsigned char)(ch1) << 16 ) | \ - ( (unsigned char)(ch0) << 24 ) ) - +#define QT_ATOM BE_FOURCC /* top level atoms */ #define FREE_ATOM QT_ATOM('f', 'r', 'e', 'e') #define JUNK_ATOM QT_ATOM('j', 'u', 'n', 'k') diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index c12c5f85f..ba2771d42 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -30,7 +30,7 @@ * * Based on FFmpeg's libav/rm.c. * - * $Id: demux_real.c,v 1.69 2003/11/11 18:44:53 f1rmb Exp $ + * $Id: demux_real.c,v 1.70 2003/11/13 15:23:01 andruil Exp $ */ #ifdef HAVE_CONFIG_H @@ -55,12 +55,7 @@ #include "demux.h" #include "bswap.h" -#define FOURCC_TAG( ch0, ch1, ch2, ch3 ) \ - ( (long)(unsigned char)(ch3) | \ - ( (long)(unsigned char)(ch2) << 8 ) | \ - ( (long)(unsigned char)(ch1) << 16 ) | \ - ( (long)(unsigned char)(ch0) << 24 ) ) - +#define FOURCC_TAG BE_FOURCC #define RMF_TAG FOURCC_TAG('.', 'R', 'M', 'F') #define PROP_TAG FOURCC_TAG('P', 'R', 'O', 'P') #define MDPR_TAG FOURCC_TAG('M', 'D', 'P', 'R') diff --git a/src/demuxers/demux_smjpeg.c b/src/demuxers/demux_smjpeg.c index d49382098..8a03a9e6b 100644 --- a/src/demuxers/demux_smjpeg.c +++ b/src/demuxers/demux_smjpeg.c @@ -23,7 +23,7 @@ * For more information on the SMJPEG file format, visit: * http://www.lokigames.com/development/smjpeg.php3 * - * $Id: demux_smjpeg.c,v 1.43 2003/11/11 18:44:53 f1rmb Exp $ + * $Id: demux_smjpeg.c,v 1.44 2003/11/13 15:23:01 andruil Exp $ */ #ifdef HAVE_CONFIG_H @@ -48,10 +48,7 @@ #include "bswap.h" #include "group_games.h" -#define FOURCC_TAG( ch0, ch1, ch2, ch3 ) \ - ( (long)(unsigned char)(ch3) | ( (long)(unsigned char)(ch2) << 8 ) | \ - ( (long)(unsigned char)(ch1) << 16 ) | ( (long)(unsigned char)(ch0) << 24 ) ) - +#define FOURCC_TAG BE_FOURCC #define _TXT_TAG FOURCC_TAG('_', 'T', 'X', 'T') #define _SND_TAG FOURCC_TAG('_', 'S', 'N', 'D') #define _VID_TAG FOURCC_TAG('_', 'V', 'I', 'D') diff --git a/src/demuxers/demux_str.c b/src/demuxers/demux_str.c index 924e2bf18..808a1178e 100644 --- a/src/demuxers/demux_str.c +++ b/src/demuxers/demux_str.c @@ -24,7 +24,7 @@ * This demuxer handles either raw STR files (which are just a concatenation * of raw compact disc sectors) or STR files with RIFF headers. * - * $Id: demux_str.c,v 1.17 2003/11/11 18:44:53 f1rmb Exp $ + * $Id: demux_str.c,v 1.18 2003/11/13 15:23:01 andruil Exp $ */ /* @@ -150,12 +150,7 @@ #define CDXA_TYPE_VIDEO 0x02 #define CDXA_SUBMODE_EOF 0x80 /* set if EOF */ -#define FOURCC_TAG( ch0, ch1, ch2, ch3 ) \ - ( (long)(unsigned char)(ch3) | \ - ( (long)(unsigned char)(ch2) << 8 ) | \ - ( (long)(unsigned char)(ch1) << 16 ) | \ - ( (long)(unsigned char)(ch0) << 24 ) ) - +#define FOURCC_TAG BE_FOURCC #define RIFF_TAG FOURCC_TAG('R', 'I', 'F', 'F') #define CDXA_TAG FOURCC_TAG('C', 'D', 'X', 'A') diff --git a/src/demuxers/demux_vqa.c b/src/demuxers/demux_vqa.c index 05df44bc2..e00ec8fcc 100644 --- a/src/demuxers/demux_vqa.c +++ b/src/demuxers/demux_vqa.c @@ -29,7 +29,7 @@ * block needs information from the previous audio block in order to be * decoded, thus making random seeking difficult. * - * $Id: demux_vqa.c,v 1.35 2003/11/11 18:44:53 f1rmb Exp $ + * $Id: demux_vqa.c,v 1.36 2003/11/13 15:23:01 andruil Exp $ */ #ifdef HAVE_CONFIG_H @@ -49,12 +49,7 @@ #include "bswap.h" #include "group_games.h" -#define FOURCC_TAG( ch0, ch1, ch2, ch3 ) \ - ( (long)(unsigned char)(ch3) | \ - ( (long)(unsigned char)(ch2) << 8 ) | \ - ( (long)(unsigned char)(ch1) << 16 ) | \ - ( (long)(unsigned char)(ch0) << 24 ) ) - +#define FOURCC_TAG BE_FOURCC #define FORM_TAG FOURCC_TAG('F', 'O', 'R', 'M') #define WVQA_TAG FOURCC_TAG('W', 'V', 'Q', 'A') #define VQHD_TAG FOURCC_TAG('V', 'Q', 'H', 'D') diff --git a/src/demuxers/demux_wc3movie.c b/src/demuxers/demux_wc3movie.c index 45b357459..47daf72da 100644 --- a/src/demuxers/demux_wc3movie.c +++ b/src/demuxers/demux_wc3movie.c @@ -24,7 +24,7 @@ * For more information on the MVE file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_wc3movie.c,v 1.44 2003/11/11 18:44:53 f1rmb Exp $ + * $Id: demux_wc3movie.c,v 1.45 2003/11/13 15:23:01 andruil Exp $ */ #ifdef HAVE_CONFIG_H @@ -49,12 +49,7 @@ #include "bswap.h" #include "group_games.h" -#define FOURCC_TAG( ch0, ch1, ch2, ch3 ) \ - ( (long)(unsigned char)(ch3) | \ - ( (long)(unsigned char)(ch2) << 8 ) | \ - ( (long)(unsigned char)(ch1) << 16 ) | \ - ( (long)(unsigned char)(ch0) << 24 ) ) - +#define FOURCC_TAG BE_FOURCC #define FORM_TAG FOURCC_TAG('F', 'O', 'R', 'M') #define MOVE_TAG FOURCC_TAG('M', 'O', 'V', 'E') #define PC_TAG FOURCC_TAG('_', 'P', 'C', '_') diff --git a/src/libw32dll/qt_decoder.c b/src/libw32dll/qt_decoder.c index d75ef67fc..febd3ea44 100644 --- a/src/libw32dll/qt_decoder.c +++ b/src/libw32dll/qt_decoder.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2000-2003 the xine project * * This file is part of xine, a free video player. @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: qt_decoder.c,v 1.23 2003/11/11 18:44:55 f1rmb Exp $ + * $Id: qt_decoder.c,v 1.24 2003/11/13 15:23:01 andruil Exp $ * * quicktime video/audio decoder plugin, using win32 dlls * most of this code comes directly from MPlayer @@ -50,10 +50,7 @@ #ifdef FOUR_CHAR_CODE # undef FOUR_CHAR_CODE #endif -#define FOUR_CHAR_CODE(a,b,c,d) (uint32_t)( ((unsigned char)(a)<<24) | \ - ((unsigned char)(b)<<16) | \ - ((unsigned char)(c)<<8) | \ - (unsigned char)(d) ) +#define FOUR_CHAR_CODE BE_FOURCC /* #define LOG diff --git a/src/xine-engine/bswap.h b/src/xine-engine/bswap.h index a776fc7bf..7d73cff62 100644 --- a/src/xine-engine/bswap.h +++ b/src/xine-engine/bswap.h @@ -155,4 +155,18 @@ inline static unsigned long long int ByteSwap64(unsigned long long int x) #define AME_64(x) ALE_64(x) #endif + +#define BE_FOURCC( ch0, ch1, ch2, ch3 ) \ + ( (uint32_t)(unsigned char)(ch3) | \ + ( (uint32_t)(unsigned char)(ch2) << 8 ) | \ + ( (uint32_t)(unsigned char)(ch1) << 16 ) | \ + ( (uint32_t)(unsigned char)(ch0) << 24 ) ) + +#define LE_FOURCC( ch0, ch1, ch2, ch3 ) \ + ( (uint32_t)(unsigned char)(ch0) | \ + ( (uint32_t)(unsigned char)(ch1) << 8 ) | \ + ( (uint32_t)(unsigned char)(ch2) << 16 ) | \ + ( (uint32_t)(unsigned char)(ch3) << 24 ) ) + + #endif diff --git a/src/xine-engine/buffer_types.c b/src/xine-engine/buffer_types.c index b4b62688e..a66826662 100644 --- a/src/xine-engine/buffer_types.c +++ b/src/xine-engine/buffer_types.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: buffer_types.c,v 1.70 2003/11/11 18:45:00 f1rmb Exp $ + * $Id: buffer_types.c,v 1.71 2003/11/13 15:23:01 andruil Exp $ * * * contents: @@ -40,17 +40,9 @@ /* FOURCC will be manipulated using machine endian */ #ifdef WORDS_BIGENDIAN -#define meFOURCC( ch0, ch1, ch2, ch3 ) \ - ( (uint32_t)(unsigned char)(ch3) | \ - ( (uint32_t)(unsigned char)(ch2) << 8 ) | \ - ( (uint32_t)(unsigned char)(ch1) << 16 ) | \ - ( (uint32_t)(unsigned char)(ch0) << 24 ) ) +#define meFOURCC BE_FOURCC #else -#define meFOURCC( ch0, ch1, ch2, ch3 ) \ - ( (uint32_t)(unsigned char)(ch0) | \ - ( (uint32_t)(unsigned char)(ch1) << 8 ) | \ - ( (uint32_t)(unsigned char)(ch2) << 16 ) | \ - ( (uint32_t)(unsigned char)(ch3) << 24 ) ) +#define meFOURCC LE_FOURCC #endif -- cgit v1.2.3