[Mplayer-cvslog] CVS: main/libmpdemux ms_hdr.h, NONE, 1.1 aviheader.h, 1.8, 1.9 aviprint.c, 1.18, 1.19 muxer.c, 1.4, 1.5 muxer_avi.c, 1.24, 1.25 muxer_mpeg.c, 1.3, 1.4 stheader.h, 1.39, 1.40

Alex Beregszaszi syncmail at mplayerhq.hu
Wed Apr 28 12:18:35 CEST 2004


CVS change done by Alex Beregszaszi

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv11323/libmpdemux

Modified Files:
	aviheader.h aviprint.c muxer.c muxer_avi.c muxer_mpeg.c 
	stheader.h 
Added Files:
	ms_hdr.h 
Log Message:
removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski

--- NEW FILE ---
#ifndef __MS_HEADER_H
#define __MS_HEADER_H 1

#ifndef _WAVEFORMATEX_
#define _WAVEFORMATEX_
typedef struct __attribute__((__packed__)) _WAVEFORMATEX {
  unsigned short  wFormatTag;
  unsigned short  nChannels;
  unsigned int    nSamplesPerSec;
  unsigned int    nAvgBytesPerSec;
  unsigned short  nBlockAlign;
  unsigned short  wBitsPerSample;
  unsigned short  cbSize;
} WAVEFORMATEX, *PWAVEFORMATEX, *NPWAVEFORMATEX, *LPWAVEFORMATEX;
#endif /* _WAVEFORMATEX_ */

typedef struct __attribute__((__packed__)) mpeglayer3waveformat_tag {
  WAVEFORMATEX wf;
  unsigned short wID;
  unsigned int   fdwFlags;
  unsigned short nBlockSize;
  unsigned short nFramesPerBlock;
  unsigned short nCodecDelay;
} MPEGLAYER3WAVEFORMAT;

#if !defined(_BITMAPINFOHEADER_) && !defined(_WINGDI_H)
#define _BITMAPINFOHEADER_
typedef struct __attribute__((__packed__))
{
    int 	biSize;
    int  	biWidth;
    int  	biHeight;
    short 	biPlanes;
    short 	biBitCount;
    int 	biCompression;
    int 	biSizeImage;
    int  	biXPelsPerMeter;
    int  	biYPelsPerMeter;
    int 	biClrUsed;
    int 	biClrImportant;
} BITMAPINFOHEADER, *PBITMAPINFOHEADER, *LPBITMAPINFOHEADER;
typedef struct {
	BITMAPINFOHEADER bmiHeader;
	int	bmiColors[1];
} BITMAPINFO, *LPBITMAPINFO;
#endif

#ifndef le2me_BITMAPINFOHEADER
#ifdef WORDS_BIGENDIAN
#define le2me_BITMAPINFOHEADER(h) {					\
    (h)->biSize = le2me_32((h)->biSize);				\
    (h)->biWidth = le2me_32((h)->biWidth);				\
    (h)->biHeight = le2me_32((h)->biHeight);				\
    (h)->biPlanes = le2me_16((h)->biPlanes);				\
    (h)->biBitCount = le2me_16((h)->biBitCount);			\
    (h)->biCompression = le2me_32((h)->biCompression);			\
    (h)->biSizeImage = le2me_32((h)->biSizeImage);			\
    (h)->biXPelsPerMeter = le2me_32((h)->biXPelsPerMeter);		\
    (h)->biYPelsPerMeter = le2me_32((h)->biYPelsPerMeter);		\
    (h)->biClrUsed = le2me_32((h)->biClrUsed);				\
    (h)->biClrImportant = le2me_32((h)->biClrImportant);		\
}
#define le2me_WAVEFORMATEX(h) {						\
    (h)->wFormatTag = le2me_16((h)->wFormatTag);			\
    (h)->nChannels = le2me_16((h)->nChannels);				\
    (h)->nSamplesPerSec = le2me_32((h)->nSamplesPerSec);		\
    (h)->nAvgBytesPerSec = le2me_32((h)->nAvgBytesPerSec);		\
    (h)->nBlockAlign = le2me_16((h)->nBlockAlign);			\
    (h)->wBitsPerSample = le2me_16((h)->wBitsPerSample);		\
    (h)->cbSize = le2me_16((h)->cbSize);				\
}
#else
#define le2me_BITMAPINFOHEADER(h)   /**/
#define le2me_WAVEFORMATEX(h)	    /**/
#endif
#endif

