...
 
Commits (70)
ABOUT-NLS
_stdint.h
aclocal.m4 aclocal.m4
autom4te.cache autom4te.cache
autoregen.sh
compile
config.guess
config.h* config.h*
config.log config.log
config.rpath
config.status config.status
config.guess
config.sub config.sub
config.rpath
configure configure
libtool depcomp
stamp-h
stamp-h.in
stamp-h1
gst-element-check-*.m4 gst-element-check-*.m4
gstreamer-vaapi-*.tar.gz
install-sh
libtool
ltmain.sh ltmain.sh
missing missing
mkinstalldirs mkinstalldirs
compile stamp-h
install-sh stamp-h.in
depcomp stamp-h1
autoregen.sh
ABOUT-NLS
_stdint.h
/m4 /m4
...@@ -34,6 +35,7 @@ Makefile ...@@ -34,6 +35,7 @@ Makefile
*~ *~
*.swp *.swp
debian.build/
debian.upstream/changelog debian.upstream/changelog
debian.upstream/control debian.upstream/control
debian.upstream/gstreamer0.10-vaapi-doc.install debian.upstream/gstreamer0.10-vaapi-doc.install
...@@ -42,8 +44,17 @@ debian.upstream/libgstvaapi-dev.install ...@@ -42,8 +44,17 @@ debian.upstream/libgstvaapi-dev.install
debian.upstream/libgstvaapi-glx-0.install debian.upstream/libgstvaapi-glx-0.install
debian.upstream/libgstvaapi-x11-0.install debian.upstream/libgstvaapi-x11-0.install
debian.upstream/libgstvaapi0.install debian.upstream/libgstvaapi0.install
docs/reference/libs/html*
docs/reference/libs/libs-docs.xml docs/reference/libs/libs-docs.xml
docs/reference/libs/tmpl*
docs/reference/libs/xml*
docs/reference/libs/*.stamp
docs/reference/plugins/html*
docs/reference/plugins/plugins-docs.xml docs/reference/plugins/plugins-docs.xml
docs/reference/plugins/tmpl*
docs/reference/plugins/xml*
docs/reference/plugins/*.stamp
gst-libs/gst/gstutils_version.h
gst-libs/gst/vaapi/gstvaapimarshal.c gst-libs/gst/vaapi/gstvaapimarshal.c
gst-libs/gst/vaapi/gstvaapimarshal.h gst-libs/gst/vaapi/gstvaapimarshal.h
gst-libs/gst/vaapi/stamp-marshal gst-libs/gst/vaapi/stamp-marshal
...@@ -56,4 +67,3 @@ tests/test-display ...@@ -56,4 +67,3 @@ tests/test-display
tests/test-surfaces tests/test-surfaces
tests/test-textures tests/test-textures
tests/test-windows tests/test-windows
gst-vaapi NEWS -- summary of changes. 2011-12-07 gst-vaapi NEWS -- summary of changes. 2012-04-02
Copyright (C) 2010-2011 Splitted-Desktop Systems Copyright (C) 2010-2011 Splitted-Desktop Systems
Copyright (C) 2011 Intel Corporation Copyright (C) 2011-2012 Intel Corporation
Version 0.2.12 - 02.Apr.2012
* Don't forcibly resize user provided X windows (Holger Kaelberer)
* Recalculate render rect only if caps are negotiated (Holger Kaelberer)
* Avoid a hang in playbin2 for some MPEG-2 TS streams (Feng Yuan)
* Fix build with VA-API >= 0.34.x
* Fix crash when downloading/uploading VA images on PowerVR (Cedar Trail)
Version 0.2.11 - 07.Feb.2012
* Fix build with newer GLib versions
* Fix GstPadTemplate leaks in plug-ins
* Fix vaapisink to cap window size to the maximum display size
* Fix function used to unreference GstVaapiImage in vaapiconvert
Version 0.2.10 - 16.Jan.2012
* Add support for GstXOverlay::set_render_rectangle() in vaapisink
* Fix memory leak of GL texture (Nicolas Dufresne)
* Fix vaapisink to automatically fit video to window
* Fix vaapiconvert to only set caps on newly created buffers (Nicolas Dufresne)
Version 0.2.9 - 06.Jan.2012
* Fix vaapiconvert from NV12 buffers
* Fix possible leaks of VA surfaces in FFmpeg decoder
* Fix possible crash in vaapidecode deinitialization code
Version 0.2.8 - 16.Dec.2011
* Group all plugins into the same bundle
* Add support for partial VA image updates
* Use new XOverlay API (Sreerenj Balachandran)
* Fix vaapidecode sink caps if decoder is in NULL state (Sreerenj Balachandran)
* Fix crash in VA display init if no VA configs were found (Nicolas Dufresne)
Version 0.2.7 - 07.Dec.2011 Version 0.2.7 - 07.Dec.2011
* Relicense plugins and tests to LGPL v2.1 (SDS) * Relicense plugins and tests to LGPL v2.1 (SDS)
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
VA-API support to GStreamer VA-API support to GStreamer
Copyright (C) 2010-2011 Splitted-Desktop Systems Copyright (C) 2010-2011 Splitted-Desktop Systems
Copyright (C) 2011 Intel Corporation Copyright (C) 2011-2012 Intel Corporation
Copyright (C) 2011 Collabora Ltd.
License License
......
...@@ -36,4 +36,6 @@ else ...@@ -36,4 +36,6 @@ else
ACLOCAL="${ACLOCAL-aclocal} $ACLOCAL_FLAGS" autoreconf -v --install || exit $? ACLOCAL="${ACLOCAL-aclocal} $ACLOCAL_FLAGS" autoreconf -v --install || exit $?
fi fi
./configure "$@" && echo "Now type 'make' to compile $PROJECT." if test -z "$NO_CONFIGURE"; then
./configure "$@" && echo "Now type 'make' to compile $PROJECT."
fi
# gstreamer-vaapi package version number # gstreamer-vaapi package version number
m4_define([gst_vaapi_major_version], [0]) m4_define([gst_vaapi_major_version], [0])
m4_define([gst_vaapi_minor_version], [2]) m4_define([gst_vaapi_minor_version], [2])
m4_define([gst_vaapi_micro_version], [7]) m4_define([gst_vaapi_micro_version], [13])
m4_define([gst_vaapi_pre_version], [1])
m4_define([gst_vaapi_version], m4_define([gst_vaapi_version],
[gst_vaapi_major_version.gst_vaapi_minor_version.gst_vaapi_micro_version]) [gst_vaapi_major_version.gst_vaapi_minor_version.gst_vaapi_micro_version])
m4_if(gst_vaapi_pre_version, [0], [], [
m4_append([gst_vaapi_version], gst_vaapi_pre_version, [.pre])
])
# gst version number # gst version number
m4_define([gst_major_version], [0]) m4_define([gst_major_version], [0])
...@@ -21,17 +25,13 @@ m4_define([gst_plugins_base_micro_version], [16]) ...@@ -21,17 +25,13 @@ m4_define([gst_plugins_base_micro_version], [16])
m4_define([gst_plugins_base_version], m4_define([gst_plugins_base_version],
[gst_plugins_base_major_version.gst_plugins_base_minor_version.gst_plugins_base_micro_version]) [gst_plugins_base_major_version.gst_plugins_base_minor_version.gst_plugins_base_micro_version])
# VA-API minimum version number
m4_define([va_api_x11_version], [0.31.0])
m4_define([va_api_glx_version], [0.32.0])
# libva package version number # libva package version number
m4_define([libva_sds_version_0_29], [8]) m4_define([libva_x11_package_version], [1.0.3])
m4_define([libva_sds_package_version_0_29], [0.29-2+sds11]) m4_define([libva_glx_package_version], [1.0.9])
m4_define([libva_sds_version_0_30], [1])
m4_define([libva_sds_package_version_0_30], [0.30-1+sds1])
m4_define([libva_glx_sds_version_0_30], [5])
m4_define([libva_glx_sds_package_version_0_30], [0.30.4-1+sds6])
m4_define([libva_glx_sds_version_0_31], [1])
m4_define([libva_glx_sds_package_version_0_31], [0.31.0-1+sds1])
m4_define([libva_sds_version], [libva_glx_sds_version_0_31])
m4_define([libva_sds_package_version], [libva_glx_sds_package_version_0_31])
# gtk-doc version number # gtk-doc version number
# XXX: introspection annotations require gtk-doc >= 1.12 # XXX: introspection annotations require gtk-doc >= 1.12
...@@ -54,8 +54,8 @@ AC_SUBST(TODAY) ...@@ -54,8 +54,8 @@ AC_SUBST(TODAY)
GST_VAAPI_MAJOR_VERSION=gst_vaapi_major_version GST_VAAPI_MAJOR_VERSION=gst_vaapi_major_version
AC_SUBST(GST_VAAPI_MAJOR_VERSION) AC_SUBST(GST_VAAPI_MAJOR_VERSION)
LIBVA_SDS_PACKAGE_VERSION=libva_sds_package_version LIBVA_PACKAGE_VERSION=libva_x11_package_version
AC_SUBST(LIBVA_SDS_PACKAGE_VERSION) AC_SUBST(LIBVA_PACKAGE_VERSION)
dnl Versions for GStreamer and plugins-base dnl Versions for GStreamer and plugins-base
GST_MAJORMINOR=gst_major_minor_version GST_MAJORMINOR=gst_major_minor_version
...@@ -129,6 +129,9 @@ AC_SUBST(GTKDOC_VERSION) ...@@ -129,6 +129,9 @@ AC_SUBST(GTKDOC_VERSION)
dnl Check for GLib dnl Check for GLib
AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal]) AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
PKG_CHECK_MODULES([GLIB], [glib-2.0]) PKG_CHECK_MODULES([GLIB], [glib-2.0])
AC_CHECK_LIB([glib-2.0], [g_list_free_full], [
AC_DEFINE([HAVE_G_LIST_FREE_FULL], [1],
[Define to 1 if g_list_free_full() is available.])])
AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS) AC_SUBST(GLIB_LIBS)
...@@ -146,6 +149,14 @@ PKG_CHECK_MODULES([GST_PLUGINS_BASE], ...@@ -146,6 +149,14 @@ PKG_CHECK_MODULES([GST_PLUGINS_BASE],
AC_SUBST(GST_PLUGINS_BASE_CFLAGS) AC_SUBST(GST_PLUGINS_BASE_CFLAGS)
AC_SUBST(GST_PLUGINS_BASE_LIBS) AC_SUBST(GST_PLUGINS_BASE_LIBS)
V=`$PKG_CONFIG --modversion gstreamer-plugins-base-$GST_MAJORMINOR`
GST_PLUGINS_BASE_MAJOR_VERSION=`echo "$V" | cut -d'.' -f1`
GST_PLUGINS_BASE_MINOR_VERSION=`echo "$V" | cut -d'.' -f2`
GST_PLUGINS_BASE_MICRO_VERSION=`echo "$V" | cut -d'.' -f3`
AC_SUBST(GST_PLUGINS_BASE_MAJOR_VERSION)
AC_SUBST(GST_PLUGINS_BASE_MINOR_VERSION)
AC_SUBST(GST_PLUGINS_BASE_MICRO_VERSION)
dnl Check for GStreamer base dnl Check for GStreamer base
PKG_CHECK_MODULES([GST_BASE], PKG_CHECK_MODULES([GST_BASE],
[gstreamer-base-$GST_MAJORMINOR >= $GST_VERSION_REQUIRED] [gstreamer-base-$GST_MAJORMINOR >= $GST_VERSION_REQUIRED]
...@@ -299,12 +310,7 @@ VA_VERSION=`$PKG_CONFIG --modversion libva` ...@@ -299,12 +310,7 @@ VA_VERSION=`$PKG_CONFIG --modversion libva`
VA_MAJOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f1` VA_MAJOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f1`
VA_MINOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f2` VA_MINOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f2`
VA_MICRO_VERSION=`echo "$VA_VERSION" | cut -d'.' -f3` VA_MICRO_VERSION=`echo "$VA_VERSION" | cut -d'.' -f3`
VA_SDS_VERSION=`$PKG_CONFIG libva --variable sdsversion`
VA_VERSION_STR="$VA_VERSION" VA_VERSION_STR="$VA_VERSION"
if test -n "$VA_SDS_VERSION"; then
VA_VERSION_STR="$VA_VERSION_STR-sds$VA_SDS_VERSION"
fi
pkgconfigdir=${libdir}/pkgconfig pkgconfigdir=${libdir}/pkgconfig
AC_SUBST(pkgconfigdir) AC_SUBST(pkgconfigdir)
...@@ -333,6 +339,7 @@ debian.upstream/libgstvaapi-glx.install.in ...@@ -333,6 +339,7 @@ debian.upstream/libgstvaapi-glx.install.in
docs/reference/plugins/plugins-docs.xml docs/reference/plugins/plugins-docs.xml
gst-libs/Makefile gst-libs/Makefile
gst-libs/gst/Makefile gst-libs/gst/Makefile
gst-libs/gst/gstutils_version.h
gst-libs/gst/vaapi/Makefile gst-libs/gst/vaapi/Makefile
pkgconfig/Makefile pkgconfig/Makefile
pkgconfig/gstreamer-vaapi-$GST_MAJORMINOR.pc:\ pkgconfig/gstreamer-vaapi-$GST_MAJORMINOR.pc:\
...@@ -342,9 +349,7 @@ pkgconfig/gstreamer-vaapi-glx.pc.in ...@@ -342,9 +349,7 @@ pkgconfig/gstreamer-vaapi-glx.pc.in
pkgconfig/gstreamer-vaapi-x11-$GST_MAJORMINOR.pc:\ pkgconfig/gstreamer-vaapi-x11-$GST_MAJORMINOR.pc:\
pkgconfig/gstreamer-vaapi-x11.pc.in pkgconfig/gstreamer-vaapi-x11.pc.in
gst/Makefile gst/Makefile
gst/vaapiconvert/Makefile gst/vaapi/Makefile
gst/vaapidecode/Makefile
gst/vaapisink/Makefile
tests/Makefile tests/Makefile
]) ])
......
...@@ -7,7 +7,7 @@ Build-Depends: debhelper (>= 5), ...@@ -7,7 +7,7 @@ Build-Depends: debhelper (>= 5),
libglib2.0-dev, libglib2.0-dev,
libgstreamer@GST_MAJORMINOR@-dev (>= @GST_VERSION_REQUIRED@), libgstreamer@GST_MAJORMINOR@-dev (>= @GST_VERSION_REQUIRED@),
libgstreamer-plugins-base@GST_MAJORMINOR@-dev (>= @GST_PLUGINS_BASE_VERSION_REQUIRED@), libgstreamer-plugins-base@GST_MAJORMINOR@-dev (>= @GST_PLUGINS_BASE_VERSION_REQUIRED@),
libva-dev (>= @LIBVA_SDS_PACKAGE_VERSION@) libva-dev (>= @LIBVA_PACKAGE_VERSION@)
Build-Depends-Indep: gtk-doc-tools (>= @GTKDOC_VERSION@) Build-Depends-Indep: gtk-doc-tools (>= @GTKDOC_VERSION@)
Standards-Version: 3.7.2 Standards-Version: 3.7.2
...@@ -18,6 +18,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends} ...@@ -18,6 +18,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}
Suggests: gstreamer@GST_MAJORMINOR@-vaapi-doc Suggests: gstreamer@GST_MAJORMINOR@-vaapi-doc
Description: VA-API plugins for GStreamer Description: VA-API plugins for GStreamer
This package contains GStreamer plugins for VA-API support: This package contains GStreamer plugins for VA-API support:
- `vaapidecode': decode bitstreams using VA-API (through FFmpeg)
- `vaapiconvert': converts from YUV pixels to VA surfaces - `vaapiconvert': converts from YUV pixels to VA surfaces
- `vaapisink': a VA-API based video sink - `vaapisink': a VA-API based video sink
......
...@@ -9,7 +9,8 @@ Copyright: ...@@ -9,7 +9,8 @@ Copyright:
License: License:
Copyright (C) 2010-2011, Splitted-Desktop Systems. Copyright (C) 2010-2011, Splitted-Desktop Systems.
Copyright (C) 2011, Intel Corporation. Copyright (C) 2011-2012, Intel Corporation.
Copyright (C) 2011, Collabora Ltd.
gstreamer-vaapi helper libraries and plugins elements are available under gstreamer-vaapi helper libraries and plugins elements are available under
the terms of the GNU Lesser General Public License v2.1+. the terms of the GNU Lesser General Public License v2.1+.
......
...@@ -377,6 +377,7 @@ gst_vaapi_image_format_is_yuv ...@@ -377,6 +377,7 @@ gst_vaapi_image_format_is_yuv
gst_vaapi_image_format gst_vaapi_image_format
gst_vaapi_image_format_from_caps gst_vaapi_image_format_from_caps
gst_vaapi_image_format_from_fourcc gst_vaapi_image_format_from_fourcc
gst_vaapi_image_format_from_video
gst_vaapi_image_format_get_va_format gst_vaapi_image_format_get_va_format
gst_vaapi_image_format_get_caps gst_vaapi_image_format_get_caps
gst_vaapi_image_format_get_score gst_vaapi_image_format_get_score
...@@ -491,6 +492,7 @@ gst_vaapi_surface_proxy_new ...@@ -491,6 +492,7 @@ gst_vaapi_surface_proxy_new
gst_vaapi_surface_proxy_get_context gst_vaapi_surface_proxy_get_context
gst_vaapi_surface_proxy_set_context gst_vaapi_surface_proxy_set_context
gst_vaapi_surface_proxy_get_surface gst_vaapi_surface_proxy_get_surface
gst_vaapi_surface_proxy_get_surface_id
gst_vaapi_surface_proxy_set_surface gst_vaapi_surface_proxy_set_surface
gst_vaapi_surface_proxy_get_timestamp gst_vaapi_surface_proxy_get_timestamp
gst_vaapi_surface_proxy_set_timestamp gst_vaapi_surface_proxy_set_timestamp
......
...@@ -90,9 +90,7 @@ INCLUDES = \ ...@@ -90,9 +90,7 @@ INCLUDES = \
GTKDOC_LIBS = \ GTKDOC_LIBS = \
$(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-$(GST_MAJORMINOR).la \ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-$(GST_MAJORMINOR).la \
$(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11-$(GST_MAJORMINOR).la \ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11-$(GST_MAJORMINOR).la \
$(top_builddir)/gst/vaapidecode/libgstvaapidecode.la \ $(top_builddir)/gst/vaapi/libgstvaapi.la \
$(top_builddir)/gst/vaapiconvert/libgstvaapiconvert.la \
$(top_builddir)/gst/vaapisink/libgstvaapisink.la \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
$(GST_LIBS) \ $(GST_LIBS) \
$(NULL) $(NULL)
......
SUBDIRS = vaapi SUBDIRS = vaapi
gen_headers = gstutils_version.h
noinst_HEADERS = $(gen_headers)
EXTRA_DIST = gstutils_version.h.in
# Extra clean files so that maintainer-clean removes *everything* # Extra clean files so that maintainer-clean removes *everything*
MAINTAINERCLEANFILES = Makefile.in MAINTAINERCLEANFILES = Makefile.in $(gen_headers)
/*
* gstutils_version.h - GStreamer version utilities
*
* Copyright (C) 2011 Intel Corporation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#ifndef GST_UTILS_VERSION_H
#define GST_UTILS_VERSION_H
/* gst-plugins-base version */
#define GST_PLUGINS_BASE_MAJOR_VERSION @GST_PLUGINS_BASE_MAJOR_VERSION@
#define GST_PLUGINS_BASE_MINOR_VERSION @GST_PLUGINS_BASE_MINOR_VERSION@
#define GST_PLUGINS_BASE_MICRO_VERSION @GST_PLUGINS_BASE_MICRO_VERSION@
/**
* GST_UTILS_CHECK_VERSION:
* @major: major version, like 1 in 1.2.3
* @minor: minor version, like 2 in 1.2.3
* @micro: micro version, like 3 in 1.2.3
*
* Evaluates to %TRUE if the version of gst-plugins-base is equal or
* greater than @major, @minor and @micro
*/
#define GST_UTILS_CHECK_VERSION(major,minor,micro, rmajor,rminor,rmicro) \
((rmajor) > (major) || \
((rmajor) == (major) && (rminor) > (minor)) || \
((rmajor) == (major) && (rminor) == (minor) && (rmicro) >= (micro)))
/**
* GST_PLUGINS_BASE_CHECK_VERSION:
* @major: major version, like 1 in 1.2.3
* @minor: minor version, like 2 in 1.2.3
* @micro: micro version, like 3 in 1.2.3
*
* Evaluates to %TRUE if the version of gst-plugins-base is greater
* than @major, @minor and @micro
*/
#ifndef GST_PLUGINS_BASE_CHECK_VERSION
#define GST_PLUGINS_BASE_CHECK_VERSION(major,minor,micro) \
GST_UTILS_CHECK_VERSION(major,minor,micro, \
GST_PLUGINS_BASE_MAJOR_VERSION, \
GST_PLUGINS_BASE_MINOR_VERSION, \
GST_PLUGINS_BASE_MICRO_VERSION)
#endif
#endif /* GST_UTILS_VERSION_H */
...@@ -70,6 +70,7 @@ libgstvaapi_source_h = \ ...@@ -70,6 +70,7 @@ libgstvaapi_source_h = \
$(NULL) $(NULL)
libgstvaapi_source_priv_h = \ libgstvaapi_source_priv_h = \
glibcompat.h \
gstvaapi_priv.h \ gstvaapi_priv.h \
gstvaapicompat.h \ gstvaapicompat.h \
gstvaapidebug.h \ gstvaapidebug.h \
...@@ -78,6 +79,7 @@ libgstvaapi_source_priv_h = \ ...@@ -78,6 +79,7 @@ libgstvaapi_source_priv_h = \
gstvaapiobject_priv.h \ gstvaapiobject_priv.h \
gstvaapiutils.h \ gstvaapiutils.h \
gstvaapiutils_gst.h \ gstvaapiutils_gst.h \
sysdeps.h \
$(libgst_vaapi_ffmpeg_source_priv_h) \ $(libgst_vaapi_ffmpeg_source_priv_h) \
$(NULL) $(NULL)
...@@ -138,6 +140,7 @@ libgstvaapi_@GST_MAJORMINOR@includedir = \ ...@@ -138,6 +140,7 @@ libgstvaapi_@GST_MAJORMINOR@includedir = \
libgstvaapi_@GST_MAJORMINOR@_la_CFLAGS = \ libgstvaapi_@GST_MAJORMINOR@_la_CFLAGS = \
-I$(top_srcdir)/gst-libs \ -I$(top_srcdir)/gst-libs \
$(GST_BASE_CFLAGS) \ $(GST_BASE_CFLAGS) \
$(GST_VIDEO_CFLAGS) \
$(GST_CFLAGS) \ $(GST_CFLAGS) \
$(LIBAVCODEC_CFLAGS) \ $(LIBAVCODEC_CFLAGS) \
$(LIBVA_CFLAGS) \ $(LIBVA_CFLAGS) \
......
/*
* glibcompat.h - System-dependent definitions
*
* Copyright (C) 2012 Intel Corporation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#ifndef GLIB_COMPAT_H
#define GLIB_COMPAT_H
#include <glib.h>
#ifndef HAVE_G_LIST_FREE_FULL
static inline void
g_list_free_full(GList *list, GDestroyNotify free_func)
{
g_list_foreach(list, (GFunc)free_func, NULL);
g_list_free(list);
}
#endif
#if GLIB_CHECK_VERSION(2,31,2)
#define GStaticMutex GMutex
#undef g_static_mutex_init
#define g_static_mutex_init(mutex) g_mutex_init(mutex)
#undef g_static_mutex_free
#define g_static_mutex_free(mutex) g_mutex_clear(mutex)
#undef g_static_mutex_lock
#define g_static_mutex_lock(mutex) g_mutex_lock(mutex)
#undef g_static_mutex_unlock
#define g_static_mutex_unlock(mutex) g_mutex_unlock(mutex)
#define GStaticRecMutex GRecMutex
#undef g_static_rec_mutex_init
#define g_static_rec_mutex_init(mutex) g_rec_mutex_init(mutex)
#undef g_static_rec_mutex_free
#define g_static_rec_mutex_free(mutex) g_rec_mutex_clear(mutex)
#undef g_static_rec_mutex_lock
#define g_static_rec_mutex_lock(mutex) g_rec_mutex_lock(mutex)
#undef g_static_rec_mutex_unlock
#define g_static_rec_mutex_unlock(m) g_rec_mutex_unlock(m)
#endif
#endif /* GLIB_COMPAT_H */
/* /*
* gstvaapi_priv.h - Helper to include all private headers * gstvaapi_priv.h - Helper to include all private headers
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
......
/* /*
* gstvapicompat.h - VA-API compatibility glue * gstvapicompat.h - VA-API compatibility glue
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
...@@ -91,4 +91,9 @@ typedef struct _VASliceParameterBufferBase { ...@@ -91,4 +91,9 @@ typedef struct _VASliceParameterBufferBase {
#define vaAssociateSubpicture vaAssociateSubpicture2 #define vaAssociateSubpicture vaAssociateSubpicture2
#endif #endif
/* Compatibility glue with VA-API 0.34 */
#if VA_CHECK_VERSION(0,34,0)
# include <va/va_compat.h>
#endif
#endif /* GST_VAAPI_COMPAT_H */ #endif /* GST_VAAPI_COMPAT_H */
/* /*
* gstvaapicontext.c - VA context abstraction * gstvaapicontext.c - VA context abstraction
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
* @short_description: VA context abstraction * @short_description: VA context abstraction
*/ */
#include "config.h" #include "sysdeps.h"
#include <assert.h> #include <assert.h>
#include "gstvaapicompat.h" #include "gstvaapicompat.h"
#include "gstvaapicontext.h" #include "gstvaapicontext.h"
......
/* /*
* gstvaapicontext.h - VA context abstraction * gstvaapicontext.h - VA context abstraction
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
......
/* /*
* gstvaapidebug.h - VA-API debugging utilities * gstvaapidebug.h - VA-API debugging utilities
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
......
/* /*
* gstvaapidecoder.c - VA decoder abstraction * gstvaapidecoder.c - VA decoder abstraction
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* Copyright (C) 2011 Intel Corporation * Copyright (C) 2011-2012 Intel Corporation
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
* @short_description: VA decoder abstraction * @short_description: VA decoder abstraction
*/ */
#include "config.h" #include "sysdeps.h"
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#include "gstvaapicompat.h" #include "gstvaapicompat.h"
...@@ -126,20 +126,15 @@ decode_step(GstVaapiDecoder *decoder) ...@@ -126,20 +126,15 @@ decode_step(GstVaapiDecoder *decoder)
static gboolean static gboolean
push_surface( push_surface(
GstVaapiDecoder *decoder, GstVaapiDecoder *decoder,
GstVaapiSurface *surface, GstVaapiSurfaceProxy *proxy,
GstClockTime timestamp GstClockTime timestamp
) )
{ {
GstVaapiDecoderPrivate * const priv = decoder->priv; GstVaapiDecoderPrivate * const priv = decoder->priv;
GstVaapiSurfaceProxy *proxy;
GST_DEBUG("queue decoded surface %" GST_VAAPI_ID_FORMAT, GST_DEBUG("queue decoded surface %" GST_VAAPI_ID_FORMAT,
GST_VAAPI_ID_ARGS(GST_VAAPI_OBJECT_ID(surface))); GST_VAAPI_ID_ARGS(gst_vaapi_surface_proxy_get_surface_id(proxy)));
proxy = gst_vaapi_surface_proxy_new(priv->context, surface);
if (!proxy)
return FALSE;
gst_vaapi_surface_proxy_set_timestamp(proxy, timestamp); gst_vaapi_surface_proxy_set_timestamp(proxy, timestamp);
g_queue_push_tail(priv->surfaces, proxy); g_queue_push_tail(priv->surfaces, proxy);
...@@ -560,5 +555,21 @@ gst_vaapi_decoder_push_surface( ...@@ -560,5 +555,21 @@ gst_vaapi_decoder_push_surface(
GstClockTime timestamp GstClockTime timestamp
) )
{ {
return push_surface(decoder, surface, timestamp); GstVaapiDecoderPrivate * const priv = decoder->priv;
GstVaapiSurfaceProxy *proxy;
proxy = gst_vaapi_surface_proxy_new(priv->context, surface);
if (!proxy)
return FALSE;
return push_surface(decoder, proxy, timestamp);
}
gboolean
gst_vaapi_decoder_push_surface_proxy(
GstVaapiDecoder *decoder,
GstVaapiSurfaceProxy *proxy,
GstClockTime timestamp
)
{
return push_surface(decoder, g_object_ref(proxy), timestamp);
} }
/* /*
* gstvaapidecoder.h - VA decoder abstraction * gstvaapidecoder.h - VA decoder abstraction
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
......
/* /*
* gstvaapidecoder_ffmpeg.c - FFmpeg-based decoder * gstvaapidecoder_ffmpeg.c - FFmpeg-based decoder
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* Copyright (C) 2011 Intel Corporation * Copyright (C) 2011-2012 Intel Corporation
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
* @short_description: FFmpeg-based decoder * @short_description: FFmpeg-based decoder
*/ */
#include "config.h" #include "sysdeps.h"
#ifdef HAVE_LIBAVCODEC_AVCODEC_H #ifdef HAVE_LIBAVCODEC_AVCODEC_H
# include <libavcodec/avcodec.h> # include <libavcodec/avcodec.h>
#endif #endif
...@@ -260,6 +260,7 @@ gst_vaapi_decoder_ffmpeg_get_buffer(AVCodecContext *avctx, AVFrame *pic) ...@@ -260,6 +260,7 @@ gst_vaapi_decoder_ffmpeg_get_buffer(AVCodecContext *avctx, AVFrame *pic)
GstVaapiContextFfmpeg * const vactx = avctx->hwaccel_context; GstVaapiContextFfmpeg * const vactx = avctx->hwaccel_context;
GstVaapiContext *context; GstVaapiContext *context;
GstVaapiSurface *surface; GstVaapiSurface *surface;
GstVaapiSurfaceProxy *proxy;
GstVaapiID surface_id; GstVaapiID surface_id;
context = get_context(avctx); context = get_context(avctx);
...@@ -272,12 +273,19 @@ gst_vaapi_decoder_ffmpeg_get_buffer(AVCodecContext *avctx, AVFrame *pic) ...@@ -272,12 +273,19 @@ gst_vaapi_decoder_ffmpeg_get_buffer(AVCodecContext *avctx, AVFrame *pic)
return -1; return -1;
} }
proxy = gst_vaapi_surface_proxy_new(context, surface);
if (!proxy) {
GST_DEBUG("failed to create proxy surface");
gst_vaapi_context_put_surface(context, surface);
return -1;
}
surface_id = GST_VAAPI_OBJECT_ID(surface); surface_id = GST_VAAPI_OBJECT_ID(surface);
GST_DEBUG("surface %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS(surface_id)); GST_DEBUG("surface %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS(surface_id));
pic->type = FF_BUFFER_TYPE_USER; pic->type = FF_BUFFER_TYPE_USER;
pic->age = 1; pic->age = 1;
pic->data[0] = (uint8_t *)surface; pic->data[0] = (uint8_t *)proxy;
pic->data[1] = NULL; pic->data[1] = NULL;
pic->data[2] = NULL; pic->data[2] = NULL;
pic->data[3] = (uint8_t *)(uintptr_t)surface_id; pic->data[3] = (uint8_t *)(uintptr_t)surface_id;
...@@ -301,10 +309,13 @@ gst_vaapi_decoder_ffmpeg_reget_buffer(AVCodecContext *avctx, AVFrame *pic) ...@@ -301,10 +309,13 @@ gst_vaapi_decoder_ffmpeg_reget_buffer(AVCodecContext *avctx, AVFrame *pic)
static void static void
gst_vaapi_decoder_ffmpeg_release_buffer(AVCodecContext *avctx, AVFrame *pic) gst_vaapi_decoder_ffmpeg_release_buffer(AVCodecContext *avctx, AVFrame *pic)
{ {
GstVaapiSurfaceProxy * const proxy = GST_VAAPI_SURFACE_PROXY(pic->data[0]);
GstVaapiID surface_id = GST_VAAPI_ID(GPOINTER_TO_UINT(pic->data[3])); GstVaapiID surface_id = GST_VAAPI_ID(GPOINTER_TO_UINT(pic->data[3]));
GST_DEBUG("surface %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS(surface_id)); GST_DEBUG("surface %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS(surface_id));
g_object_unref(proxy);
pic->data[0] = NULL; pic->data[0] = NULL;
pic->data[1] = NULL; pic->data[1] = NULL;
pic->data[2] = NULL; pic->data[2] = NULL;
...@@ -477,7 +488,7 @@ decode_frame(GstVaapiDecoderFfmpeg *ffdecoder, guchar *buf, guint buf_size) ...@@ -477,7 +488,7 @@ decode_frame(GstVaapiDecoderFfmpeg *ffdecoder, guchar *buf, guint buf_size)
{ {
GstVaapiDecoderFfmpegPrivate * const priv = ffdecoder->priv; GstVaapiDecoderFfmpegPrivate * const priv = ffdecoder->priv;
GstVaapiDisplay * const display = GST_VAAPI_DECODER_DISPLAY(ffdecoder); GstVaapiDisplay * const display = GST_VAAPI_DECODER_DISPLAY(ffdecoder);
GstVaapiSurface *surface; GstVaapiSurfaceProxy *proxy;
int bytes_read, got_picture = 0; int bytes_read, got_picture = 0;
AVPacket pkt; AVPacket pkt;
...@@ -498,15 +509,12 @@ decode_frame(GstVaapiDecoderFfmpeg *ffdecoder, guchar *buf, guint buf_size) ...@@ -498,15 +509,12 @@ decode_frame(GstVaapiDecoderFfmpeg *ffdecoder, guchar *buf, guint buf_size)
if (bytes_read < 0) if (bytes_read < 0)
return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN;
surface = gst_vaapi_context_find_surface_by_id( proxy = GST_VAAPI_SURFACE_PROXY(priv->frame->data[0]);
GST_VAAPI_DECODER_CONTEXT(ffdecoder), if (!proxy)
GPOINTER_TO_UINT(priv->frame->data[3])
);
if (!surface)
return GST_VAAPI_DECODER_STATUS_ERROR_INVALID_SURFACE; return GST_VAAPI_DECODER_STATUS_ERROR_INVALID_SURFACE;
if (!gst_vaapi_decoder_push_surface(GST_VAAPI_DECODER_CAST(ffdecoder), if (!gst_vaapi_decoder_push_surface_proxy(GST_VAAPI_DECODER_CAST(ffdecoder),
surface, priv->frame->pts)) proxy, priv->frame->pts))
return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED; return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED;
return GST_VAAPI_DECODER_STATUS_SUCCESS; return GST_VAAPI_DECODER_STATUS_SUCCESS;
} }
......
/* /*
* gstvaapidecoder_ffmpeg.h - FFmpeg-based decoder * gstvaapidecoder_ffmpeg.h - FFmpeg-based decoder
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
......
/* /*
* gstvaapidecoder_priv.h - VA decoder abstraction (private definitions) * gstvaapidecoder_priv.h - VA decoder abstraction (private definitions)
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* Copyright (C) 2011-2012 Intel Corporation
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
...@@ -23,7 +24,6 @@ ...@@ -23,7 +24,6 @@
#define GST_VAAPI_DECODER_PRIV_H #define GST_VAAPI_DECODER_PRIV_H
#include <glib.h> #include <glib.h>
#include <gst/gsttask.h>
#include <gst/vaapi/gstvaapidecoder.h> #include <gst/vaapi/gstvaapidecoder.h>
#include <gst/vaapi/gstvaapicontext.h> #include <gst/vaapi/gstvaapicontext.h>
...@@ -170,6 +170,13 @@ gst_vaapi_decoder_push_surface( ...@@ -170,6 +170,13 @@ gst_vaapi_decoder_push_surface(
GstClockTime timestamp GstClockTime timestamp
) attribute_hidden; ) attribute_hidden;
gboolean
gst_vaapi_decoder_push_surface_proxy(
GstVaapiDecoder *decoder,
GstVaapiSurfaceProxy *proxy,
GstClockTime timestamp
) attribute_hidden;
G_END_DECLS G_END_DECLS
#endif /* GST_VAAPI_DECODER_PRIV_H */ #endif /* GST_VAAPI_DECODER_PRIV_H */
/* /*
* gstvaapidisplay.c - VA display abstraction * gstvaapidisplay.c - VA display abstraction
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* Copyright (C) 2011 Intel Corporation
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
...@@ -24,7 +25,7 @@ ...@@ -24,7 +25,7 @@
* @short_description: VA display abstraction * @short_description: VA display abstraction
*/ */
#include "config.h" #include "sysdeps.h"
#include "gstvaapiutils.h" #include "gstvaapiutils.h"
#include "gstvaapidisplay.h" #include "gstvaapidisplay.h"
#include "gstvaapidisplay_priv.h" #include "gstvaapidisplay_priv.h"
...@@ -142,6 +143,9 @@ find_config( ...@@ -142,6 +143,9 @@ find_config(
GstVaapiConfig *config; GstVaapiConfig *config;
guint i; guint i;
if (!configs)
return FALSE;
for (i = 0; i < configs->len; i++) { for (i = 0; i < configs->len; i++) {
config = &g_array_index(configs, GstVaapiConfig, i); config = &g_array_index(configs, GstVaapiConfig, i);
if (config->profile == profile && config->entrypoint == entrypoint) if (config->profile == profile && config->entrypoint == entrypoint)
...@@ -158,6 +162,9 @@ get_profile_caps(GArray *configs) ...@@ -158,6 +162,9 @@ get_profile_caps(GArray *configs)
GstCaps *out_caps, *caps; GstCaps *out_caps, *caps;
guint i; guint i;
if (!configs)
return NULL;
out_caps = gst_caps_new_empty(); out_caps = gst_caps_new_empty();
if (!out_caps) if (!out_caps)
return NULL; return NULL;
...@@ -284,6 +291,7 @@ gst_vaapi_display_destroy(GstVaapiDisplay *display) ...@@ -284,6 +291,7 @@ gst_vaapi_display_destroy(GstVaapiDisplay *display)
if (klass->close_display) if (klass->close_display)
klass->close_display(display); klass->close_display(display);
} }
g_static_rec_mutex_free(&priv->mutex);
} }
static gboolean static gboolean
...@@ -497,7 +505,8 @@ gst_vaapi_display_constructed(GObject *object) ...@@ -497,7 +505,8 @@ gst_vaapi_display_constructed(GObject *object)
GObjectClass *parent_class; GObjectClass *parent_class;
display->priv->create_display = display->priv->display == NULL; display->priv->create_display = display->priv->display == NULL;
gst_vaapi_display_create(display); if (!gst_vaapi_display_create(display))
gst_vaapi_display_destroy(display);
parent_class = G_OBJECT_CLASS(gst_vaapi_display_parent_class); parent_class = G_OBJECT_CLASS(gst_vaapi_display_parent_class);
if (parent_class->constructed) if (parent_class->constructed)
......
/* /*
* gstvaapidisplay.h - VA display abstraction * gstvaapidisplay.h - VA display abstraction
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
......
/* /*
* gstvaapidisplay_glx.c - VA/GLX display abstraction * gstvaapidisplay_glx.c - VA/GLX display abstraction
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
* @short_description: VA/GLX display abstraction * @short_description: VA/GLX display abstraction
*/ */
#include "config.h" #include "sysdeps.h"
#include "gstvaapicompat.h" #include "gstvaapicompat.h"
#include "gstvaapiutils.h" #include "gstvaapiutils.h"
#include "gstvaapiutils_glx.h" #include "gstvaapiutils_glx.h"
......
/* /*
* gstvaapidisplay_glx.h - VA/GLX display abstraction * gstvaapidisplay_glx.h - VA/GLX display abstraction
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
......
/* /*
* gstvaapidisplay_glx_priv.h - Internal VA/GLX interface * gstvaapidisplay_glx_priv.h - Internal VA/GLX interface
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
......
/* /*
* gstvaapidisplay_priv.h - Base VA display (private definitions) * gstvaapidisplay_priv.h - Base VA display (private definitions)
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
......
/* /*
* gstvaapidisplay_x11.c - VA/X11 display abstraction * gstvaapidisplay_x11.c - VA/X11 display abstraction
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
* @short_description: VA/X11 display abstraction * @short_description: VA/X11 display abstraction
*/ */
#include "config.h" #include "sysdeps.h"
#include "gstvaapiutils.h" #include "gstvaapiutils.h"
#include "gstvaapidisplay_priv.h" #include "gstvaapidisplay_priv.h"
#include "gstvaapidisplay_x11.h" #include "gstvaapidisplay_x11.h"
......
/* /*
* gstvaapidisplay_x11.h - VA/X11 display abstraction * gstvaapidisplay_x11.h - VA/X11 display abstraction
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
......
/* /*
* gstvaapidisplay_x11_priv.h - Internal VA/X11 interface * gstvaapidisplay_x11_priv.h - Internal VA/X11 interface
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
......
This diff is collapsed.
/* /*
* gstvaapiimage.h - VA image abstraction * gstvaapiimage.h - VA image abstraction
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* Copyright (C) 2011 Intel Corporation
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
...@@ -80,6 +81,7 @@ G_BEGIN_DECLS ...@@ -80,6 +81,7 @@ G_BEGIN_DECLS
typedef struct _GstVaapiImage GstVaapiImage; typedef struct _GstVaapiImage GstVaapiImage;
typedef struct _GstVaapiImagePrivate GstVaapiImagePrivate; typedef struct _GstVaapiImagePrivate GstVaapiImagePrivate;
typedef struct _GstVaapiImageClass GstVaapiImageClass; typedef struct _GstVaapiImageClass GstVaapiImageClass;
typedef struct _GstVaapiImageRaw GstVaapiImageRaw;
/** /**
* GstVaapiImage: * GstVaapiImage:
...@@ -103,6 +105,21 @@ struct _GstVaapiImageClass { ...@@ -103,6 +105,21 @@ struct _GstVaapiImageClass {
GstVaapiObjectClass parent_class; GstVaapiObjectClass parent_class;
}; };
/**
* GstVaapiImageRaw:
*
* A raw image wrapper. The caller is responsible for initializing all
* the fields with sensible values.
*/
struct _GstVaapiImageRaw {
GstVaapiImageFormat format;
guint width;
guint height;
guint num_planes;
guchar *pixels[3];
guint stride[3];
};
GType GType
gst_vaapi_image_get_type(void); gst_vaapi_image_get_type(void);
...@@ -160,7 +177,11 @@ guint ...@@ -160,7 +177,11 @@ guint
gst_vaapi_image_get_data_size(GstVaapiImage *image); gst_vaapi_image_get_data_size(GstVaapiImage *image);
gboolean gboolean
gst_vaapi_image_update_from_buffer(GstVaapiImage *image, GstBuffer *buffer); gst_vaapi_image_update_from_buffer(
GstVaapiImage *image,
GstBuffer *buffer,
GstVaapiRectangle *rect
);
G_END_DECLS G_END_DECLS
......
/* /*
* gstvaapiimageformat.c - VA image format abstraction * gstvaapiimageformat.c - VA image format abstraction
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* Copyright (C) 2011 Intel Corporation
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
...@@ -24,7 +25,7 @@ ...@@ -24,7 +25,7 @@
* @short_description: VA image format abstraction * @short_description: VA image format abstraction
*/ */
#include "config.h" #include "sysdeps.h"
#include <gst/video/video.h> #include <gst/video/video.h>
#include "gstvaapicompat.h" #include "gstvaapicompat.h"
#include "gstvaapiimageformat.h" #include "gstvaapiimageformat.h"
...@@ -233,6 +234,35 @@ gst_vaapi_image_format_from_fourcc(guint32 fourcc) ...@@ -233,6 +234,35 @@ gst_vaapi_image_format_from_fourcc(guint32 fourcc)
return (GstVaapiImageFormat)fourcc; return (GstVaapiImageFormat)fourcc;
} }
/**
* gst_vaapi_image_format_from_video:
* @format: a #GstVideoFormat
*
* Converts a #GstVideoFormat into the corresponding
* #GstVaapiImageFormat. If the image format cannot be represented by
* #GstVaapiImageFormat, then zero is returned.
*
* Return value: the #GstVaapiImageFormat describing the video format
*/
GstVaapiImageFormat
gst_vaapi_image_format_from_video(GstVideoFormat format)
{
GstVaapiImageFormat va_format;
switch (format) {
case GST_VIDEO_FORMAT_NV12: va_format = GST_VAAPI_IMAGE_NV12; break;
case GST_VIDEO_FORMAT_YV12: va_format = GST_VAAPI_IMAGE_YV12; break;
case GST_VIDEO_FORMAT_I420: va_format = GST_VAAPI_IMAGE_I420; break;
case GST_VIDEO_FORMAT_AYUV: va_format = GST_VAAPI_IMAGE_AYUV; break;
case GST_VIDEO_FORMAT_ARGB: va_format = GST_VAAPI_IMAGE_ARGB; break;
case GST_VIDEO_FORMAT_RGBA: va_format = GST_VAAPI_IMAGE_RGBA; break;
case GST_VIDEO_FORMAT_ABGR: va_format = GST_VAAPI_IMAGE_ABGR; break;
case GST_VIDEO_FORMAT_BGRA: va_format = GST_VAAPI_IMAGE_BGRA; break;
default: va_format = (GstVaapiImageFormat)0; break;
}
return va_format;
}
/** /**
* gst_vaapi_image_format_get_va_format: * gst_vaapi_image_format_get_va_format:
* @format: a #GstVaapiImageFormat * @format: a #GstVaapiImageFormat
......
/* /*
* gstvaapiimageformat.h - VA image format abstraction * gstvaapiimageformat.h - VA image format abstraction
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* Copyright (C) 2011 Intel Corporation
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
...@@ -23,6 +24,7 @@ ...@@ -23,6 +24,7 @@
#define GST_VAAPI_IMAGE_FORMAT_H #define GST_VAAPI_IMAGE_FORMAT_H
#include <gst/gstvalue.h> #include <gst/gstvalue.h>
#include <gst/video/video.h>
G_BEGIN_DECLS G_BEGIN_DECLS
...@@ -75,6 +77,9 @@ gst_vaapi_image_format_from_caps(GstCaps *caps); ...@@ -75,6 +77,9 @@ gst_vaapi_image_format_from_caps(GstCaps *caps);
GstVaapiImageFormat GstVaapiImageFormat
gst_vaapi_image_format_from_fourcc(guint32 fourcc); gst_vaapi_image_format_from_fourcc(guint32 fourcc);
GstVaapiImageFormat
gst_vaapi_image_format_from_video(GstVideoFormat format);
const VAImageFormat * const VAImageFormat *
gst_vaapi_image_format_get_va_format(GstVaapiImageFormat format); gst_vaapi_image_format_get_va_format(GstVaapiImageFormat format);
......
/* /*
* gstvaapiimagepool.c - Gst VA image pool * gstvaapiimagepool.c - Gst VA image pool
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
* @short_description: VA image pool * @short_description: VA image pool
*/ */
#include "config.h" #include "sysdeps.h"
#include "gstvaapiimagepool.h" #include "gstvaapiimagepool.h"
#define DEBUG 1 #define DEBUG 1
......
/* /*
* gstvaapiimagepool.h - Gst VA image pool * gstvaapiimagepool.h - Gst VA image pool
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
......
/* /*
* gstvaapiobject.c - Base VA object * gstvaapiobject.c - Base VA object
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
* @short_description: Base VA object * @short_description: Base VA object
*/ */
#include "config.h" #include "sysdeps.h"
#include "gstvaapiobject.h" #include "gstvaapiobject.h"
#include "gstvaapi_priv.h" #include "gstvaapi_priv.h"
#include "gstvaapiparamspecs.h" #include "gstvaapiparamspecs.h"
......
/* /*
* gstvaapiobject.h - Base VA object * gstvaapiobject.h - Base VA object
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
......
/* /*
* gstvaapiobject_priv.h - Base VA object (private definitions) * gstvaapiobject_priv.h - Base VA object (private definitions)
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
......
/* /*
* gstvaapiparamspecs.c - GParamSpecs for some of our types * gstvaapiparamspecs.c - GParamSpecs for some of our types
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
* @short_description: GParamSpecs for some of our types * @short_description: GParamSpecs for some of our types
*/ */
#include "config.h" #include "sysdeps.h"
#include "gstvaapiparamspecs.h" #include "gstvaapiparamspecs.h"
#include "gstvaapivalue.h" #include "gstvaapivalue.h"
......
/* /*
* gstvaapiparamspecs.h - GParamSpecs for some of our types * gstvaapiparamspecs.h - GParamSpecs for some of our types
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
......
/* /*
* gstvaapiprofile.c - VA profile abstraction * gstvaapiprofile.c - VA profile abstraction
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
* @short_description: VA profile abstraction * @short_description: VA profile abstraction
*/ */
#include "config.h" #include "sysdeps.h"
#include <string.h> #include <string.h>
#include <gst/gstbuffer.h> #include <gst/gstbuffer.h>
#include "gstvaapicompat.h" #include "gstvaapicompat.h"
......
/* /*
* gstvaapiprofile.h - VA profile abstraction * gstvaapiprofile.h - VA profile abstraction
* *
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems * Copyright (C) 2010-2011 Splitted-Desktop Systems
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
......