Expose videotoolbox hardware decoder (#261)

This commit is contained in:
Kaiwen Xu 2020-06-27 03:42:26 -07:00 committed by GitHub
commit 9c91843d98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View file

@ -38,6 +38,7 @@ typedef enum {
HW_DECODE_NONE = 0, HW_DECODE_NONE = 0,
HW_DECODE_VAAPI = 1, HW_DECODE_VAAPI = 1,
HW_DECODE_VDPAU = 2, HW_DECODE_VDPAU = 2,
HW_DECODE_VIDEOTOOLBOX = 3,
} HardwareDecodeEngine; } HardwareDecodeEngine;
@ -45,6 +46,7 @@ static const QMap<HardwareDecodeEngine, const char *> hardware_decode_engine_nam
{ HW_DECODE_NONE, "none"}, { HW_DECODE_NONE, "none"},
{ HW_DECODE_VAAPI, "vaapi"}, { HW_DECODE_VAAPI, "vaapi"},
{ HW_DECODE_VDPAU, "vdpau"}, { HW_DECODE_VDPAU, "vdpau"},
{ HW_DECODE_VIDEOTOOLBOX, "videotoolbox"},
}; };
class VideoDecoderException: public Exception class VideoDecoderException: public Exception

View file

@ -97,7 +97,8 @@ unsigned int Settings::GetAudioBufferSizeRaw() const
static const QMap<HardwareDecodeEngine, QString> hw_decode_engine_values = { static const QMap<HardwareDecodeEngine, QString> hw_decode_engine_values = {
{ HW_DECODE_NONE, "none" }, { HW_DECODE_NONE, "none" },
{ HW_DECODE_VAAPI, "vaapi" }, { HW_DECODE_VAAPI, "vaapi" },
{ HW_DECODE_VDPAU, "vdpau" } { HW_DECODE_VDPAU, "vdpau" },
{ HW_DECODE_VIDEOTOOLBOX, "videotoolbox" }
}; };
static const HardwareDecodeEngine hw_decode_engine_default = HW_DECODE_NONE; static const HardwareDecodeEngine hw_decode_engine_default = HW_DECODE_NONE;

View file

@ -158,7 +158,8 @@ SettingsDialog::SettingsDialog(Settings *settings, QWidget *parent) : QDialog(pa
hardware_decode_combo_box = new QComboBox(this); hardware_decode_combo_box = new QComboBox(this);
static const QList<QPair<HardwareDecodeEngine, const char *>> hardware_decode_engines = { static const QList<QPair<HardwareDecodeEngine, const char *>> hardware_decode_engines = {
{ HW_DECODE_NONE, "none"}, { HW_DECODE_NONE, "none"},
{ HW_DECODE_VAAPI, "vaapi"} { HW_DECODE_VAAPI, "vaapi"},
{ HW_DECODE_VIDEOTOOLBOX, "videotoolbox"}
}; };
auto current_hardware_decode_engine = settings->GetHardwareDecodeEngine(); auto current_hardware_decode_engine = settings->GetHardwareDecodeEngine();
for(const auto &p : hardware_decode_engines) for(const auto &p : hardware_decode_engines)