Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qffmpegdefs_p.h
Go to the documentation of this file.
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
<
variant
>
22
#
include
<
QtCore
/
qglobal
.
h
>
23
#
include
<
QtCore
/
qdebug
.
h
>
24
25
extern
"C"
{
26
#
include
<
libavformat
/
avformat
.
h
>
27
#
include
<
libavcodec
/
avcodec
.
h
>
28
#
include
<
libswresample
/
swresample
.
h
>
29
#
include
<
libavutil
/
avutil
.
h
>
30
#
include
<
libswscale
/
swscale
.
h
>
31
}
32
33
static_assert
(LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(56, 70, 100),
34
"FFmpeg 4.4 or newer is required (libavutil >= 56.70)"
);
35
36
#
define
QT_FFMPEG_HAS_AV_CHANNEL_LAYOUT
37
(
LIBAVCODEC_VERSION_INT
>=
AV_VERSION_INT
(
59
,
24
,
100
)
)
// since FFmpeg n5.1
38
#
define
QT_FFMPEG_HAS_FRAME_TIME_BASE
39
(
LIBAVCODEC_VERSION_INT
>=
AV_VERSION_INT
(
59
,
18
,
100
)
)
// since FFmpeg n5.0
40
#
define
QT_FFMPEG_HAS_FRAME_DURATION
41
(
LIBAVCODEC_VERSION_INT
>=
AV_VERSION_INT
(
60
,
3
,
100
)
)
// since FFmpeg n6.0
42
#
define
QT_FFMPEG_STREAM_SIDE_DATA_DEPRECATED
43
(
LIBAVCODEC_VERSION_INT
>=
AV_VERSION_INT
(
60
,
15
,
100
)
)
// since FFmpeg n6.1
44
#
define
QT_FFMPEG_HAS_D3D12VA
45
(
LIBAVUTIL_VERSION_INT
>=
AV_VERSION_INT
(
59
,
8
,
100
)
)
// since FFmpeg n7.0
46
#
define
QT_FFMPEG_SWR_CONST_CH_LAYOUT
47
(
LIBSWRESAMPLE_VERSION_INT
>=
AV_VERSION_INT
(
4
,
9
,
100
)
)
48
#
define
QT_FFMPEG_AVIO_WRITE_CONST
49
(
LIBAVFORMAT_VERSION_MAJOR
>=
61
)
50
#
define
QT_CODEC_PARAMETERS_HAVE_FRAMERATE
51
(
LIBAVCODEC_VERSION_INT
>=
AV_VERSION_INT
(
60
,
11
,
100
)
)
// since FFmpeg n6.1
52
#
define
QT_FFMPEG_HAS_AVCODEC_GET_SUPPORTED_CONFIG
53
(
LIBAVUTIL_VERSION_INT
>=
AV_VERSION_INT
(
59
,
39
,
100
)
)
// since FFmpeg n7.1
54
#
define
QT_FFMPEG_HAS_SWS_FLAGS_ENUM
55
(
LIBSWSCALE_VERSION_INT
>=
AV_VERSION_INT
(
9
,
1
,
100
)
)
// since FFmpeg n8.0
56
57
QT_BEGIN_NAMESPACE
58
59
namespace
QFFmpeg
{
60
61
#
if
QT_FFMPEG_HAS_AV_CHANNEL_LAYOUT
62
using
ChannelLayoutT
= AVChannelLayout;
63
#
else
64
using
ChannelLayoutT
=
uint64_t
;
65
#
endif
66
67
#
if
!
QT_FFMPEG_HAS_SWS_FLAGS_ENUM
68
using
SwsFlags
=
int
;
69
#
endif
70
71
enum
class
AVScore
:
int
{
72
BestAVScore
=
std
::numeric_limits<
int
>::max(),
73
DefaultAVScore
= 0,
74
NotSuitableAVScore
=
std
::numeric_limits<
int
>::min(),
75
MinAVScore
=
std
::numeric_limits<
int
>::min() + 1,
76
};
77
78
inline
constexpr
AVScore
BestAVScore
=
AVScore
::
BestAVScore
;
79
inline
constexpr
AVScore
DefaultAVScore
=
AVScore
::
DefaultAVScore
;
80
inline
constexpr
AVScore
NotSuitableAVScore
=
AVScore
::
NotSuitableAVScore
;
81
inline
constexpr
AVScore
MinAVScore
=
AVScore
::
MinAVScore
;
82
83
constexpr
inline
AVScore
operator
+(
AVScore
a,
int
b)
84
{
85
return
AVScore
(qToUnderlying(a) + b);
86
}
87
constexpr
inline
AVScore
operator
-(
AVScore
a,
int
b)
88
{
89
return
AVScore
(qToUnderlying(a) - b);
90
}
91
constexpr
inline
AVScore
operator
+(
int
a,
AVScore
b)
92
{
93
return
AVScore
(a + qToUnderlying(b));
94
}
95
constexpr
inline
AVScore
operator
-(
int
a,
AVScore
b)
96
{
97
return
AVScore
(a - qToUnderlying(b));
98
}
99
constexpr
inline
AVScore
operator
-(
AVScore
a,
AVScore
b)
100
{
101
return
AVScore
(qToUnderlying(a) - qToUnderlying(b));
102
}
103
constexpr
inline
AVScore
&
operator
+=(
AVScore
&a,
int
b)
104
{
105
return
a = a
+
b;
106
}
107
constexpr
inline
AVScore
&
operator
-=(
AVScore
&a,
int
b)
108
{
109
return
a = a
-
b;
110
}
111
constexpr
AVScore
operator
-(
const
AVScore
&d)
112
{
113
return
AVScore
(-qToUnderlying(d));
114
}
115
116
inline
QDebug
operator
<<(QDebug dbg,
AVScore
score)
117
{
118
dbg << qToUnderlying(score);
119
return
dbg;
120
}
121
122
using
PixelOrSampleFormat
=
std
::variant<AVPixelFormat, AVSampleFormat>;
123
124
namespace
Literals
{
125
126
constexpr
AVScore
operator
""_avscore
(
unsigned
long
long
arg)
127
{
128
return
AVScore
(arg);
129
}
130
131
}
// namespace Literals
132
133
}
// namespace QFFmpeg
134
135
QT_END_NAMESPACE
136
137
namespace
std
{
138
139
template
<>
140
struct
numeric_limits
<QT_PREPEND_NAMESPACE(
QFFmpeg
)::
AVScore
>
141
{
142
using
Type
= QT_PREPEND_NAMESPACE(
QFFmpeg
)::
AVScore
;
143
constexpr
static
Type
min
()
noexcept
{
return
Type
::
NotSuitableAVScore
; }
144
constexpr
static
Type
max
()
noexcept
{
return
Type
::
BestAVScore
; }
145
};
146
147
}
// namespace std
148
149
#
ifndef
AV_PROFILE_H264_HIGH
150
#
define
AV_PROFILE_H264_HIGH
FF_PROFILE_H264_HIGH
151
#
endif
152
#
ifndef
AV_PROFILE_HEVC_MAIN
153
#
define
AV_PROFILE_HEVC_MAIN
FF_PROFILE_HEVC_MAIN
154
#
endif
155
156
#
endif
// QFFMPEGDEFS_P_H
QFFmpeg::Literals
Definition
qffmpegdefs_p.h:124
QFFmpeg::Literals::operator""_avscore
constexpr AVScore operator""_avscore(unsigned long long arg)
Definition
qffmpegdefs_p.h:126
QFFmpeg
Definition
qandroidcacertificates.cpp:26
QFFmpeg::writeQIODevice
int writeQIODevice(void *opaque, AvioWriteBufferType buf, int buf_size)
Definition
qffmpegioutils.cpp:22
QFFmpeg::BestAVScore
constexpr AVScore BestAVScore
Definition
qffmpegdefs_p.h:78
QFFmpeg::AVScore
AVScore
Definition
qffmpegdefs_p.h:71
QFFmpeg::AVScore::MinAVScore
@ MinAVScore
Definition
qffmpegdefs_p.h:75
QFFmpeg::AVScore::DefaultAVScore
@ DefaultAVScore
Definition
qffmpegdefs_p.h:73
QFFmpeg::AVScore::BestAVScore
@ BestAVScore
Definition
qffmpegdefs_p.h:72
QFFmpeg::AVScore::NotSuitableAVScore
@ NotSuitableAVScore
Definition
qffmpegdefs_p.h:74
QFFmpeg::operator+
constexpr AVScore operator+(AVScore a, int b)
Definition
qffmpegdefs_p.h:83
QFFmpeg::operator-=
constexpr AVScore & operator-=(AVScore &a, int b)
Definition
qffmpegdefs_p.h:107
QFFmpeg::PixelOrSampleFormat
std::variant< AVPixelFormat, AVSampleFormat > PixelOrSampleFormat
Definition
qffmpegdefs_p.h:122
QFFmpeg::operator-
constexpr AVScore operator-(const AVScore &d)
Definition
qffmpegdefs_p.h:111
QFFmpeg::operator+
constexpr AVScore operator+(int a, AVScore b)
Definition
qffmpegdefs_p.h:91
QFFmpeg::DefaultAVScore
constexpr AVScore DefaultAVScore
Definition
qffmpegdefs_p.h:79
QFFmpeg::operator+=
constexpr AVScore & operator+=(AVScore &a, int b)
Definition
qffmpegdefs_p.h:103
QFFmpeg::operator-
constexpr AVScore operator-(int a, AVScore b)
Definition
qffmpegdefs_p.h:95
QFFmpeg::operator-
constexpr AVScore operator-(AVScore a, AVScore b)
Definition
qffmpegdefs_p.h:99
QFFmpeg::NotSuitableAVScore
constexpr AVScore NotSuitableAVScore
Definition
qffmpegdefs_p.h:80
QFFmpeg::ChannelLayoutT
AVChannelLayout ChannelLayoutT
Definition
qffmpegdefs_p.h:62
QFFmpeg::operator<<
QDebug operator<<(QDebug dbg, AVScore score)
Definition
qffmpegdefs_p.h:116
QFFmpeg::MinAVScore
constexpr AVScore MinAVScore
Definition
qffmpegdefs_p.h:81
QFFmpeg::operator-
constexpr AVScore operator-(AVScore a, int b)
Definition
qffmpegdefs_p.h:87
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
AV_PROFILE_HEVC_MAIN
#define AV_PROFILE_HEVC_MAIN
Definition
qffmpegdefs_p.h:153
AV_PROFILE_H264_HIGH
#define AV_PROFILE_H264_HIGH
Definition
qffmpegdefs_p.h:150
QT_FFMPEG_HAS_SWS_FLAGS_ENUM
#define QT_FFMPEG_HAS_SWS_FLAGS_ENUM
Definition
qffmpegdefs_p.h:54
QT_FFMPEG_HAS_AV_CHANNEL_LAYOUT
#define QT_FFMPEG_HAS_AV_CHANNEL_LAYOUT
Definition
qffmpegdefs_p.h:36
QT_BEGIN_NAMESPACE
#define QT_BEGIN_NAMESPACE
Definition
qtconfigmacros.h:161
QT_END_NAMESPACE
#define QT_END_NAMESPACE
Definition
qtconfigmacros.h:162
std::numeric_limits< QT_PREPEND_NAMESPACE(QFFmpeg)::AVScore >
Definition
qffmpegdefs_p.h:141
std::numeric_limits< QT_PREPEND_NAMESPACE(QFFmpeg)::AVScore >::Type
QT_PREPEND_NAMESPACE(QFFmpeg)::AVScore Type
Definition
qffmpegdefs_p.h:142
std::numeric_limits< QT_PREPEND_NAMESPACE(QFFmpeg)::AVScore >::max
static constexpr Type max() noexcept
Definition
qffmpegdefs_p.h:144
std::numeric_limits< QT_PREPEND_NAMESPACE(QFFmpeg)::AVScore >::min
static constexpr Type min() noexcept
Definition
qffmpegdefs_p.h:143
qtmultimedia
src
plugins
multimedia
ffmpeg
qffmpegdefs_p.h
Generated on
for Qt by
1.18.0