Dynamically load FFmpeg and libfdk-aac if available. (#6570)

This commit is contained in:
Steveice10 2023-06-16 16:06:18 -07:00 committed by GitHub
parent d807cdfe62
commit 38435e9b3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 1311 additions and 877 deletions

View file

@ -10,10 +10,6 @@
#include "common/string_util.h"
#include "ui_option_set_dialog.h"
extern "C" {
#include <libavutil/pixdesc.h>
}
static const std::unordered_map<AVOptionType, const char*> TypeNameMap{{
{AV_OPT_TYPE_BOOL, QT_TR_NOOP("boolean")},
{AV_OPT_TYPE_FLAGS, QT_TR_NOOP("flags")},
@ -56,21 +52,14 @@ std::vector<std::pair<QString, QString>> GetPresetValues(const VideoDumper::Opti
}
case AV_OPT_TYPE_PIXEL_FMT: {
std::vector<std::pair<QString, QString>> out{{QObject::tr("none"), QStringLiteral("none")}};
// List all pixel formats
const AVPixFmtDescriptor* current = nullptr;
while ((current = av_pix_fmt_desc_next(current))) {
out.emplace_back(QString::fromUtf8(current->name), QString::fromUtf8(current->name));
for (const auto& name : VideoDumper::GetPixelFormats()) {
out.emplace_back(QString::fromUtf8(name), QString::fromUtf8(name));
}
return out;
}
case AV_OPT_TYPE_SAMPLE_FMT: {
std::vector<std::pair<QString, QString>> out{{QObject::tr("none"), QStringLiteral("none")}};
// List all sample formats
int current = 0;
while (true) {
const char* name = av_get_sample_fmt_name(static_cast<AVSampleFormat>(current));
if (name == nullptr)
break;
for (const auto& name : VideoDumper::GetSampleFormats()) {
out.emplace_back(QString::fromUtf8(name), QString::fromUtf8(name));
}
return out;