Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Expose videotoolbox hardware decoder (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinxucs authored Jun 27, 2020
1 parent 919d3b1 commit 9c91843
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions gui/include/videodecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ typedef enum {
HW_DECODE_NONE = 0,
HW_DECODE_VAAPI = 1,
HW_DECODE_VDPAU = 2,
HW_DECODE_VIDEOTOOLBOX = 3,
} HardwareDecodeEngine;


static const QMap<HardwareDecodeEngine, const char *> hardware_decode_engine_names = {
{ HW_DECODE_NONE, "none"},
{ HW_DECODE_VAAPI, "vaapi"},
{ HW_DECODE_VDPAU, "vdpau"},
{ HW_DECODE_VIDEOTOOLBOX, "videotoolbox"},
};

class VideoDecoderException: public Exception
Expand Down
3 changes: 2 additions & 1 deletion gui/src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ unsigned int Settings::GetAudioBufferSizeRaw() const
static const QMap<HardwareDecodeEngine, QString> hw_decode_engine_values = {
{ HW_DECODE_NONE, "none" },
{ 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;
Expand Down
3 changes: 2 additions & 1 deletion gui/src/settingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ SettingsDialog::SettingsDialog(Settings *settings, QWidget *parent) : QDialog(pa
hardware_decode_combo_box = new QComboBox(this);
static const QList<QPair<HardwareDecodeEngine, const char *>> hardware_decode_engines = {
{ HW_DECODE_NONE, "none"},
{ HW_DECODE_VAAPI, "vaapi"}
{ HW_DECODE_VAAPI, "vaapi"},
{ HW_DECODE_VIDEOTOOLBOX, "videotoolbox"}
};
auto current_hardware_decode_engine = settings->GetHardwareDecodeEngine();
for(const auto &p : hardware_decode_engines)
Expand Down

0 comments on commit 9c91843

Please sign in to comment.