Skip to content
Browse files

vaapi: rework GLX support.

Make CSurfaceGL a base class for OpenGL-based surface objects backing
regular VA surfaces, or actually wrapping them (future implementation).

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
  • Loading branch information...
1 parent 2b6d480 commit 72571bb0b3decc6ed4f29a465edc4e77b3c6a40f @gbeauchesne committed
View
2 xbmc/cores/VideoRenderers/LinuxRendererGL.cpp
@@ -2394,7 +2394,7 @@ void CLinuxRendererGL::UploadVAAPITexture(int index)
CLog::Log(LOGERROR, "CLinuxRendererGL::UploadVAAPITexture - failed to create vaapi glx surface (%d)", status);
return;
}
- va.surfglx = VAAPI::CSurfaceGLPtr(new VAAPI::CSurfaceGL(surface, va.display));
+ va.surfglx = VAAPI::CSurfaceGLXPtr(new VAAPI::CSurfaceGLX(va.display, surface));
}
int colorspace;
if(CONF_FLAGS_YUVCOEF_MASK(m_iFlags) == CONF_FLAGS_YUVCOEF_BT709)
View
8 xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp
@@ -139,12 +139,16 @@ CSurface::~CSurface()
CSurfaceGL::~CSurfaceGL()
{
+}
+
+#ifdef HAVE_VA_GLX
+CSurfaceGLX::~CSurfaceGLX()
+{
CLog::Log(LOGDEBUG, "VAAPI - destroying glx surface %p", m_id);
CSingleLock lock(*m_display);
-#ifdef HAVE_VA_GLX
WARN(vaDestroySurfaceGLX(m_display->get(), m_id))
-#endif
}
+#endif
CDecoder::CDecoder()
{
View
33 xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h
@@ -76,24 +76,37 @@ typedef boost::shared_ptr<CSurface> CSurfacePtr;
struct CSurfaceGL
{
- CSurfaceGL(void* id, CDisplayPtr& display)
- : m_id(id)
- , m_display(display)
+ CSurfaceGL(CDisplayPtr& display)
+ : m_display(display)
{}
- ~CSurfaceGL();
-
- void* m_id;
+ virtual ~CSurfaceGL() = 0;
+
CDisplayPtr m_display;
};
-typedef boost::shared_ptr<CSurfaceGL> CSurfaceGLPtr;
+#ifdef HAVE_VA_GLX
+struct CSurfaceGLX : public CSurfaceGL
+{
+ CSurfaceGLX(CDisplayPtr& display, void *surface)
+ : CSurfaceGL(display)
+ , m_id(surface)
+ {}
+ virtual ~CSurfaceGLX();
+
+ void* m_id;
+};
+
+typedef boost::shared_ptr<CSurfaceGLX> CSurfaceGLXPtr;
+#endif
// silly type to avoid includes
struct CHolder
{
- CDisplayPtr display;
- CSurfacePtr surface;
- CSurfaceGLPtr surfglx;
+ CDisplayPtr display;
+ CSurfacePtr surface;
+#ifdef HAVE_VA_GLX
+ CSurfaceGLXPtr surfglx;
+#endif
CHolder()
{}

0 comments on commit 72571bb

Please sign in to comment.
Something went wrong with that request. Please try again.