summaryrefslogtreecommitdiff
path: root/va
diff options
context:
space:
mode:
authorJason Hu <jason.hu@intel.com>2011-01-24 19:50:39 +0800
committerJason Hu <jason.hu@intel.com>2011-01-24 19:50:39 +0800
commitf25f15050379c53528391d6c4b332e1d33349e2e (patch)
treed70e3a57415f6c8b54bfe719f50c1094a1a5cf9e /va
parent74ad532d89424df8983bbc37f57649c24e9015c1 (diff)
Add va-egl API to support medfield texstreaming.
Diffstat (limited to 'va')
-rw-r--r--va/Makefile.am10
-rw-r--r--va/va_backend.h6
-rw-r--r--va/va_egl.c46
-rw-r--r--va/va_egl.h22
4 files changed, 82 insertions, 2 deletions
diff --git a/va/Makefile.am b/va/Makefile.am
index 5018ef0..95f2831 100644
--- a/va/Makefile.am
+++ b/va/Makefile.am
@@ -74,14 +74,20 @@ libva_glx_backend =
libva_glx_backenddir =
endif
-lib_LTLIBRARIES = libva.la libva-tpi.la $(libva_x11_backend) $(libva_dummy_backend) $(libva_glx_backend)
+libva_egl_la_SOURCES = va_egl.c
+libva_egl_ladir = $(libdir)
+libva_egl_la_LDFLAGS = $(LDADD) -no-undefined
+libva_egl_la_LIBADD = $(libvacorelib) -ldl
+libva_egl_la_DEPENDENCIES = $(libvacorelib)
+
+lib_LTLIBRARIES = libva.la libva-tpi.la libva-egl.la $(libva_x11_backend) $(libva_dummy_backend) $(libva_glx_backend)
DIST_SUBDIRS = x11 glx dummy
SUBDIRS = $(libva_x11_backenddir) $(libva_dummy_backenddir) $(libva_glx_backenddir)
libvaincludedir = ${includedir}/va
-libvainclude_HEADERS = va.h va_tpi.h va_x11.h va_backend.h va_backend_tpi.h va_dummy.h va_version.h
+libvainclude_HEADERS = va.h va_tpi.h va_x11.h va_backend.h va_backend_tpi.h va_dummy.h va_version.h va_egl.h
DISTCLEANFILES = \
va_version.h
diff --git a/va/va_backend.h b/va/va_backend.h
index d1e5570..6895b33 100644
--- a/va/va_backend.h
+++ b/va/va_backend.h
@@ -379,6 +379,12 @@ struct VADriverVTable
VASurfaceID surface
);
+ VAStatus (*vaGetEGLClientBufferFromSurface) (
+ VADriverContextP ctx,
+ VASurfaceID surface,
+ void **buffer
+ );
+
/* Optional: GLX support hooks */
struct VADriverVTableGLX *glx;
};
diff --git a/va/va_egl.c b/va/va_egl.c
new file mode 100644
index 0000000..a441886
--- /dev/null
+++ b/va/va_egl.c
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007 Intel Corporation. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "va.h"
+#include "va_backend.h"
+#include "va_egl.h"
+
+#define CTX(dpy) (((VADisplayContextP)dpy)->pDriverContext)
+#define CHECK_DISPLAY(dpy) if( !vaDisplayIsValid(dpy) ) { return VA_STATUS_ERROR_INVALID_DISPLAY; }
+
+VAStatus vaGetEGLClientBufferFromSurface (
+ VADisplay dpy,
+ VASurfaceID surface,
+ EGLClientBuffer *buffer /* out*/
+)
+{
+ VADriverContextP ctx;
+ CHECK_DISPLAY(dpy);
+ ctx = CTX(dpy);
+
+ return ctx->vtable.vaGetEGLClientBufferFromSurface( ctx, surface, buffer);
+
+}
+
+
diff --git a/va/va_egl.h b/va/va_egl.h
new file mode 100644
index 0000000..60f8fb8
--- /dev/null
+++ b/va/va_egl.h
@@ -0,0 +1,22 @@
+#ifndef _VA_EGL_H_
+#define _VA_EGL_H_
+
+#include <va/va.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void* EGLClientBuffer;
+
+VAStatus vaGetEGLClientBufferFromSurface (
+ VADisplay dpy,
+ VASurfaceID surface,
+ EGLClientBuffer *buffer /* out*/
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _VA_EGL_H_ */