1 /****************************************************************************** 2 / 3 / File: gfx_util.h 4 / 5 / Description: utility functions for ffmpeg codec wrappers for BeOs R5. 6 / 7 / Disclaimer: This decoder is based on undocumented APIs. 8 / Therefore it is likely, if not certain, to break in future 9 / versions of BeOS. This piece of software is in no way 10 / connected to or even supported by Be, Inc. 11 / 12 / Copyright (C) 2001 François Revol. All Rights Reserved. 13 / 14 ******************************************************************************/ 15 16 #ifndef __FFUTILS_H__ 17 #define __FFUTILS_H__ 18 19 // BeOS and libavcodec bitmap formats 20 #include <GraphicsDefs.h> 21 extern "C" { 22 #include "libavcodec/avcodec.h" 23 } 24 25 // this function will be used by the wrapper to write into 26 // the Media Kit provided buffer from the self-allocated ffmpeg codec buffer 27 // it also will do some colorspace and planar/chunky conversions. 28 // these functions should be optimized with overlay in mind. 29 //typedef void (*gfx_convert_func) (AVPicture *in, AVPicture *out, long line_count, long size); 30 // will become: 31 typedef void (*gfx_convert_func) (AVFrame *in, AVFrame *out, int width, int height); 32 33 // this function will try to find the best colorspaces for both the ff-codec and 34 // the Media Kit sides. 35 gfx_convert_func resolve_colorspace(color_space cs, PixelFormat pixelFormat, int width, int height); 36 37 const char *pixfmt_to_string(int format); 38 39 color_space pixfmt_to_colorspace(int format); 40 PixelFormat colorspace_to_pixfmt(color_space format); 41 42 void dump_ffframe(AVFrame *frame, const char *name); 43 44 #endif 45