[Mplayer-cvslog] CVS: main/vidix vidixlib.c,1.7,1.8
Nick Kurshev
nick at mplayer.dev.hu
Tue Feb 5 19:51:53 CET 2002
Update of /cvsroot/mplayer/main/vidix
In directory mplayer:/var/tmp.root/cvs-serv18698/main/vidix
Modified Files:
vidixlib.c
Log Message:
mplayer has swapped RGB's fourcc :(
Index: vidixlib.c
===================================================================
RCS file: /cvsroot/mplayer/main/vidix/vidixlib.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- vidixlib.c 3 Feb 2002 13:05:30 -0000 1.7
+++ vidixlib.c 5 Feb 2002 18:51:37 -0000 1.8
@@ -25,6 +25,7 @@
#include <dirent.h>
#include "vidixlib.h"
+#include "../bswap.h"
static char drv_name[FILENAME_MAX];
@@ -227,13 +228,27 @@
return t_vdl(handle)->get_caps(cap);
}
+#define MPLAYER_IMGFMT_RGB (('R'<<24)|('G'<<16)|('B'<<8))
+#define MPLAYER_IMGFMT_BGR (('B'<<24)|('G'<<16)|('R'<<8))
+#define MPLAYER_IMGFMT_RGB_MASK 0xFFFFFF00
+
+static uint32_t normilize_fourcc(uint32_t fourcc)
+{
+ if((fourcc & MPLAYER_IMGFMT_RGB_MASK) == (MPLAYER_IMGFMT_RGB|0) ||
+ (fourcc & MPLAYER_IMGFMT_RGB_MASK) == (MPLAYER_IMGFMT_BGR|0))
+ return bswap_32(fourcc);
+ else return fourcc;
+}
+
int vdlQueryFourcc(VDL_HANDLE handle,vidix_fourcc_t *f)
{
+ f->fourcc = normilize_fourcc(f->fourcc);
return t_vdl(handle)->query_fourcc(f);
}
int vdlConfigPlayback(VDL_HANDLE handle,vidix_playback_t *p)
{
+ p->fourcc = normilize_fourcc(p->fourcc);
return t_vdl(handle)->config_playback(p);
}
More information about the MPlayer-cvslog
mailing list