Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qffmpeg.cpp
Go to the documentation of this file.
1// Copyright (C) 2021 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#include "qffmpeg_p.h"
5
6#include <QtCore/qdebug.h>
7#include <QtCore/qloggingcategory.h>
8#include <QtCore/qscopeguard.h>
9
10extern "C" {
11#include <libavutil/pixdesc.h>
12#include <libavutil/samplefmt.h>
13#include <libavutil/error.h>
14
15#ifdef Q_OS_DARWIN
16#include <libavutil/hwcontext_videotoolbox.h>
17#endif
18}
19
21
22Q_STATIC_LOGGING_CATEGORY(qLcFFmpegUtils, "qt.multimedia.ffmpeg.utils");
23
24namespace QFFmpeg {
25
26namespace {
27bool isAVFormatSupported(const Codec &codec, AVPixelFormat format)
28{
29 if (codec.type() == AVMEDIA_TYPE_VIDEO) {
30 auto checkFormat = [format](AVPixelFormat f) {
31 return f == format;
32 };
33 return findAVPixelFormat(codec, checkFormat).has_value();
34 }
35 return false;
36}
37
38bool isAVFormatSupported(const Codec &codec, AVSampleFormat format)
39{
40 if (codec.type() == AVMEDIA_TYPE_AUDIO) {
41 const auto sampleFormats = codec.sampleFormats();
42 return ranges::contains(sampleFormats, format);
43 }
44 return false;
45}
46} // namespace
47
48bool isAVFormatSupported(const Codec &codec, const PixelOrSampleFormat &format)
49{
50 return std::visit([&](auto fmt) {
51 return isAVFormatSupported(codec, fmt);
52 }, format);
53}
54
55bool isHwPixelFormat(AVPixelFormat format)
56{
57 const auto desc = av_pix_fmt_desc_get(format);
58 return desc && (desc->flags & AV_PIX_FMT_FLAG_HWACCEL) != 0;
59}
60
61void applyExperimentalCodecOptions(const Codec &codec, AVDictionary **opts)
62{
63 if (codec.isExperimental()) {
64 qCWarning(qLcFFmpegUtils) << "Applying the option 'strict -2' for the experimental codec"
65 << codec.name() << ". it's unlikely to work properly";
66 av_dict_set(opts, "strict", "-2", 0);
67 }
68}
69
70AVPixelFormat pixelFormatForHwDevice(AVHWDeviceType deviceType)
71{
72 switch (deviceType) {
73 case AV_HWDEVICE_TYPE_VIDEOTOOLBOX:
74 return AV_PIX_FMT_VIDEOTOOLBOX;
75 case AV_HWDEVICE_TYPE_VAAPI:
76 return AV_PIX_FMT_VAAPI;
77 case AV_HWDEVICE_TYPE_MEDIACODEC:
78 return AV_PIX_FMT_MEDIACODEC;
79 case AV_HWDEVICE_TYPE_CUDA:
80 return AV_PIX_FMT_CUDA;
81 case AV_HWDEVICE_TYPE_VDPAU:
82 return AV_PIX_FMT_VDPAU;
83 case AV_HWDEVICE_TYPE_OPENCL:
84 return AV_PIX_FMT_OPENCL;
85 case AV_HWDEVICE_TYPE_QSV:
86 return AV_PIX_FMT_QSV;
87 case AV_HWDEVICE_TYPE_D3D11VA:
88 return AV_PIX_FMT_D3D11;
89#if QT_FFMPEG_HAS_D3D12VA
90 case AV_HWDEVICE_TYPE_D3D12VA:
91 return AV_PIX_FMT_D3D12;
92#endif
93 case AV_HWDEVICE_TYPE_DXVA2:
94 return AV_PIX_FMT_DXVA2_VLD;
95 case AV_HWDEVICE_TYPE_DRM:
96 return AV_PIX_FMT_DRM_PRIME;
97 case AV_HWDEVICE_TYPE_VULKAN:
98 return AV_PIX_FMT_VULKAN;
99 default:
100 return AV_PIX_FMT_NONE;
101 }
102}
103
104AVPacketSideData *addStreamSideData(AVStream *stream, AVPacketSideData sideData)
105{
106 QScopeGuard freeData([&sideData]() { av_free(sideData.data); });
107#if QT_FFMPEG_STREAM_SIDE_DATA_DEPRECATED
108 AVPacketSideData *result = av_packet_side_data_add(
109 &stream->codecpar->coded_side_data,
110 &stream->codecpar->nb_coded_side_data,
111 sideData.type,
112 sideData.data,
113 sideData.size,
114 0);
115 if (result) {
116 // If the result is not null, the ownership is taken by AVStream,
117 // otherwise the data must be deleted.
118 freeData.dismiss();
119 return result;
120 }
121#else
122 Q_UNUSED(stream);
123 // TODO: implement for older FFmpeg versions
124 qWarning() << "Adding stream side data is not supported for FFmpeg < 6.1";
125#endif
126
127 return nullptr;
128}
129
130const AVPacketSideData *streamSideData(const AVStream *stream, AVPacketSideDataType type)
131{
132 Q_ASSERT(stream);
133
134#if QT_FFMPEG_STREAM_SIDE_DATA_DEPRECATED
135 return av_packet_side_data_get(stream->codecpar->coded_side_data,
136 stream->codecpar->nb_coded_side_data, type);
137#else
138 const auto end = stream->side_data + stream->nb_side_data;
139 const auto found = std::find_if(stream->side_data, end, [&](const auto &item) {
140 return item.type == type;
141 });
142 return found == end ? nullptr : found;
143#endif
144}
145
146SwrContextUPtr createResampleContext(const AVAudioFormat &inputFormat,
147 const AVAudioFormat &outputFormat)
148{
149 SwrContext *resampler = nullptr;
150#if QT_FFMPEG_HAS_AV_CHANNEL_LAYOUT
151
152#if QT_FFMPEG_SWR_CONST_CH_LAYOUT
153 using AVChannelLayoutPrm = const AVChannelLayout*;
154#else
155 using AVChannelLayoutPrm = AVChannelLayout*;
156#endif
157
158 swr_alloc_set_opts2(&resampler,
159 const_cast<AVChannelLayoutPrm>(&outputFormat.channelLayout),
160 outputFormat.sampleFormat,
161 outputFormat.sampleRate,
162 const_cast<AVChannelLayoutPrm>(&inputFormat.channelLayout),
163 inputFormat.sampleFormat,
164 inputFormat.sampleRate,
165 0,
166 nullptr);
167
168#else
169
170 resampler = swr_alloc_set_opts(nullptr,
171 outputFormat.channelLayoutMask,
172 outputFormat.sampleFormat,
173 outputFormat.sampleRate,
174 inputFormat.channelLayoutMask,
175 inputFormat.sampleFormat,
176 inputFormat.sampleRate,
177 0,
178 nullptr);
179
180#endif
181
182 auto error = QFFmpeg::AVError{
183 swr_init(resampler),
184 };
185 if (error != QFFmpeg::AVError::Success) {
186 qCWarning(qLcFFmpegUtils) << "Failed to initialize audio resampler:" << error;
187 return nullptr;
188 }
189 return SwrContextUPtr(resampler);
190}
191
192QVideoFrameFormat::ColorTransfer fromAvColorTransfer(AVColorTransferCharacteristic colorTrc) {
193 switch (colorTrc) {
194 case AVCOL_TRC_BT709:
195 // The following three cases have transfer characteristics identical to BT709
196 case AVCOL_TRC_BT1361_ECG:
197 case AVCOL_TRC_BT2020_10:
198 case AVCOL_TRC_BT2020_12:
199 case AVCOL_TRC_SMPTE240M: // almost identical to bt709
200 return QVideoFrameFormat::ColorTransfer_BT709;
201 case AVCOL_TRC_GAMMA22:
202 case AVCOL_TRC_SMPTE428: // No idea, let's hope for the best...
203 case AVCOL_TRC_IEC61966_2_1: // sRGB, close enough to 2.2...
204 case AVCOL_TRC_IEC61966_2_4: // not quite, but probably close enough
205 return QVideoFrameFormat::ColorTransfer_Gamma22;
206 case AVCOL_TRC_GAMMA28:
207 return QVideoFrameFormat::ColorTransfer_Gamma28;
208 case AVCOL_TRC_SMPTE170M:
209 return QVideoFrameFormat::ColorTransfer_BT601;
210 case AVCOL_TRC_LINEAR:
211 return QVideoFrameFormat::ColorTransfer_Linear;
212 case AVCOL_TRC_SMPTE2084:
213 return QVideoFrameFormat::ColorTransfer_ST2084;
214 case AVCOL_TRC_ARIB_STD_B67:
215 return QVideoFrameFormat::ColorTransfer_STD_B67;
216 default:
217 break;
218 }
219 return QVideoFrameFormat::ColorTransfer_Unknown;
220}
221
222AVColorTransferCharacteristic toAvColorTransfer(QVideoFrameFormat::ColorTransfer colorTrc)
223{
224 switch (colorTrc) {
225 case QVideoFrameFormat::ColorTransfer_BT709:
226 return AVCOL_TRC_BT709;
227 case QVideoFrameFormat::ColorTransfer_BT601:
228 return AVCOL_TRC_BT709; // which one is the best?
229 case QVideoFrameFormat::ColorTransfer_Linear:
230 return AVCOL_TRC_SMPTE2084;
231 case QVideoFrameFormat::ColorTransfer_Gamma22:
232 return AVCOL_TRC_GAMMA22;
233 case QVideoFrameFormat::ColorTransfer_Gamma28:
234 return AVCOL_TRC_GAMMA28;
235 case QVideoFrameFormat::ColorTransfer_ST2084:
236 return AVCOL_TRC_SMPTE2084;
237 case QVideoFrameFormat::ColorTransfer_STD_B67:
238 return AVCOL_TRC_ARIB_STD_B67;
239 default:
240 return AVCOL_TRC_UNSPECIFIED;
241 }
242}
243
245{
246 switch (colorSpace) {
247 default:
248 case AVCOL_SPC_UNSPECIFIED:
249 case AVCOL_SPC_RESERVED:
250 case AVCOL_SPC_FCC:
251 case AVCOL_SPC_SMPTE240M:
252 case AVCOL_SPC_YCGCO:
253 case AVCOL_SPC_SMPTE2085:
254 case AVCOL_SPC_CHROMA_DERIVED_NCL:
255 case AVCOL_SPC_CHROMA_DERIVED_CL:
256 case AVCOL_SPC_ICTCP: // BT.2100 ICtCp
257 return QVideoFrameFormat::ColorSpace_Undefined;
258 case AVCOL_SPC_RGB:
259 return QVideoFrameFormat::ColorSpace_AdobeRgb;
260 case AVCOL_SPC_BT709:
261 return QVideoFrameFormat::ColorSpace_BT709;
262 case AVCOL_SPC_BT470BG: // BT601
263 case AVCOL_SPC_SMPTE170M: // Also BT601
264 return QVideoFrameFormat::ColorSpace_BT601;
265 case AVCOL_SPC_BT2020_NCL: // Non constant luminence
266 case AVCOL_SPC_BT2020_CL: // Constant luminence
267 return QVideoFrameFormat::ColorSpace_BT2020;
268 }
269}
270
271AVColorSpace toAvColorSpace(QVideoFrameFormat::ColorSpace colorSpace)
272{
273 switch (colorSpace) {
274 case QVideoFrameFormat::ColorSpace_BT601:
275 return AVCOL_SPC_BT470BG;
276 case QVideoFrameFormat::ColorSpace_BT709:
277 return AVCOL_SPC_BT709;
278 case QVideoFrameFormat::ColorSpace_AdobeRgb:
279 return AVCOL_SPC_RGB;
280 case QVideoFrameFormat::ColorSpace_BT2020:
281 return AVCOL_SPC_BT2020_CL;
282 default:
283 return AVCOL_SPC_UNSPECIFIED;
284 }
285}
286
288{
289 switch (colorRange) {
290 case AVCOL_RANGE_MPEG:
291 return QVideoFrameFormat::ColorRange_Video;
292 case AVCOL_RANGE_JPEG:
293 return QVideoFrameFormat::ColorRange_Full;
294 default:
295 return QVideoFrameFormat::ColorRange_Unknown;
296 }
297}
298
299AVColorRange toAvColorRange(QVideoFrameFormat::ColorRange colorRange)
300{
301 switch (colorRange) {
302 case QVideoFrameFormat::ColorRange_Video:
303 return AVCOL_RANGE_MPEG;
304 case QVideoFrameFormat::ColorRange_Full:
305 return AVCOL_RANGE_JPEG;
306 default:
307 return AVCOL_RANGE_UNSPECIFIED;
308 }
309}
310
312 if (!frame)
313 return {};
314 if (!frame->hw_frames_ctx)
315 return {};
316
317 const auto *frameCtx = reinterpret_cast<AVHWFramesContext *>(frame->hw_frames_ctx->data);
318 if (!frameCtx)
319 return {};
320
321 return frameCtx->device_ctx;
322}
323
324SwsContextUPtr createSwsContext(const QSize &srcSize, AVPixelFormat srcPixFmt, const QSize &dstSize,
325 AVPixelFormat dstPixFmt, SwsFlags conversionType)
326{
327
328 SwsContext *result =
329 sws_getContext(srcSize.width(), srcSize.height(), srcPixFmt, dstSize.width(),
330 dstSize.height(), dstPixFmt, conversionType, nullptr, nullptr, nullptr);
331
332 if (!result)
333 qCWarning(qLcFFmpegUtils) << "Cannot create sws context for:\n"
334 << "srcSize:" << srcSize
335 << "srcPixFmt:" << srcPixFmt
336 << "dstSize:" << dstSize
337 << "dstPixFmt:" << dstPixFmt
338 << "conversionType:" << conversionType;
339
340 return SwsContextUPtr(result);
341}
342
343void freeAVIOContext(AVIOContext *&ctx)
344{
345 if (ctx == nullptr)
346 return;
347 av_freep(&ctx->buffer);
348 avio_context_free(&ctx);
349 Q_ASSERT(ctx == nullptr);
350}
351
352QSize frameSize(const AVFrame &frame)
353{
354 return QSize(frame.width, frame.height);
355}
356
357QSize frameSize(const AVFrame *frame)
358{
359 return frame ? frameSize(*frame) : QSize();
360}
361
362QSize frameSize(const AVFrameUPtr &frame)
363{
364 return frame ? frameSize(*frame) : QSize();
365}
366
367#ifdef Q_OS_DARWIN
369{
371}
372
374{
375 auto formatDescIt = std::make_reverse_iterator(reinterpret_cast<const char *>(&cvFormat));
376 return std::string(formatDescIt - 4, formatDescIt);
377}
378
379#endif
380
381} // namespace QFFmpeg
382
383QDebug operator<<(QDebug dbg, const AVRational &value)
384{
385 dbg << value.num << "/" << value.den;
386 return dbg;
387}
388
389QDebug operator<<(QDebug dbg, const AVDictionary &dict)
390{
391 char *buffer = 0;
392 auto freeBuffer = QScopeGuard([&] {
393 av_free(buffer);
394 });
395
396 int status = av_dict_get_string(&dict, &buffer, '=', ',');
397 if (status < 0 || !buffer)
398 return dbg << "Failed to print AVDictionary";
399
400 dbg << buffer;
401 return dbg;
402}
403
404QDebug operator<<(QDebug dbg, const QFFmpeg::AVDictionaryHolder &dict)
405{
406 const AVDictionary *rawDict = dict.opts;
407 if (rawDict)
408 return dbg << *rawDict;
409 else
410 return dbg << "Empty AVDictionaryHolder";
411}
412
413QDebug operator<<(QDebug dbg, QFFmpeg::AVError error)
414{
415 if (error == QFFmpeg::AVError::Success) {
416 dbg << "Success";
417 return dbg;
418 }
419
420 char errBuf[AV_ERROR_MAX_STRING_SIZE];
421 dbg << av_make_error_string(errBuf, AV_ERROR_MAX_STRING_SIZE, qToUnderlying(error));
422 return dbg;
423}
424
425QDebug operator<<(QDebug dbg, AVPixelFormat fmt)
426{
427 const char *str = av_get_pix_fmt_name(fmt);
428 if (str)
429 dbg << str;
430 else
431 dbg << "<unknown pixel format>";
432 return dbg;
433}
434
435QDebug operator<<(QDebug dbg, AVHWDeviceType type)
436{
437 const char *str = av_hwdevice_get_type_name(type);
438 if (str)
439 dbg << str;
440 else
441 dbg << "<unknown hw device type>";
442 return dbg;
443}
444
445QDebug operator<<(QDebug dbg, AVMediaType type)
446{
447 const char *str = av_get_media_type_string(type);
448 if (str)
449 dbg << str;
450 else
451 dbg << "<unknown hw media type>";
452 return dbg;
453}
454
455QDebug operator<<(QDebug dbg, AVCodecID id)
456{
457 const char *str = avcodec_get_name(id);
458 if (str)
459 dbg << str;
460 else
461 dbg << "<unknown codec id>";
462 return dbg;
463}
464
465QDebug operator<<(QDebug dbg, const AVOutputFormat *fmt)
466{
467 if (fmt == nullptr) {
468 dbg << "<null>";
469 return dbg;
470 }
471
472 const char *str = fmt->name;
473 if (str)
474 dbg << str;
475 else
476 dbg << "<unknown output format>";
477 return dbg;
478}
479
480QDebug operator<<(QDebug dbg, const AVInputFormat *fmt)
481{
482 if (fmt == nullptr) {
483 dbg << "<null>";
484 return dbg;
485 }
486
487 const char *str = fmt->name;
488 if (str)
489 dbg << str;
490 else
491 dbg << "<unknown input format>";
492 return dbg;
493}
494
495#if QT_FFMPEG_HAS_AV_CHANNEL_LAYOUT
496QDebug operator<<(QDebug dbg, const AVChannelLayout &layout)
497{
498 dbg << '[';
499 dbg << "nb_channels:" << layout.nb_channels;
500 dbg << ", order:" << layout.order;
501
502 if (layout.order == AV_CHANNEL_ORDER_NATIVE || layout.order == AV_CHANNEL_ORDER_AMBISONIC)
503 dbg << ", mask:" << Qt::bin << layout.u.mask << Qt::dec;
504 else if (layout.order == AV_CHANNEL_ORDER_CUSTOM && layout.u.map)
505 dbg << ", id: " << layout.u.map->id;
506
507 dbg << ']';
508
509 return dbg;
510}
511#endif
512
513#if QT_FFMPEG_HAS_AVCODEC_GET_SUPPORTED_CONFIG
514QDebug operator<<(QDebug dbg, const AVCodecConfig value)
515{
516 switch (value) {
517 case AV_CODEC_CONFIG_CHANNEL_LAYOUT:
518 dbg << "AV_CODEC_CONFIG_CHANNEL_LAYOUT";
519 break;
520 case AV_CODEC_CONFIG_COLOR_RANGE:
521 dbg << "AV_CODEC_CONFIG_COLOR_RANGE";
522 break;
523 case AV_CODEC_CONFIG_COLOR_SPACE:
524 dbg << "AV_CODEC_CONFIG_COLOR_SPACE";
525 break;
526 case AV_CODEC_CONFIG_FRAME_RATE:
527 dbg << "AV_CODEC_CONFIG_FRAME_RATE";
528 break;
529 case AV_CODEC_CONFIG_PIX_FORMAT:
530 dbg << "AV_CODEC_CONFIG_PIX_FORMAT";
531 break;
532 case AV_CODEC_CONFIG_SAMPLE_FORMAT:
533 dbg << "AV_CODEC_CONFIG_SAMPLE_FORMAT";
534 break;
535 case AV_CODEC_CONFIG_SAMPLE_RATE:
536 dbg << "AV_CODEC_CONFIG_SAMPLE_RATE";
537 break;
538 default:
539 dbg << "<UNKNOWN_CODEC_CONFIG>";
540 break;
541 }
542
543 return dbg;
544}
545#endif
546
547namespace {
548
549struct FlagName {
550 int value;
551 const char *name;
552};
553
554QString flagsToString(int flags, const QSpan<const FlagName> &flagNames)
555{
556 QString result;
557 int leftover = flags;
558 for (const auto &flagAndName : flagNames)
559 if ((flags & flagAndName.value) != 0) {
560 leftover &= ~flagAndName.value;
561 if (!result.isEmpty())
562 result += u", ";
563 result += QLatin1StringView(flagAndName.name);
564 }
565
566 if (leftover) {
567 if (!result.isEmpty())
568 result += u", ";
569 result += QString::number(leftover, 16);
570 }
571 return result;
572}
573
574} // namespace
575
577{
578 static constexpr std::array<FlagName, 21> flagNames = {{
579 { AV_CODEC_CAP_DRAW_HORIZ_BAND, "DRAW_HORIZ_BAND" },
580 { AV_CODEC_CAP_DR1, "DR1" },
581 { AV_CODEC_CAP_DELAY, "DELAY" },
582 { AV_CODEC_CAP_SMALL_LAST_FRAME, "SMALL_LAST_FRAME" },
583#ifdef AV_CODEC_CAP_SUBFRAMES
584 { AV_CODEC_CAP_SUBFRAMES, "SUBFRAMES" },
585#endif
586 { AV_CODEC_CAP_EXPERIMENTAL, "EXPERIMENTAL" },
587 { AV_CODEC_CAP_CHANNEL_CONF, "CHANNEL_CONF" },
588 { AV_CODEC_CAP_FRAME_THREADS, "FRAME_THREADS" },
589 { AV_CODEC_CAP_SLICE_THREADS, "SLICE_THREADS" },
590 { AV_CODEC_CAP_PARAM_CHANGE, "PARAM_CHANGE" },
591 { AV_CODEC_CAP_OTHER_THREADS, "OTHER_THREADS" },
592 { AV_CODEC_CAP_VARIABLE_FRAME_SIZE, "VARIABLE_FRAME_SIZE" },
593 { AV_CODEC_CAP_AVOID_PROBING, "AVOID_PROBING" },
594 { AV_CODEC_CAP_HARDWARE, "HARDWARE" },
595 { AV_CODEC_CAP_HYBRID, "HYBRID" },
596 { AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, "ENCODER_REORDERED_OPAQUE" },
597 { AV_CODEC_CAP_ENCODER_FLUSH, "ENCODER_FLUSH" },
598 }};
599 return flagsToString(qToUnderlying(capabilities), QSpan(flagNames));
600}
601
603{
604 static constexpr std::array<FlagName, 9> flagNames = {{
605 { AV_PIX_FMT_FLAG_BE, "BE" },
606 { AV_PIX_FMT_FLAG_PAL, "PAL" },
607 { AV_PIX_FMT_FLAG_BITSTREAM, "BITSTREAM" },
608 { AV_PIX_FMT_FLAG_HWACCEL, "HWACCEL" },
609 { AV_PIX_FMT_FLAG_PLANAR, "PLANAR" },
610 { AV_PIX_FMT_FLAG_RGB, "RGB" },
611 { AV_PIX_FMT_FLAG_ALPHA, "ALPHA" },
612 { AV_PIX_FMT_FLAG_BAYER, "BAYER" },
613 { AV_PIX_FMT_FLAG_FLOAT, "FLOAT" },
614 }};
615 return flagsToString(qToUnderlying(flags), QSpan(flagNames));
616}
617
619{
620 static constexpr std::array<FlagName, 4> flagNames = {{
621 { AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX, "HW_DEVICE_CTX" },
622 { AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX, "HW_FRAMES_CTX" },
623 { AV_CODEC_HW_CONFIG_METHOD_INTERNAL, "INTERNAL" },
624 { AV_CODEC_HW_CONFIG_METHOD_AD_HOC, "AD_HOC" }
625 }};
626 return flagsToString(qToUnderlying(methods), QSpan(flagNames));
627}
628
630{
631 return dbg << QFFmpeg::toString(caps);
632}
633
635{
636 return dbg << QFFmpeg::toString(flags);
637}
638
640{
641 return dbg << QFFmpeg::toString(methods);
642}
643
644QT_END_NAMESPACE
QSize frameSize(const AVFrame &frame)
Definition qffmpeg.cpp:352
AVColorSpace toAvColorSpace(QVideoFrameFormat::ColorSpace colorSpace)
Definition qffmpeg.cpp:271
SwsContextUPtr createSwsContext(const QSize &srcSize, AVPixelFormat srcPixFmt, const QSize &dstSize, AVPixelFormat dstPixFmt, SwsFlags conversionType)
Definition qffmpeg.cpp:324
void applyExperimentalCodecOptions(const Codec &codec, AVDictionary **opts)
Definition qffmpeg.cpp:61
bool isHwPixelFormat(AVPixelFormat format)
Definition qffmpeg.cpp:55
AVPacketSideData * addStreamSideData(AVStream *stream, AVPacketSideData sideData)
Definition qffmpeg.cpp:104
QSize frameSize(const AVFrame *frame)
Definition qffmpeg.cpp:357
AVHWDeviceContext * avFrameDeviceContext(const AVFrame *frame)
Definition qffmpeg.cpp:311
AVColorTransferCharacteristic toAvColorTransfer(QVideoFrameFormat::ColorTransfer colorTrc)
Definition qffmpeg.cpp:222
AVCodecCapabilities
Definition qffmpeg_p.h:354
QString toString(AVPixelFormatFlags flags)
Definition qffmpeg.cpp:602
QVideoFrameFormat::ColorSpace fromAvColorSpace(AVColorSpace colorSpace)
Definition qffmpeg.cpp:244
QVideoFrameFormat::ColorTransfer fromAvColorTransfer(AVColorTransferCharacteristic colorTrc)
Definition qffmpeg.cpp:192
AVPixelFormatFlags
Definition qffmpeg_p.h:355
void freeAVIOContext(AVIOContext *&ctx)
Definition qffmpeg.cpp:343
QVideoFrameFormat::ColorRange fromAvColorRange(AVColorRange colorRange)
Definition qffmpeg.cpp:287
SwrContextUPtr createResampleContext(const AVAudioFormat &inputFormat, const AVAudioFormat &outputFormat)
Definition qffmpeg.cpp:146
AVPixelFormat pixelFormatForHwDevice(AVHWDeviceType deviceType)
Definition qffmpeg.cpp:70
AVHwConfigMethods
Definition qffmpeg_p.h:356
QString toString(AVCodecCapabilities capabilities)
Definition qffmpeg.cpp:576
bool isAVFormatSupported(const Codec &codec, const PixelOrSampleFormat &format)
Definition qffmpeg.cpp:48
const AVPacketSideData * streamSideData(const AVStream *stream, AVPacketSideDataType type)
Definition qffmpeg.cpp:130
AVColorRange toAvColorRange(QVideoFrameFormat::ColorRange colorRange)
Definition qffmpeg.cpp:299
QString toString(AVHwConfigMethods methods)
Definition qffmpeg.cpp:618
QDebug operator<<(QDebug dbg, const NSObject *nsObject)
Definition qcore_mac.mm:209
QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition qdir.cpp:2620
QDebug operator<<(QDebug dbg, const QFFmpeg::AVDictionaryHolder &dict)
Definition qffmpeg.cpp:404
QDebug operator<<(QDebug dbg, QFFmpeg::AVCodecCapabilities caps)
Definition qffmpeg.cpp:629
QDebug operator<<(QDebug dbg, QFFmpeg::AVPixelFormatFlags flags)
Definition qffmpeg.cpp:634
QDebug operator<<(QDebug dbg, QFFmpeg::AVHwConfigMethods methods)
Definition qffmpeg.cpp:639
QDebug operator<<(QDebug dbg, QFFmpeg::AVError error)
Definition qffmpeg.cpp:413
QDebug operator<<(QDebug dbg, const QFileInfo &fi)
QT_BEGIN_NAMESPACE Q_STATIC_LOGGING_CATEGORY(lcSynthesizedIterableAccess, "qt.iterable.synthesized", QtWarningMsg)