#endif

Index: aviheader.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/aviheader.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- aviheader.h	19 Mar 2004 20:06:30 -0000	1.8
+++ aviheader.h	28 Apr 2004 10:18:33 -0000	1.9
@@ -4,6 +4,136 @@
 //#include "config.h"	/* get correct definition WORDS_BIGENDIAN */
 #include "bswap.h"
 
+#ifndef MIN
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#endif
+
+#ifndef min
+#define min(a,b) (((a)<(b))?(a):(b))
+#endif
+
+#ifndef max
+#define max(a,b) (((a)>(b))?(a):(b))
+#endif
+
+#ifndef mmioFOURCC
+#define mmioFOURCC( ch0, ch1, ch2, ch3 )				\
+		( (uint32_t)(uint8_t)(ch0) | ( (uint32_t)(uint8_t)(ch1) << 8 ) |	\
+		( (uint32_t)(uint8_t)(ch2) << 16 ) | ( (uint32_t)(uint8_t)(ch3) << 24 ) )
+#endif
+
+/* Macro to make a TWOCC out of two characters */
+#ifndef aviTWOCC
+#define aviTWOCC(ch0, ch1) ((uint16_t)(uint8_t)(ch0) | ((uint16_t)(uint8_t)(ch1) << 8))
+#endif
+
+typedef uint16_t TWOCC;
+typedef uint32_t FOURCC;
+
+/* form types, list types, and chunk types */
+#define formtypeAVI             mmioFOURCC('A', 'V', 'I', ' ')
+#define listtypeAVIHEADER       mmioFOURCC('h', 'd', 'r', 'l')
+#define ckidAVIMAINHDR          mmioFOURCC('a', 'v', 'i', 'h')
+#define listtypeSTREAMHEADER    mmioFOURCC('s', 't', 'r', 'l')
+#define ckidSTREAMHEADER        mmioFOURCC('s', 't', 'r', 'h')
+#define ckidSTREAMFORMAT        mmioFOURCC('s', 't', 'r', 'f')
+#define ckidSTREAMHANDLERDATA   mmioFOURCC('s', 't', 'r', 'd')
+#define ckidSTREAMNAME		mmioFOURCC('s', 't', 'r', 'n')
+
+#define listtypeAVIMOVIE        mmioFOURCC('m', 'o', 'v', 'i')
+#define listtypeAVIRECORD       mmioFOURCC('r', 'e', 'c', ' ')
+
+#define ckidAVINEWINDEX         mmioFOURCC('i', 'd', 'x', '1')
+
+/*
+** Stream types for the <fccType> field of the stream header.
+*/
+#define streamtypeVIDEO         mmioFOURCC('v', 'i', 'd', 's')
+#define streamtypeAUDIO         mmioFOURCC('a', 'u', 'd', 's')
+#define streamtypeMIDI		mmioFOURCC('m', 'i', 'd', 's')
+#define streamtypeTEXT          mmioFOURCC('t', 'x', 't', 's')
+
+/* Basic chunk types */
+#define cktypeDIBbits           aviTWOCC('d', 'b')
+#define cktypeDIBcompressed     aviTWOCC('d', 'c')
+#define cktypePALchange         aviTWOCC('p', 'c')
+#define cktypeWAVEbytes         aviTWOCC('w', 'b')
+
+/* Chunk id to use for extra chunks for padding. */
+#define ckidAVIPADDING          mmioFOURCC('J', 'U', 'N', 'K')
+
+/* flags for use in <dwFlags> in AVIFileHdr */
+#define AVIF_HASINDEX		0x00000010	// Index at end of file?
+#define AVIF_MUSTUSEINDEX	0x00000020
+#define AVIF_ISINTERLEAVED	0x00000100
+#define AVIF_TRUSTCKTYPE	0x00000800	// Use CKType to find key frames?
+#define AVIF_WASCAPTUREFILE	0x00010000
+#define AVIF_COPYRIGHTED	0x00020000
+
+typedef struct
+{
+    uint32_t		dwMicroSecPerFrame;	// frame display rate (or 0L)
+    uint32_t		dwMaxBytesPerSec;	// max. transfer rate
+    uint32_t		dwPaddingGranularity;	// pad to multiples of this
+                                                // size; normally 2K.
+    uint32_t		dwFlags;		// the ever-present flags
+    uint32_t		dwTotalFrames;		// # frames in file
+    uint32_t		dwInitialFrames;
+    uint32_t		dwStreams;
+    uint32_t		dwSuggestedBufferSize;
+    
+    uint32_t		dwWidth;
+    uint32_t		dwHeight;
+    
+    uint32_t		dwReserved[4];
+} MainAVIHeader;
+
+/* The RECT structure */
+typedef struct tagRECT
+{
+    short  left;
+    short  top;
+    short  right;
+    short  bottom;
+} RECT, *PRECT, *LPRECT;
+typedef const RECT *LPCRECT;
+
+typedef struct {
+    FOURCC		fccType;
+    FOURCC		fccHandler;
+    uint32_t		dwFlags;	/* Contains AVITF_* flags */
+    uint16_t		wPriority;
+    uint16_t		wLanguage;
+    uint32_t		dwInitialFrames;
+    uint32_t		dwScale;	
+    uint32_t		dwRate;	/* dwRate / dwScale == samples/second */
+    uint32_t		dwStart;
+    uint32_t		dwLength; /* In units above... */
+    uint32_t		dwSuggestedBufferSize;
+    uint32_t		dwQuality;
+    uint32_t		dwSampleSize;
+    RECT		rcFrame;
+} AVIStreamHeader;
+
+/* Flags for index */
+#define AVIIF_LIST          0x00000001L // chunk is a 'LIST'
+#define AVIIF_KEYFRAME      0x00000010L // this frame is a key frame.
+
+#define AVIIF_NOTIME	    0x00000100L // this frame doesn't take any time
+#define AVIIF_COMPUSE       0x0FFF0000L // these bits are for compressor use
+
+#define FOURCC_RIFF     mmioFOURCC('R', 'I', 'F', 'F')
+#define FOURCC_LIST     mmioFOURCC('L', 'I', 'S', 'T')
+
+typedef struct
+{
+    uint32_t		ckid;
+    uint32_t		dwFlags;
+    uint32_t		dwChunkOffset;		// Position of chunk
+    uint32_t		dwChunkLength;		// Length of chunk
+} AVIINDEXENTRY;
+
+
 typedef struct _avisuperindex_entry {
     uint64_t qwOffset;           // absolute file offset
     uint32_t dwSize;             // size of index chunk at this offset

Index: aviprint.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/aviprint.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- aviprint.c	17 Mar 2004 14:50:36 -0000	1.18
+++ aviprint.c	28 Apr 2004 10:18:33 -0000	1.19
@@ -9,11 +9,8 @@
 #include "stream.h"
 #include "demuxer.h"
 
-#include "wine/mmreg.h"
-#include "wine/avifmt.h"
-#include "wine/vfw.h"
-
 #include "aviheader.h"
+#include "ms_hdr.h"
 
 //#include "codec-cfg.h"
 //#include "stheader.h"
@@ -79,7 +76,7 @@
     uint8_t* p = ((uint8_t*)h) + sizeof(WAVEFORMATEX);
     printf("Unknown extra header dump: ");
     for (i = 0; i < h->cbSize; i++)
-	printf("[%x] ", *(p+i));
+	printf("[%x] ", p[i]);
     printf("\n");
   }
   printf("===========================\n");

