26 #include "../generic/py_capi_utils.h"
29 # include <libavcodec/avcodec.h>
30 # include <libavdevice/avdevice.h>
31 # include <libavformat/avformat.h>
32 # include <libavutil/avutil.h>
33 # include <libswscale/swscale.h>
38 #define DEF_FFMPEG_LIB_VERSION(lib) \
39 {(#lib "_version"), ("The " #lib " version as a tuple of 3 numbers")}, \
41 (#lib "_version_string"), ("The " #lib " version formatted as a string") \
45 {
"supported",
"Boolean, True when Blender is built with FFmpeg support"},
55 #undef DEF_FFMPEG_LIB_VERSION
59 "This module contains information about FFmpeg blender is linked against",
66 PyObject *ffmpeg_info;
74 if (ffmpeg_info ==
NULL) {
79 # define SetIntItem(flag) PyStructSequence_SET_ITEM(ffmpeg_info, pos++, PyLong_FromLong(flag))
82 # define SetStrItem(str) PyStructSequence_SET_ITEM(ffmpeg_info, pos++, PyUnicode_FromString(str))
84 #define SetObjItem(obj) PyStructSequence_SET_ITEM(ffmpeg_info, pos++, obj)
87 # define FFMPEG_LIB_VERSION(lib) \
89 curversion = lib##_version(); \
91 PyC_Tuple_Pack_I32(curversion >> 16, (curversion >> 8) % 256, curversion % 256)); \
92 SetObjItem(PyUnicode_FromFormat( \
93 "%2d, %2d, %2d", curversion >> 16, (curversion >> 8) % 256, curversion % 256)); \
97 # define FFMPEG_LIB_VERSION(lib) \
99 SetStrItem("Unknown"); \
100 SetStrItem("Unknown"); \
117 #undef FFMPEG_LIB_VERSION
120 Py_DECREF(ffmpeg_info);
#define DEF_FFMPEG_LIB_VERSION(lib)
static PyObject * make_ffmpeg_info(void)
static PyTypeObject BlenderAppFFmpegType
PyObject * BPY_app_ffmpeg_struct(void)
static PyStructSequence_Desc app_ffmpeg_info_desc
static PyStructSequence_Field app_ffmpeg_info_fields[]
#define FFMPEG_LIB_VERSION(lib)