Skip to content

Commit

Permalink
Merge pull request #13843 from lrusak/vp8-vaapi
Browse files Browse the repository at this point in the history
VAAPI: add vp8 support
  • Loading branch information
lrusak committed May 5, 2018
2 parents 78af1d6 + 309fce5 commit 249cea9
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 1 deletion.
22 changes: 21 additions & 1 deletion addons/resource.language.en_gb/resources/strings.po
Expand Up @@ -7121,7 +7121,27 @@ msgctxt "#13452"
msgid "Enable this option to use hardware acceleration for VC-1 based codecs. If disabled the CPU will be used instead. Especially VC-1 interlaced fails hard on Intel hardware."
msgstr ""

#empty strings from id 13453 to 13456
#: system/settings/settings.xml
msgctxt "#13453"
msgid "Use VP8 VAAPI"
msgstr ""

#. Description of setting with label #13453 "Use VP8 VAAPI"
#: system/settings/settings.xml
msgctxt "#13454"
msgid "Enable this option to use hardware acceleration for the VP8 codec. If disabled the CPU will be used instead."
msgstr ""

#: system/settings/settings.xml
msgctxt "#13455"
msgid "Use VP9 VAAPI"
msgstr ""

#. Description of setting with label #13453 "Use VP9 VAAPI"
#: system/settings/settings.xml
msgctxt "#13456"
msgid "Enable this option to use hardware acceleration for the VP9 codec. If disabled the CPU will be used instead."
msgstr ""

#. Option for video related setting #13454: sw filter
#: system/settings/settings.xml
Expand Down
24 changes: 24 additions & 0 deletions system/settings/linux.xml
Expand Up @@ -100,6 +100,30 @@
<default>true</default>
<control type="toggle" />
</setting>
<setting id="videoplayer.usevaapivp8" type="boolean" parent="videoplayer.usevaapi" label="13453" help="13454">
<requirement>HAVE_LIBVA</requirement>
<visible>false</visible>
<dependencies>
<dependency type="enable">
<condition setting="videoplayer.usevaapi" operator="is">true</condition>
</dependency>
</dependencies>
<level>3</level>
<default>true</default>
<control type="toggle" />
</setting>
<setting id="videoplayer.usevaapivp9" type="boolean" parent="videoplayer.usevaapi" label="13455" help="13456">
<requirement>HAVE_LIBVA</requirement>
<visible>false</visible>
<dependencies>
<dependency type="enable">
<condition setting="videoplayer.usevaapi" operator="is">true</condition>
</dependency>
</dependencies>
<level>3</level>
<default>true</default>
<control type="toggle" />
</setting>
<setting id="videoplayer.prefervaapirender" type="boolean" parent="videoplayer.usevaapi" label="13457" help="36433">
<requirement>HAVE_LIBVA</requirement>
<visible>false</visible>
Expand Down
11 changes: 11 additions & 0 deletions xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.cpp
Expand Up @@ -505,6 +505,8 @@ bool CDecoder::Open(AVCodecContext* avctx, AVCodecContext* mainctx, const enum A
{ AV_CODEC_ID_WMV3, CSettings::SETTING_VIDEOPLAYER_USEVAAPIVC1 },
{ AV_CODEC_ID_VC1, CSettings::SETTING_VIDEOPLAYER_USEVAAPIVC1 },
{ AV_CODEC_ID_MPEG2VIDEO, CSettings::SETTING_VIDEOPLAYER_USEVAAPIMPEG2 },
{ AV_CODEC_ID_VP8, CSettings::SETTING_VIDEOPLAYER_USEVAAPIVP8 },
{ AV_CODEC_ID_VP9, CSettings::SETTING_VIDEOPLAYER_USEVAAPIVP9 },
};

auto entry = settings_map.find(avctx->codec_id);
Expand Down Expand Up @@ -595,6 +597,13 @@ bool CDecoder::Open(AVCodecContext* avctx, AVCodecContext* mainctx, const enum A
return false;
break;
}
case AV_CODEC_ID_VP8:
{
profile = VAProfileVP8Version0_3;
if (!m_vaapiConfig.context->SupportsProfile(profile))
return false;
break;
}
case AV_CODEC_ID_VP9:
{
if (avctx->profile == FF_PROFILE_VP9_0)
Expand Down Expand Up @@ -1197,6 +1206,8 @@ void CDecoder::Register(IVaapiWinSystem *winSystem, bool deepColor)
CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_VIDEOPLAYER_USEVAAPIMPEG4)->SetVisible(true);
CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_VIDEOPLAYER_USEVAAPIVC1)->SetVisible(true);
CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_VIDEOPLAYER_USEVAAPIMPEG2)->SetVisible(true);
CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_VIDEOPLAYER_USEVAAPIVP8)->SetVisible(true);
CServiceBroker::GetSettings().GetSetting(CSettings::SETTING_VIDEOPLAYER_USEVAAPIVP9)->SetVisible(true);
}

//-----------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions xbmc/settings/Settings.cpp
Expand Up @@ -167,6 +167,8 @@ const std::string CSettings::SETTING_VIDEOPLAYER_USEVAAPI = "videoplayer.usevaap
const std::string CSettings::SETTING_VIDEOPLAYER_USEVAAPIMPEG2 = "videoplayer.usevaapimpeg2";
const std::string CSettings::SETTING_VIDEOPLAYER_USEVAAPIMPEG4 = "videoplayer.usevaapimpeg4";
const std::string CSettings::SETTING_VIDEOPLAYER_USEVAAPIVC1 = "videoplayer.usevaapivc1";
const std::string CSettings::SETTING_VIDEOPLAYER_USEVAAPIVP8 = "videoplayer.usevaapivp8";
const std::string CSettings::SETTING_VIDEOPLAYER_USEVAAPIVP9 = "videoplayer.usevaapivp9";
const std::string CSettings::SETTING_VIDEOPLAYER_PREFERVAAPIRENDER = "videoplayer.prefervaapirender";
const std::string CSettings::SETTING_VIDEOPLAYER_USEDXVA2 = "videoplayer.usedxva2";
const std::string CSettings::SETTING_VIDEOPLAYER_USEOMXPLAYER = "videoplayer.useomxplayer";
Expand Down
2 changes: 2 additions & 0 deletions xbmc/settings/Settings.h
Expand Up @@ -121,6 +121,8 @@ class CSettings : public CSettingsBase, public CSettingCreator, public CSettingC
static const std::string SETTING_VIDEOPLAYER_USEVAAPIMPEG2;
static const std::string SETTING_VIDEOPLAYER_USEVAAPIMPEG4;
static const std::string SETTING_VIDEOPLAYER_USEVAAPIVC1;
static const std::string SETTING_VIDEOPLAYER_USEVAAPIVP8;
static const std::string SETTING_VIDEOPLAYER_USEVAAPIVP9;
static const std::string SETTING_VIDEOPLAYER_PREFERVAAPIRENDER;
static const std::string SETTING_VIDEOPLAYER_USEDXVA2;
static const std::string SETTING_VIDEOPLAYER_USEOMXPLAYER;
Expand Down

0 comments on commit 249cea9

Please sign in to comment.