Skip to content

Commit

Permalink
vaapi: use display connection of vaapi for xsync
Browse files Browse the repository at this point in the history
  • Loading branch information
FernetMenta committed Sep 7, 2014
1 parent e3cbbd7 commit e7ecf58
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp
Expand Up @@ -241,6 +241,11 @@ VADisplay CVAAPIContext::GetDisplay()
return m_display;
}

Display *CVAAPIContext::GetX11Display()
{
return m_X11dpy;
}

bool CVAAPIContext::IsValidDecoder(CDecoder *decoder)
{
std::vector<CDecoder*>::iterator it;
Expand Down Expand Up @@ -930,6 +935,7 @@ bool CDecoder::ConfigVAAPI()
memset(&m_hwContext, 0, sizeof(vaapi_context));

m_vaapiConfig.dpy = m_vaapiConfig.context->GetDisplay();
m_vaapiConfig.x11dsp = m_vaapiConfig.context->GetX11Display();
m_vaapiConfig.attrib = m_vaapiConfig.context->GetAttrib(m_vaapiConfig.profile);
if ((m_vaapiConfig.attrib.value & VA_RT_FORMAT_YUV420) == 0)
{
Expand Down Expand Up @@ -1812,7 +1818,7 @@ CVaapiRenderPicture* COutput::ProcessPicture(CVaapiProcessedPicture &pic)
{
return NULL;
}
XSync(m_Display, false);
XSync(m_config.x11dsp, false);
glEnable(m_textureTarget);
glBindTexture(m_textureTarget, retPic->texture);
glXBindTexImageEXT(m_Display, retPic->glPixmap, GLX_FRONT_LEFT_EXT, NULL);
Expand Down
2 changes: 2 additions & 0 deletions xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h
Expand Up @@ -123,6 +123,7 @@ struct CVaapiConfig
VADisplay dpy;
VAProfile profile;
VAConfigAttrib attrib;
Display *x11dsp;
};

/**
Expand Down Expand Up @@ -346,6 +347,7 @@ class CVAAPIContext
static bool EnsureContext(CVAAPIContext **ctx, CDecoder *decoder);
void Release(CDecoder *decoder);
VADisplay GetDisplay();
Display* GetX11Display();
bool SupportsProfile(VAProfile profile);
VAConfigAttrib GetAttrib(VAProfile profile);
VAConfigID CreateConfig(VAProfile profile, VAConfigAttrib attrib);
Expand Down

0 comments on commit e7ecf58

Please sign in to comment.