1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QFFMPEGDEFS_P_H
5#define QFFMPEGDEFS_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include "qtconfigmacros.h"
19
20#include <limits>
21#include <unordered_set>
22
23extern "C" {
24#include <libavformat/avformat.h>
25#include <libavcodec/avcodec.h>
26#include <libswresample/swresample.h>
27#include <libavutil/avutil.h>
28#include <libswscale/swscale.h>
29}
30
31#define QT_FFMPEG_HAS_AV_CHANNEL_LAYOUT \
32 (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 24, 100)) // since FFmpeg n5.1
33#define QT_FFMPEG_HAS_VULKAN \
34 (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(58, 91, 100)) // since FFmpeg n4.3
35#define QT_FFMPEG_HAS_FRAME_TIME_BASE \
36 (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 18, 100)) // since FFmpeg n5.0
37#define QT_FFMPEG_HAS_FRAME_DURATION \
38 (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(60, 3, 100)) // since FFmpeg n6.0
39#define QT_FFMPEG_STREAM_SIDE_DATA_DEPRECATED \
40 (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(60, 15, 100)) // since FFmpeg n6.1
41#define QT_FFMPEG_HAS_D3D12VA \
42 (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(59, 8, 100)) // since FFmpeg n7.0
43#define QT_FFMPEG_SWR_CONST_CH_LAYOUT \
44 (LIBSWRESAMPLE_VERSION_INT >= AV_VERSION_INT(4, 9, 100))
45#define QT_FFMPEG_AVIO_WRITE_CONST \
46 (LIBAVFORMAT_VERSION_MAJOR >= 61)
47#define QT_CODEC_PARAMETERS_HAVE_FRAMERATE \
48 (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(60, 11, 100)) // since FFmpeg n6.1
49#define QT_FFMPEG_HAS_AVCODEC_GET_SUPPORTED_CONFIG \
50 (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(59, 39, 100)) // since FFmpeg n7.1
51
52QT_BEGIN_NAMESPACE
53
54using PixelOrSampleFormat = int;
55using AVScore = int;
56constexpr AVScore BestAVScore = std::numeric_limits<AVScore>::max();
57constexpr AVScore DefaultAVScore = 0;
58constexpr AVScore NotSuitableAVScore = std::numeric_limits<AVScore>::min();
59constexpr AVScore MinAVScore = NotSuitableAVScore + 1;
60
61using AVPixelFormatSet = std::unordered_set<AVPixelFormat>;
62
63QT_END_NAMESPACE
64
65#endif // QFFMPEGDEFS_P_H
66

source code of qtmultimedia/src/plugins/multimedia/ffmpeg/qffmpegdefs_p.h