Index: muxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/muxer.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- muxer.c	9 Mar 2004 14:46:34 -0000	1.4
+++ muxer.c	28 Apr 2004 10:18:33 -0000	1.5
@@ -8,9 +8,8 @@
 #include "config.h"
 #include "../version.h"
 
-#include "wine/mmreg.h"
-#include "wine/avifmt.h"
-#include "wine/vfw.h"
+#include "aviheader.h"
+#include "ms_hdr.h"
 
 #include "muxer.h"
 

Index: muxer_avi.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/muxer_avi.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- muxer_avi.c	19 Apr 2004 02:14:09 -0000	1.24
+++ muxer_avi.c	28 Apr 2004 10:18:33 -0000	1.25
@@ -12,13 +12,11 @@
 #include "demuxer.h"
 #include "stheader.h"
 
-#include "wine/mmreg.h"
-#include "wine/avifmt.h"
-#include "wine/vfw.h"
 #include "bswap.h"
 
 #include "muxer.h"
 #include "aviheader.h"
+#include "ms_hdr.h"
 #include "mp_msg.h"
 
 extern char *info_name;

Index: muxer_mpeg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/muxer_mpeg.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- muxer_mpeg.c	22 Oct 2003 17:07:17 -0000	1.3
+++ muxer_mpeg.c	28 Apr 2004 10:18:33 -0000	1.4
@@ -8,11 +8,11 @@
 #include "../version.h"
 #include "../mp_msg.h"
 
