18# include <libavcodec/avcodec.h>
19# include <libavdevice/avdevice.h>
20# include <libavformat/avformat.h>
21# include <libavutil/avutil.h>
22# include <libswscale/swscale.h>
28#define DEF_FFMPEG_LIB_VERSION(lib) \
29 {(#lib "_version"), ("The " #lib " version as a tuple of 3 numbers")}, \
31 (#lib "_version_string"), ("The " #lib " version formatted as a string") \
35 {
"supported",
"Boolean, True when Blender is built with FFmpeg support"},
45#undef DEF_FFMPEG_LIB_VERSION
49 "This module contains information about FFmpeg blender is linked against",
56 PyObject *ffmpeg_info;
64 if (ffmpeg_info ==
nullptr) {
69# define SetIntItem(flag) PyStructSequence_SET_ITEM(ffmpeg_info, pos++, PyLong_FromLong(flag))
72# define SetStrItem(str) PyStructSequence_SET_ITEM(ffmpeg_info, pos++, PyUnicode_FromString(str))
74#define SetObjItem(obj) PyStructSequence_SET_ITEM(ffmpeg_info, pos++, obj)
77# define FFMPEG_LIB_VERSION(lib) \
79 curversion = lib##_version(); \
81 PyC_Tuple_Pack_I32({curversion >> 16, (curversion >> 8) % 256, curversion % 256})); \
82 SetObjItem(PyUnicode_FromFormat( \
83 "%2d, %2d, %2d", curversion >> 16, (curversion >> 8) % 256, curversion % 256)); \
87# define FFMPEG_LIB_VERSION(lib) \
89 SetStrItem("Unknown"); \
90 SetStrItem("Unknown"); \
107#undef FFMPEG_LIB_VERSION
110 Py_DECREF(ffmpeg_info);
#define DEF_FFMPEG_LIB_VERSION(lib)
static PyTypeObject BlenderAppFFmpegType
static PyStructSequence_Desc app_ffmpeg_info_desc
PyObject * BPY_app_ffmpeg_struct()
static PyStructSequence_Field app_ffmpeg_info_fields[]
#define FFMPEG_LIB_VERSION(lib)
static PyObject * make_ffmpeg_info()