Skip to content

Commit

Permalink
VDPAU: Add Expert Settings to let user easily disable certain codecs
Browse files Browse the repository at this point in the history
  • Loading branch information
fritsch committed Feb 9, 2014
1 parent e3f9c7b commit 5e25fd5
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 2 deletions.
14 changes: 13 additions & 1 deletion language/English/strings.po
Expand Up @@ -6000,7 +6000,19 @@ msgctxt "#13440"
msgid "Allow frame-multi-threaded decoding"
msgstr ""

#empty strings from id 13441 to 13499
msgctxt "#13441"
msgid "Use Mpeg-2 VDPAU"
msgstr ""

msgctxt "#13442"
msgid "Use Mpeg-4 VDPAU"
msgstr ""

msgctxt "#13443"
msgid "Use VC-1 VDPAU"
msgstr ""

#empty strings from id 13444 to 13499

#: system/settings/settings.xml
msgctxt "#13500"
Expand Down
27 changes: 27 additions & 0 deletions system/settings/settings.xml
Expand Up @@ -447,6 +447,33 @@
</dependencies>
<control type="toggle" />
</setting>
<setting id="videoplayer.usevdpaumpeg2" type="boolean" label="13441" help="36102">
<requirement>HAVE_LIBVDPAU</requirement>
<level>3</level>
<default>true</default>
<dependencies>
<dependency type="enable" setting="videoplayer.usevdpau" operator="is">true</dependency> <!-- USE VDPAU -->
</dependencies>
<control type="toggle" />
</setting>
<setting id="videoplayer.usevdpaumpeg4" type="boolean" label="13442" help="36102">
<requirement>HAVE_LIBVDPAU</requirement>
<level>3</level>
<default>false</default>
<dependencies>
<dependency type="enable" setting="videoplayer.usevdpau" operator="is">true</dependency> <!-- USE VDPAU -->
</dependencies>
<control type="toggle" />
</setting>
<setting id="videoplayer.usevdpauvc1" type="boolean" label="13443" help="36102">
<requirement>HAVE_LIBVDPAU</requirement>
<level>3</level>
<default>true</default>
<dependencies>
<dependency type="enable" setting="videoplayer.usevdpau" operator="is">true</dependency> <!-- USE VDPAU -->
</dependencies>
<control type="toggle" />
</setting>
<setting id="videoplayer.usevaapi" type="boolean" label="13426" help="36156">
<requirement>HAVE_LIBVA</requirement>
<dependencies>
Expand Down
16 changes: 15 additions & 1 deletion xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
Expand Up @@ -42,6 +42,16 @@ using namespace VDPAU;

#define ARSIZE(x) (sizeof(x) / sizeof((x)[0]))

// settings codecs mapping
DVDCodecAvailableType g_vdpau_available[] = {
{ AV_CODEC_ID_H263, "videoplayer.usevdpaumpeg4" },
{ AV_CODEC_ID_MPEG4, "videoplayer.usevdpaumpeg4" },
{ AV_CODEC_ID_WMV3, "videoplayer.usevdpauvc1" },
{ AV_CODEC_ID_VC1, "videoplayer.usevdpauvc1" },
{ AV_CODEC_ID_MPEG2VIDEO, "videoplayer.usevdpaumpeg2" },
};
const size_t settings_count = sizeof(g_vdpau_available) / sizeof(DVDCodecAvailableType);

CDecoder::Desc decoder_profiles[] = {
{"MPEG1", VDP_DECODER_PROFILE_MPEG1},
{"MPEG2_SIMPLE", VDP_DECODER_PROFILE_MPEG2_SIMPLE},
Expand Down Expand Up @@ -483,8 +493,12 @@ CDecoder::CDecoder() : m_vdpauOutput(&m_inMsgEvent)
m_vdpauConfig.context = 0;
}

bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int surfaces)
bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat fmt, unsigned int surfaces)
{
// check if user wants to decode this format with VDPAU
if (CDVDVideoCodec::IsCodecDisabled(g_vdpau_available, settings_count, avctx->codec_id))
return false;

#ifndef GL_NV_vdpau_interop
CLog::Log(LOGNOTICE, "VDPAU: compilation without required extension GL_NV_vdpau_interop");
return false;
Expand Down

0 comments on commit 5e25fd5

Please sign in to comment.