-#include "wine/mmreg.h"
-#include "wine/avifmt.h"
-#include "wine/vfw.h"
 #include "bswap.h"
 
+#include "aviheader.h"
+#include "ms_hdr.h"
+
 #include "muxer.h"
 
 // 18 bytes reserved for block headers and STD

Index: stheader.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/stheader.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- stheader.h	16 Jan 2003 22:34:46 -0000	1.39
+++ stheader.h	28 Apr 2004 10:18:33 -0000	1.40
@@ -1,43 +1,8 @@
 #ifndef __ST_HEADER_H
 #define __ST_HEADER_H 1
 
-// for AVIStreamHeader:
-#include "wine/avifmt.h"
-
-#ifndef _WAVEFORMATEX_
-#define _WAVEFORMATEX_
-typedef struct __attribute__((__packed__)) _WAVEFORMATEX {
-  WORD   wFormatTag;
-  WORD   nChannels;
-  DWORD  nSamplesPerSec;
-  DWORD  nAvgBytesPerSec;
-  WORD   nBlockAlign;
-  WORD   wBitsPerSample;
-  WORD   cbSize;
-} WAVEFORMATEX, *PWAVEFORMATEX, *NPWAVEFORMATEX, *LPWAVEFORMATEX;
-#endif /* _WAVEFORMATEX_ */
-
-#ifndef _BITMAPINFOHEADER_
-#define _BITMAPINFOHEADER_
-typedef struct __attribute__((__packed__))
-{
-    int 	biSize;
-    int  	biWidth;
-    int  	biHeight;
-    short 	biPlanes;
-    short 	biBitCount;
-    int 	biCompression;
-    int 	biSizeImage;
-    int  	biXPelsPerMeter;
-    int  	biYPelsPerMeter;
-    int 	biClrUsed;
-    int 	biClrImportant;
-} BITMAPINFOHEADER, *PBITMAPINFOHEADER, *LPBITMAPINFOHEADER;
-typedef struct {
-	BITMAPINFOHEADER bmiHeader;
-	int	bmiColors[1];
-} BITMAPINFO, *LPBITMAPINFO;
-#endif
+#include "aviheader.h"
+#include "ms_hdr.h"
 
 // Stream headers:
 




More information about the MPlayer-cvslog mailing list