37 return AV_CODEC_ID_NONE;
63 return AV_CODEC_ID_NONE;
91template <
typename AVFormat>
100 if (
m->mimeType && !strcmp(
m->mimeType,
format->mime_type)) {
103 if (!
m->name || !strcmp(
m->name,
format->name))
104 return m->fileFormat;
122 return av_guess_format(
m->name,
nullptr,
m->mimeType);
132 qCDebug(qLcMediaFormatInfo) <<
">>>> listing codecs";
139 const AVCodecDescriptor *descriptor =
nullptr;
140 while ((descriptor = avcodec_descriptor_next(descriptor))) {
147 if (!videoEncoders.
contains(videoCodec))
148 videoEncoders.
append(videoCodec);
149 }
else if (canDecode) {
150 if (!extraVideoDecoders.
contains(videoCodec))
151 extraVideoDecoders.
append(videoCodec);
153 }
else if (descriptor->type == AVMEDIA_TYPE_AUDIO
156 if (!audioEncoders.
contains(audioCodec))
157 audioEncoders.
append(audioCodec);
158 }
else if (canDecode) {
159 if (!extraAudioDecoders.
contains(audioCodec))
160 extraAudioDecoders.
append(audioCodec);
167 void *opaque =
nullptr;
168 const AVOutputFormat *outputFormat =
nullptr;
169 while ((outputFormat = av_muxer_iterate(&opaque))) {
176 encoder.
format = mediaFormat;
178 for (
auto codec : audioEncoders) {
181 if (avformat_query_codec(outputFormat,
id, FF_COMPLIANCE_NORMAL) == 1) {
187 for (
auto codec : videoEncoders) {
190 if (avformat_query_codec(outputFormat,
id, FF_COMPLIANCE_NORMAL) == 1) {
232 encoder.video.removeAt(h265index);
250 for (
const auto &
f : imgFormats) {
253 else if (
f ==
"jpeg")
255 else if (
f ==
"tiff")
257 else if (
f ==
"webp")
316 if (!strncmp(
m->name,
format->name, strlen(
m->name)))
317 return m->fileFormat;
324const AVOutputFormat *
343 case AV_SAMPLE_FMT_NONE:
346 case AV_SAMPLE_FMT_U8:
347 case AV_SAMPLE_FMT_U8P:
349 case AV_SAMPLE_FMT_S16:
350 case AV_SAMPLE_FMT_S16P:
352 case AV_SAMPLE_FMT_S32:
353 case AV_SAMPLE_FMT_S32P:
355 case AV_SAMPLE_FMT_FLT:
356 case AV_SAMPLE_FMT_FLTP:
358 case AV_SAMPLE_FMT_DBL:
359 case AV_SAMPLE_FMT_DBLP:
360 case AV_SAMPLE_FMT_S64:
361 case AV_SAMPLE_FMT_S64P:
371 return AV_SAMPLE_FMT_U8;
373 return AV_SAMPLE_FMT_S16;
375 return AV_SAMPLE_FMT_S32;
377 return AV_SAMPLE_FMT_FLT;
379 return AV_SAMPLE_FMT_NONE;
425#ifdef AV_CH_TOP_SIDE_LEFT
482#ifdef AV_CH_TOP_SIDE_LEFT
501 format.setSampleRate(codecpar->sample_rate);
502#if QT_FFMPEG_OLD_CHANNEL_LAYOUT
503 uint64_t channelLayout = codecpar->channel_layout;
507 uint64_t channelLayout = 0;
508 if (codecpar->ch_layout.order == AV_CHANNEL_ORDER_NATIVE)
509 channelLayout = codecpar->ch_layout.u.mask;
static QList< QByteArray > supportedImageFormats()
Returns the list of image formats supported by QImageWriter.
bool isEmpty() const noexcept
void append(parameter_type t)
QMap< QString, QString > map
[6]
const AVCodec * findAVEncoder(AVCodecID codecId, const std::optional< AVHWDeviceType > &deviceType, const std::optional< PixelOrSampleFormat > &format)
const AVCodec * findAVDecoder(AVCodecID codecId, const std::optional< AVHWDeviceType > &deviceType, const std::optional< PixelOrSampleFormat > &format)
Combined button and popup list for selecting options.
QAudioFormat::ChannelConfig channelConfig
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
GLint GLsizei GLsizei GLenum format
bool contains(const AT &t) const noexcept