3rdparty/licenseReport: Add seperate LGPL checks
[haiku.git] / src / add-ons / media / plugins / ffmpeg / gfx_util.h
blobcc1f63806d7bffe033e64fc772474d7335989317
1 /*
2 * Copyright (C) 2014 Colin Günther <coling@gmx.de>.
4 * All rights reserved. Distributed under the terms of the MIT License.
5 */
7 /******************************************************************************
9 / File: gfx_util.h
11 / Description: utility functions for ffmpeg codec wrappers for BeOs R5.
13 / Disclaimer: This decoder is based on undocumented APIs.
14 / Therefore it is likely, if not certain, to break in future
15 / versions of BeOS. This piece of software is in no way
16 / connected to or even supported by Be, Inc.
18 / Copyright (C) 2001 François Revol. All Rights Reserved.
20 ******************************************************************************/
22 #ifndef __FFUTILS_H__
23 #define __FFUTILS_H__
25 // BeOS and libavcodec bitmap formats
26 #include <GraphicsDefs.h>
27 extern "C" {
28 #include "libavcodec/avcodec.h"
31 #if LIBAVCODEC_VERSION_INT < ((54 << 16) | (50 << 8))
32 typedef PixelFormat AVPixelFormat;
33 #endif
36 // this function will be used by the wrapper to write into
37 // the Media Kit provided buffer from the self-allocated ffmpeg codec buffer
38 // it also will do some colorspace and planar/chunky conversions.
39 // these functions should be optimized with overlay in mind.
40 //typedef void (*gfx_convert_func) (AVPicture *in, AVPicture *out, long line_count, long size);
41 // will become:
42 typedef void (*gfx_convert_func) (AVFrame *in, AVFrame *out, int width, int height);
44 // this function will try to find the best colorspaces for both the ff-codec and
45 // the Media Kit sides.
46 gfx_convert_func resolve_colorspace(color_space cs, AVPixelFormat pixelFormat, int width, int height);
48 const char *pixfmt_to_string(int format);
50 color_space pixfmt_to_colorspace(int format);
51 AVPixelFormat colorspace_to_pixfmt(color_space format);
53 void dump_ffframe_audio(AVFrame *frame, const char *name);
54 void dump_ffframe_video(AVFrame *frame, const char *name);
56 #endif