...
 
Commits (70)
ABOUT-NLS
_stdint.h
aclocal.m4
autom4te.cache
autoregen.sh
compile
config.guess
config.h*
config.log
config.rpath
config.status
config.guess
config.sub
config.rpath
configure
libtool
stamp-h
stamp-h.in
stamp-h1
depcomp
gst-element-check-*.m4
gstreamer-vaapi-*.tar.gz
install-sh
libtool
ltmain.sh
missing
mkinstalldirs
compile
install-sh
depcomp
autoregen.sh
ABOUT-NLS
_stdint.h
stamp-h
stamp-h.in
stamp-h1
/m4
......@@ -34,6 +35,7 @@ Makefile
*~
*.swp
debian.build/
debian.upstream/changelog
debian.upstream/control
debian.upstream/gstreamer0.10-vaapi-doc.install
......@@ -42,8 +44,17 @@ debian.upstream/libgstvaapi-dev.install
debian.upstream/libgstvaapi-glx-0.install
debian.upstream/libgstvaapi-x11-0.install
debian.upstream/libgstvaapi0.install
docs/reference/libs/html*
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/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.h
gst-libs/gst/vaapi/stamp-marshal
......@@ -56,4 +67,3 @@ tests/test-display
tests/test-surfaces
tests/test-textures
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) 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
* Relicense plugins and tests to LGPL v2.1 (SDS)
......
......@@ -3,7 +3,8 @@
VA-API support to GStreamer
Copyright (C) 2010-2011 Splitted-Desktop Systems
Copyright (C) 2011 Intel Corporation
Copyright (C) 2011-2012 Intel Corporation
Copyright (C) 2011 Collabora Ltd.
License
......
......@@ -36,4 +36,6 @@ else
ACLOCAL="${ACLOCAL-aclocal} $ACLOCAL_FLAGS" autoreconf -v --install || exit $?
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
m4_define([gst_vaapi_major_version], [0])
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],
[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
m4_define([gst_major_version], [0])
......@@ -21,17 +25,13 @@ m4_define([gst_plugins_base_micro_version], [16])
m4_define([gst_plugins_base_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
m4_define([libva_sds_version_0_29], [8])
m4_define([libva_sds_package_version_0_29], [0.29-2+sds11])
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])
m4_define([libva_x11_package_version], [1.0.3])
m4_define([libva_glx_package_version], [1.0.9])
# gtk-doc version number
# XXX: introspection annotations require gtk-doc >= 1.12
......@@ -54,8 +54,8 @@ AC_SUBST(TODAY)
GST_VAAPI_MAJOR_VERSION=gst_vaapi_major_version
AC_SUBST(GST_VAAPI_MAJOR_VERSION)
LIBVA_SDS_PACKAGE_VERSION=libva_sds_package_version
AC_SUBST(LIBVA_SDS_PACKAGE_VERSION)
LIBVA_PACKAGE_VERSION=libva_x11_package_version
AC_SUBST(LIBVA_PACKAGE_VERSION)
dnl Versions for GStreamer and plugins-base
GST_MAJORMINOR=gst_major_minor_version
......@@ -129,6 +129,9 @@ AC_SUBST(GTKDOC_VERSION)
dnl Check for GLib
AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
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_LIBS)
......@@ -146,6 +149,14 @@ PKG_CHECK_MODULES([GST_PLUGINS_BASE],
AC_SUBST(GST_PLUGINS_BASE_CFLAGS)
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
PKG_CHECK_MODULES([GST_BASE],
[gstreamer-base-$GST_MAJORMINOR >= $GST_VERSION_REQUIRED]
......@@ -299,12 +310,7 @@ VA_VERSION=`$PKG_CONFIG --modversion libva`
VA_MAJOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f1`
VA_MINOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f2`
VA_MICRO_VERSION=`echo "$VA_VERSION" | cut -d'.' -f3`
VA_SDS_VERSION=`$PKG_CONFIG libva --variable sdsversion`
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
AC_SUBST(pkgconfigdir)
......@@ -333,6 +339,7 @@ debian.upstream/libgstvaapi-glx.install.in
docs/reference/plugins/plugins-docs.xml
gst-libs/Makefile
gst-libs/gst/Makefile
gst-libs/gst/gstutils_version.h
gst-libs/gst/vaapi/Makefile
pkgconfig/Makefile
pkgconfig/gstreamer-vaapi-$GST_MAJORMINOR.pc:\
......@@ -342,9 +349,7 @@ pkgconfig/gstreamer-vaapi-glx.pc.in
pkgconfig/gstreamer-vaapi-x11-$GST_MAJORMINOR.pc:\
pkgconfig/gstreamer-vaapi-x11.pc.in
gst/Makefile
gst/vaapiconvert/Makefile
gst/vaapidecode/Makefile
gst/vaapisink/Makefile
gst/vaapi/Makefile
tests/Makefile
])
......
......@@ -7,7 +7,7 @@ Build-Depends: debhelper (>= 5),
libglib2.0-dev,
libgstreamer@GST_MAJORMINOR@-dev (>= @GST_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@)
Standards-Version: 3.7.2
......@@ -18,6 +18,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}
Suggests: gstreamer@GST_MAJORMINOR@-vaapi-doc
Description: VA-API plugins for GStreamer
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
- `vaapisink': a VA-API based video sink
......
......@@ -9,7 +9,8 @@ Copyright:
License:
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
the terms of the GNU Lesser General Public License v2.1+.
......
......@@ -377,6 +377,7 @@ gst_vaapi_image_format_is_yuv
gst_vaapi_image_format
gst_vaapi_image_format_from_caps
gst_vaapi_image_format_from_fourcc
gst_vaapi_image_format_from_video
gst_vaapi_image_format_get_va_format
gst_vaapi_image_format_get_caps
gst_vaapi_image_format_get_score
......@@ -491,6 +492,7 @@ gst_vaapi_surface_proxy_new
gst_vaapi_surface_proxy_get_context
gst_vaapi_surface_proxy_set_context
gst_vaapi_surface_proxy_get_surface
gst_vaapi_surface_proxy_get_surface_id
gst_vaapi_surface_proxy_set_surface
gst_vaapi_surface_proxy_get_timestamp
gst_vaapi_surface_proxy_set_timestamp
......
......@@ -90,9 +90,7 @@ INCLUDES = \
GTKDOC_LIBS = \
$(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-$(GST_MAJORMINOR).la \
$(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11-$(GST_MAJORMINOR).la \
$(top_builddir)/gst/vaapidecode/libgstvaapidecode.la \
$(top_builddir)/gst/vaapiconvert/libgstvaapiconvert.la \
$(top_builddir)/gst/vaapisink/libgstvaapisink.la \
$(top_builddir)/gst/vaapi/libgstvaapi.la \
$(GLIB_LIBS) \
$(GST_LIBS) \
$(NULL)
......
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*
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 = \
$(NULL)
libgstvaapi_source_priv_h = \
glibcompat.h \
gstvaapi_priv.h \
gstvaapicompat.h \
gstvaapidebug.h \
......@@ -78,6 +79,7 @@ libgstvaapi_source_priv_h = \
gstvaapiobject_priv.h \
gstvaapiutils.h \
gstvaapiutils_gst.h \
sysdeps.h \
$(libgst_vaapi_ffmpeg_source_priv_h) \
$(NULL)
......@@ -138,6 +140,7 @@ libgstvaapi_@GST_MAJORMINOR@includedir = \
libgstvaapi_@GST_MAJORMINOR@_la_CFLAGS = \
-I$(top_srcdir)/gst-libs \
$(GST_BASE_CFLAGS) \
$(GST_VIDEO_CFLAGS) \
$(GST_CFLAGS) \
$(LIBAVCODEC_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
*
* 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
* modify it under the terms of the GNU Lesser General Public License
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......@@ -91,4 +91,9 @@ typedef struct _VASliceParameterBufferBase {
#define vaAssociateSubpicture vaAssociateSubpicture2
#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 */
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......@@ -24,7 +24,7 @@
* @short_description: VA context abstraction
*/
#include "config.h"
#include "sysdeps.h"
#include <assert.h>
#include "gstvaapicompat.h"
#include "gstvaapicontext.h"
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......
/*
* gstvaapidecoder.c - VA decoder abstraction
*
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems
* Copyright (C) 2011 Intel Corporation
* Copyright (C) 2010-2011 Splitted-Desktop Systems
* Copyright (C) 2011-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
......@@ -25,7 +25,7 @@
* @short_description: VA decoder abstraction
*/
#include "config.h"
#include "sysdeps.h"
#include <assert.h>
#include <string.h>
#include "gstvaapicompat.h"
......@@ -126,20 +126,15 @@ decode_step(GstVaapiDecoder *decoder)
static gboolean
push_surface(
GstVaapiDecoder *decoder,
GstVaapiSurface *surface,
GstClockTime timestamp
GstVaapiDecoder *decoder,
GstVaapiSurfaceProxy *proxy,
GstClockTime timestamp
)
{
GstVaapiDecoderPrivate * const priv = decoder->priv;
GstVaapiSurfaceProxy *proxy;
GST_DEBUG("queue decoded surface %" GST_VAAPI_ID_FORMAT,
GST_VAAPI_ID_ARGS(GST_VAAPI_OBJECT_ID(surface)));
proxy = gst_vaapi_surface_proxy_new(priv->context, surface);
if (!proxy)
return FALSE;
GST_VAAPI_ID_ARGS(gst_vaapi_surface_proxy_get_surface_id(proxy)));
gst_vaapi_surface_proxy_set_timestamp(proxy, timestamp);
g_queue_push_tail(priv->surfaces, proxy);
......@@ -560,5 +555,21 @@ gst_vaapi_decoder_push_surface(
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
*
* 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
* modify it under the terms of the GNU Lesser General Public License
......
/*
* gstvaapidecoder_ffmpeg.c - FFmpeg-based decoder
*
* gstreamer-vaapi (C) 2010-2011 Splitted-Desktop Systems
* Copyright (C) 2011 Intel Corporation
* Copyright (C) 2010-2011 Splitted-Desktop Systems
* Copyright (C) 2011-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
......@@ -25,7 +25,7 @@
* @short_description: FFmpeg-based decoder
*/
#include "config.h"
#include "sysdeps.h"
#ifdef HAVE_LIBAVCODEC_AVCODEC_H
# include <libavcodec/avcodec.h>
#endif
......@@ -260,6 +260,7 @@ gst_vaapi_decoder_ffmpeg_get_buffer(AVCodecContext *avctx, AVFrame *pic)
GstVaapiContextFfmpeg * const vactx = avctx->hwaccel_context;
GstVaapiContext *context;
GstVaapiSurface *surface;
GstVaapiSurfaceProxy *proxy;
GstVaapiID surface_id;
context = get_context(avctx);
......@@ -272,12 +273,19 @@ gst_vaapi_decoder_ffmpeg_get_buffer(AVCodecContext *avctx, AVFrame *pic)
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);
GST_DEBUG("surface %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS(surface_id));
pic->type = FF_BUFFER_TYPE_USER;
pic->age = 1;
pic->data[0] = (uint8_t *)surface;
pic->data[0] = (uint8_t *)proxy;
pic->data[1] = NULL;
pic->data[2] = NULL;
pic->data[3] = (uint8_t *)(uintptr_t)surface_id;
......@@ -301,10 +309,13 @@ gst_vaapi_decoder_ffmpeg_reget_buffer(AVCodecContext *avctx, AVFrame *pic)
static void
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]));
GST_DEBUG("surface %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS(surface_id));
g_object_unref(proxy);
pic->data[0] = NULL;
pic->data[1] = NULL;
pic->data[2] = NULL;
......@@ -477,7 +488,7 @@ decode_frame(GstVaapiDecoderFfmpeg *ffdecoder, guchar *buf, guint buf_size)
{
GstVaapiDecoderFfmpegPrivate * const priv = ffdecoder->priv;
GstVaapiDisplay * const display = GST_VAAPI_DECODER_DISPLAY(ffdecoder);
GstVaapiSurface *surface;
GstVaapiSurfaceProxy *proxy;
int bytes_read, got_picture = 0;
AVPacket pkt;
......@@ -498,15 +509,12 @@ decode_frame(GstVaapiDecoderFfmpeg *ffdecoder, guchar *buf, guint buf_size)
if (bytes_read < 0)
return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN;
surface = gst_vaapi_context_find_surface_by_id(
GST_VAAPI_DECODER_CONTEXT(ffdecoder),
GPOINTER_TO_UINT(priv->frame->data[3])
);
if (!surface)
proxy = GST_VAAPI_SURFACE_PROXY(priv->frame->data[0]);
if (!proxy)
return GST_VAAPI_DECODER_STATUS_ERROR_INVALID_SURFACE;
if (!gst_vaapi_decoder_push_surface(GST_VAAPI_DECODER_CAST(ffdecoder),
surface, priv->frame->pts))
if (!gst_vaapi_decoder_push_surface_proxy(GST_VAAPI_DECODER_CAST(ffdecoder),
proxy, priv->frame->pts))
return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED;
return GST_VAAPI_DECODER_STATUS_SUCCESS;
}
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......@@ -23,7 +24,6 @@
#define GST_VAAPI_DECODER_PRIV_H
#include <glib.h>
#include <gst/gsttask.h>
#include <gst/vaapi/gstvaapidecoder.h>
#include <gst/vaapi/gstvaapicontext.h>
......@@ -170,6 +170,13 @@ gst_vaapi_decoder_push_surface(
GstClockTime timestamp
) attribute_hidden;
gboolean
gst_vaapi_decoder_push_surface_proxy(
GstVaapiDecoder *decoder,
GstVaapiSurfaceProxy *proxy,
GstClockTime timestamp
) attribute_hidden;
G_END_DECLS
#endif /* GST_VAAPI_DECODER_PRIV_H */
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......@@ -24,7 +25,7 @@
* @short_description: VA display abstraction
*/
#include "config.h"
#include "sysdeps.h"
#include "gstvaapiutils.h"
#include "gstvaapidisplay.h"
#include "gstvaapidisplay_priv.h"
......@@ -142,6 +143,9 @@ find_config(
GstVaapiConfig *config;
guint i;
if (!configs)
return FALSE;
for (i = 0; i < configs->len; i++) {
config = &g_array_index(configs, GstVaapiConfig, i);
if (config->profile == profile && config->entrypoint == entrypoint)
......@@ -158,6 +162,9 @@ get_profile_caps(GArray *configs)
GstCaps *out_caps, *caps;
guint i;
if (!configs)
return NULL;
out_caps = gst_caps_new_empty();
if (!out_caps)
return NULL;
......@@ -284,6 +291,7 @@ gst_vaapi_display_destroy(GstVaapiDisplay *display)
if (klass->close_display)
klass->close_display(display);
}
g_static_rec_mutex_free(&priv->mutex);
}
static gboolean
......@@ -497,7 +505,8 @@ gst_vaapi_display_constructed(GObject *object)
GObjectClass *parent_class;
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);
if (parent_class->constructed)
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......@@ -24,7 +24,7 @@
* @short_description: VA/GLX display abstraction
*/
#include "config.h"
#include "sysdeps.h"
#include "gstvaapicompat.h"
#include "gstvaapiutils.h"
#include "gstvaapiutils_glx.h"
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......@@ -24,7 +24,7 @@
* @short_description: VA/X11 display abstraction
*/
#include "config.h"
#include "sysdeps.h"
#include "gstvaapiutils.h"
#include "gstvaapidisplay_priv.h"
#include "gstvaapidisplay_x11.h"
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......
This diff is collapsed.
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......@@ -80,6 +81,7 @@ G_BEGIN_DECLS
typedef struct _GstVaapiImage GstVaapiImage;
typedef struct _GstVaapiImagePrivate GstVaapiImagePrivate;
typedef struct _GstVaapiImageClass GstVaapiImageClass;
typedef struct _GstVaapiImageRaw GstVaapiImageRaw;
/**
* GstVaapiImage:
......@@ -103,6 +105,21 @@ struct _GstVaapiImageClass {
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
gst_vaapi_image_get_type(void);
......@@ -160,7 +177,11 @@ guint
gst_vaapi_image_get_data_size(GstVaapiImage *image);
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
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......@@ -24,7 +25,7 @@
* @short_description: VA image format abstraction
*/
#include "config.h"
#include "sysdeps.h"
#include <gst/video/video.h>
#include "gstvaapicompat.h"
#include "gstvaapiimageformat.h"
......@@ -233,6 +234,35 @@ gst_vaapi_image_format_from_fourcc(guint32 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:
* @format: a #GstVaapiImageFormat
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......@@ -23,6 +24,7 @@
#define GST_VAAPI_IMAGE_FORMAT_H
#include <gst/gstvalue.h>
#include <gst/video/video.h>
G_BEGIN_DECLS
......@@ -75,6 +77,9 @@ gst_vaapi_image_format_from_caps(GstCaps *caps);
GstVaapiImageFormat
gst_vaapi_image_format_from_fourcc(guint32 fourcc);
GstVaapiImageFormat
gst_vaapi_image_format_from_video(GstVideoFormat format);
const VAImageFormat *
gst_vaapi_image_format_get_va_format(GstVaapiImageFormat format);
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......@@ -24,7 +24,7 @@
* @short_description: VA image pool
*/
#include "config.h"
#include "sysdeps.h"
#include "gstvaapiimagepool.h"
#define DEBUG 1
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......@@ -24,7 +24,7 @@
* @short_description: Base VA object
*/
#include "config.h"
#include "sysdeps.h"
#include "gstvaapiobject.h"
#include "gstvaapi_priv.h"
#include "gstvaapiparamspecs.h"
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......@@ -24,7 +24,7 @@
* @short_description: GParamSpecs for some of our types
*/
#include "config.h"
#include "sysdeps.h"
#include "gstvaapiparamspecs.h"
#include "gstvaapivalue.h"
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......@@ -24,7 +24,7 @@
* @short_description: VA profile abstraction
*/
#include "config.h"
#include "sysdeps.h"
#include <string.h>
#include <gst/gstbuffer.h>
#include "gstvaapicompat.h"
......
/*
* 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
* modify it under the terms of the GNU Lesser General Public License
......
/*
* gstvaapisubpicture.c - VA subpicture 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
* modify it under the terms of the GNU Lesser General Public License
......@@ -24,7 +25,7 @@
* @short_description: VA subpicture abstraction
*/
#include "config.h"
#include "sysdeps.h"
#include <string.h>
#include "gstvaapicompat.h"
#include "gstvaapiutils.h"
......@@ -256,7 +257,7 @@ gst_vaapi_subpicture_get_image(GstVaapiSubpicture *subpicture)
* @image: a #GstVaapiImage
*
* Binds a new #GstVaapiImage to the @subpicture. The reference to the
* previous image is released a new one acquired on @image.
* previous image is released and a new one is acquired on @image.
*/
void
gst_vaapi_subpicture_set_image(
......
/*
* gstvaapisubpicture.h - VA subpicture 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
* modify it under the terms of the GNU Lesser General Public License
......
/*
* gstvaapisurface.c - VA surface 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
* modify it under the terms of the GNU Lesser General Public License
......@@ -24,7 +25,7 @@
* @short_description: VA surface abstraction
*/
#include "config.h"
#include "sysdeps.h"
#include "gstvaapicompat.h"
#include "gstvaapiutils.h"
#include "gstvaapisurface.h"
......@@ -679,7 +680,7 @@ gst_vaapi_surface_deassociate_subpicture(
/* First, check subpicture was really associated with this surface */
if (!g_ptr_array_remove_fast(surface->priv->subpictures, subpicture)) {
GST_DEBUG("subpicture %" GST_VAAPI_ID_FORMAT "was not bound to "
GST_DEBUG("subpicture %" GST_VAAPI_ID_FORMAT " was not bound to "
"surface %" GST_VAAPI_ID_FORMAT,
GST_VAAPI_ID_ARGS(GST_VAAPI_OBJECT_ID(subpicture)),
GST_VAAPI_ID_ARGS(GST_VAAPI_OBJECT_ID(surface)));
......
/*
* gstvaapisurface.h - VA surface 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
......
/*
* gstvaapisurfacepool.c - Gst VA surface 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
* modify it under the terms of the GNU Lesser General Public License
......@@ -24,7 +24,7 @@
* @short_description: VA surface pool
*/
#include "config.h"
#include "sysdeps.h"
#include "gstvaapisurfacepool.h"
#define DEBUG 1
......
/*
* gstvaapisurfacepool.h - Gst VA surface 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
* modify it under the terms of the GNU Lesser General Public License
......
/*
* gstvaapisurfaceproxy.c - VA surface proxy
*
* 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
* modify it under the terms of the GNU Lesser General Public License
......@@ -24,8 +25,9 @@
* @short_description: VA surface proxy
*/
#include "config.h"
#include "sysdeps.h"
#include "gstvaapisurfaceproxy.h"
#include "gstvaapiobject_priv.h"
#define DEBUG 1
#include "gstvaapidebug.h"
......@@ -55,19 +57,9 @@ static void
gst_vaapi_surface_proxy_finalize(GObject *object)
{
GstVaapiSurfaceProxy * const proxy = GST_VAAPI_SURFACE_PROXY(object);
GstVaapiSurfaceProxyPrivate * const priv = proxy->priv;
if (priv->surface) {
if (priv->context)
gst_vaapi_context_put_surface(priv->context, priv->surface);
g_object_unref(priv->surface);
priv->surface = NULL;
}
if (priv->context) {
g_object_unref(priv->context);
priv->context = NULL;
}
gst_vaapi_surface_proxy_set_surface(proxy, NULL);
gst_vaapi_surface_proxy_set_context(proxy, NULL);
G_OBJECT_CLASS(gst_vaapi_surface_proxy_parent_class)->finalize(object);
}
......@@ -226,16 +218,19 @@ gst_vaapi_surface_proxy_set_context(
GstVaapiContext *context
)
{
GstVaapiSurfaceProxyPrivate *priv;
g_return_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy));
g_return_if_fail(GST_VAAPI_IS_CONTEXT(context));
if (proxy->priv->context) {
g_object_unref(proxy->priv->context);
proxy->priv->context = NULL;
priv = proxy->priv;
if (priv->context) {
g_object_unref(priv->context);
priv->context = NULL;
}
if (context)
proxy->priv->context = g_object_ref(context);
priv->context = g_object_ref(context);
}
/**
......@@ -254,6 +249,23 @@ gst_vaapi_surface_proxy_get_surface(GstVaapiSurfaceProxy *proxy)
return proxy->priv->surface;
}
/**
* gst_vaapi_surface_proxy_get_surface_id:
* @proxy: a #GstVaapiSurfaceProxy
*
* Returns the VA surface ID stored in the @proxy.
*
* Return value: the #GstVaapiID
*/
GstVaapiID
gst_vaapi_surface_proxy_get_surface_id(GstVaapiSurfaceProxy *proxy)
{
g_return_val_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy), GST_VAAPI_ID_NONE);
g_return_val_if_fail(proxy->priv->surface != NULL, GST_VAAPI_ID_NONE);
return GST_VAAPI_OBJECT_ID(proxy->priv->surface);
}
/**
* gst_vaapi_surface_proxy_set_surface:
* @proxy: a #GstVaapiSurfaceProxy
......@@ -269,16 +281,21 @@ gst_vaapi_surface_proxy_set_surface(
GstVaapiSurface *surface
)
{
GstVaapiSurfaceProxyPrivate *priv;
g_return_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy));
g_return_if_fail(GST_VAAPI_IS_SURFACE(surface));