diff options
Diffstat (limited to 'src/xine-engine')
-rw-r--r-- | src/xine-engine/buffer.h | 11 | ||||
-rw-r--r-- | src/xine-engine/buffer_types.c | 20 |
2 files changed, 27 insertions, 4 deletions
diff --git a/src/xine-engine/buffer.h b/src/xine-engine/buffer.h index e893a41ff..5a49f02db 100644 --- a/src/xine-engine/buffer.h +++ b/src/xine-engine/buffer.h @@ -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.h,v 1.46 2002/06/03 13:31:12 miguelfreitas Exp $ + * $Id: buffer.h,v 1.47 2002/06/03 16:20:36 miguelfreitas Exp $ * * * contents: @@ -259,7 +259,11 @@ uint32_t formattag_to_buf_audio( uint32_t formattag ); char * buf_audio_name( uint32_t buf_type ); -/* this version of BITMAPINFOHEADER should be safe to compile on 64bits machines */ +/* this is xine version of BITMAPINFOHEADER + * - should be safe to compile on 64bits machines + * - will always use machine endian format, so demuxers reading + * stuff from win32 formats must use the function below. + */ typedef struct { int32_t biSize; int32_t biWidth; @@ -274,6 +278,9 @@ typedef struct { int32_t biClrImportant; } xine_bmiheader; +/* convert xine_bmiheader struct from little endian */ +void xine_bmiheader_le2me( xine_bmiheader *bih ); + #ifdef __cplusplus } diff --git a/src/xine-engine/buffer_types.c b/src/xine-engine/buffer_types.c index f487d64fc..e5a5b91c2 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.19 2002/06/03 13:31:13 miguelfreitas Exp $ + * $Id: buffer_types.c,v 1.20 2002/06/03 16:20:36 miguelfreitas Exp $ * * * contents: @@ -36,7 +36,7 @@ #include <stdlib.h> #include <inttypes.h> #include "buffer.h" - +#include "bswap.h" #ifndef mmioFOURCC #define mmioFOURCC( ch0, ch1, ch2, ch3 ) \ @@ -631,3 +631,19 @@ int i; return "unknow"; } + +void xine_bmiheader_le2me( xine_bmiheader *bih ) { + + bih->biSize = le2me_32(bih->biSize); + bih->biWidth = le2me_32(bih->biWidth); + bih->biHeight = le2me_32(bih->biHeight); + bih->biPlanes = le2me_16(bih->biPlanes); + bih->biBitCount = le2me_16(bih->biBitCount); + /* do not change byte order of fourcc */ + /* bih->biCompression = le2me_32(bih->biCompression); */ + bih->biSizeImage = le2me_32(bih->biSizeImage); + bih->biXPelsPerMeter = le2me_32(bih->biXPelsPerMeter); + bih->biYPelsPerMeter = le2me_32(bih->biYPelsPerMeter); + bih->biClrUsed = le2me_32(bih->biClrUsed); + bih->biClrImportant = le2me_32(bih->biClrImportant); +} |