# HG changeset patch # User nick # Date 1012935097 0 # Node ID fcd6e49cb3cc8678203c3379e4eb4a08d1f82b69 # Parent 354048e506abbc948a5ad1986ec926e39a10f93e mplayer has swapped RGB's fourcc :( diff -r 354048e506ab -r fcd6e49cb3cc vidix/vidixlib.c --- a/vidix/vidixlib.c Tue Feb 05 16:50:10 2002 +0000 +++ b/vidix/vidixlib.c Tue Feb 05 18:51:37 2002 +0000 @@ -25,6 +25,7 @@ #include #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); }