22# include <libavcodec/avcodec.h>
23# include <libavdevice/avdevice.h>
24# include <libavformat/avformat.h>
25# include <libavutil/avutil.h>
26# include <libswscale/swscale.h>
32#define DEF_FFMPEG_LIB_VERSION(lib) \
33 {(#lib "_version"), ("The " #lib " version as a tuple of 3 numbers")}, \
35 (#lib "_version_string"), ("The " #lib " version formatted as a string") \
39 {
"supported",
"Boolean, True when Blender is built with FFmpeg support"},
49#undef DEF_FFMPEG_LIB_VERSION
53 "This module contains information about FFmpeg blender is linked against",
60 PyObject *ffmpeg_info;
68 if (ffmpeg_info ==
nullptr) {
73# define SetIntItem(flag) PyStructSequence_SET_ITEM(ffmpeg_info, pos++, PyLong_FromLong(flag))
76# define SetStrItem(str) PyStructSequence_SET_ITEM(ffmpeg_info, pos++, PyUnicode_FromString(str))
78#define SetObjItem(obj) PyStructSequence_SET_ITEM(ffmpeg_info, pos++, obj)
81# define FFMPEG_LIB_VERSION(lib) \
83 curversion = lib##_version(); \
85 PyC_Tuple_Pack_I32({curversion >> 16, (curversion >> 8) % 256, curversion % 256})); \
86 SetObjItem(PyUnicode_FromFormat( \
87 "%2d, %2d, %2d", curversion >> 16, (curversion >> 8) % 256, curversion % 256)); \
91# define FFMPEG_LIB_VERSION(lib) \
93 SetStrItem("Unknown"); \
94 SetStrItem("Unknown"); \
111#undef FFMPEG_LIB_VERSION
113 if (PyErr_Occurred()) [[unlikely]] {
114 Py_DECREF(ffmpeg_info);
#define DEF_FFMPEG_LIB_VERSION(lib)
#define FFMPEG_LIB_VERSION(lib)
static PyStructSequence_Desc app_ffmpeg_info_desc
static PyStructSequence_Field app_ffmpeg_info_fields[]
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
static PyTypeObject BlenderAppFFmpegType
PyObject * BPY_app_ffmpeg_struct()
static PyObject * make_ffmpeg_info()
header-only compatibility defines.