...
 
Commits (88)
......@@ -41,23 +41,29 @@ debian.upstream/control
debian.upstream/gstreamer0.10-vaapi-doc.install
debian.upstream/gstreamer0.10-vaapi.install
debian.upstream/libgstvaapi-dev.install
debian.upstream/libgstvaapi-drm-0.install
debian.upstream/libgstvaapi-glx-0.install
debian.upstream/libgstvaapi-wayland-0.install
debian.upstream/libgstvaapi-x11-0.install
debian.upstream/libgstvaapi0.install
docs/reference/libs/*.stamp
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/*.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/codecparsers/*.[ch]
gst-libs/gst/codecparsers/.timestamp.*
gst-libs/gst/gstutils_version.h
gtk-doc.make
pkgconfig/gstreamer-vaapi-0.10.pc
pkgconfig/gstreamer-vaapi-drm-0.10.pc
pkgconfig/gstreamer-vaapi-glx-0.10.pc
pkgconfig/gstreamer-vaapi-wayland-0.10.pc
pkgconfig/gstreamer-vaapi-x11-0.10.pc
tests/test-decode
tests/test-display
......
[submodule "ext/codecparsers"]
path = ext/codecparsers
url = git://gitorious.org/vaapi/gstreamer-codecparsers.git
......@@ -2,7 +2,7 @@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AUTOMAKE_OPTIONS = foreign
SUBDIRS = debian.upstream gst-libs gst pkgconfig tests docs
SUBDIRS = debian.upstream gst-libs gst pkgconfig tests docs ext
# Extra clean files so that maintainer-clean removes *everything*
MAINTAINERCLEANFILES = \
......@@ -15,11 +15,11 @@ DEB_BUILDDIR = debian.build
deb:
dpkg-buildpackage -rfakeroot -uc -us
deb.upstream: dist
deb.upstream: dist-bzip2
-mkdir -p $(DEB_BUILDDIR)
cd $(DEB_BUILDDIR) && \
rm -rf $(PACKAGE)-$(VERSION) && \
tar zxvf ../$(PACKAGE)-$(VERSION).tar.gz && \
tar jxvf ../$(PACKAGE)-$(VERSION).tar.bz2 && \
cd $(PACKAGE)-$(VERSION) && \
$(LN_S) debian.upstream debian && \
$(MAKE) deb -f Makefile.am
gst-vaapi NEWS -- summary of changes. 2012-08-DD
gst-vaapi NEWS -- summary of changes. 2013-02-05
Copyright (C) 2010-2011 Splitted-Desktop Systems
Copyright (C) 2011-2012 Intel Corporation
Copyright (C) 2011-2013 Intel Corporation
Copyright (C) 2011 Collabora
Version 0.4.0 - DD.Aug.2012
Version 0.4.3 - 05.Feb.2013
* Fix thread-safety issues in the Wayland renderer
* Fix decoding of MPEG-2 videos with height > 2800 pixels
* Fix MPEG-2 decoding with explicit quantization matrices set (Cong Zhong)
* Fix decoding of VC-1 videos in AVI containers (Feng Yuan)
* Fix VC-1 decoding bugs #692461, #692312, #692271, #692270, #692267
* Fix H.264 decoder recovery on corrupted SPS/PPS headers (Halley Zhao)
Version 0.4.2 - 18.Dec.2012
* Fix H.264 decoding on Cedar Trail platforms
* Fix MPEG-4 decoding at end-of-stream (Feng Yuan)
* Fix MPEG-4 decoding when a buffer contains multiple packets (Feng Yuan)
* Fix memory leak in GstVaapiVideoBuffer for images and surfaces (Feng Yuan)
* Fix symbols collision between built-in codecparsers/ and system library
* Use GST_PLUGIN_PATH, if set, to install plugin elements (Halley Zhao)
Version 0.4.1 - 27.Nov.2012
* Add support for H.264 interlaced streams
* Add support for Wayland 1.0 protocol (Robert Bradford)
* Add upstream bitstream parsers library (codecparsers)
* Fix build with the GNU gold linker
* Fix detection of H.264 picture boundaries
* Fix memory leak in MPEG-2 decoder for empty user-data packets
* Fix H.264 decoder with MMCO-based reference picture marking process
* Decode pending packets when an end-of-stream is received (+Feng Yuan)
* Use pixel-aspect-ratio from bitstream parsers (Simon Farnsworth)
Version 0.4.0 - 05.Oct.2012
* Add support for video rotation
* Add new video display APIs: Wayland and raw DRM for headless pipelines
* Drop FFmpeg-based decoders, only use codecparsers-based ones
* Only reset decoder if meaningful caps changed, e.g. size
* Allocate the minimal number of video surfaces useful for decoding
* Fix vaapisink to scale video down to fit the screen dimensions
* Fix vaapidecode crash when trying to release an inexisten lock (Philip Lorenz)
* Fix vaapidecode crash when trying to release inexistent lock (Philip Lorenz)
Version 0.3.8 - 20.Sep.2012
* Disable FFmpeg-based decoders by default
......
......@@ -3,7 +3,7 @@
VA-API support to GStreamer
Copyright (C) 2010-2011 Splitted-Desktop Systems
Copyright (C) 2011-2012 Intel Corporation
Copyright (C) 2011-2013 Intel Corporation
Copyright (C) 2011 Collabora Ltd.
......
......@@ -15,8 +15,19 @@ cd "$srcdir"
mkdir -p m4
GIT=`which git`
if test -z "$GIT"; then
echo "*** No git found ***"
exit 1
else
if test ! -f ext/codecparsers/autogen.sh; then
$GIT submodule init
fi
$GIT submodule update
fi
GTKDOCIZE=`which gtkdocize`
if test -z $GTKDOCIZE; then
if test -z "$GTKDOCIZE"; then
echo "*** No gtk-doc support ***"
echo "EXTRA_DIST =" > gtk-doc.make
else
......@@ -24,7 +35,7 @@ else
fi
AUTORECONF=`which autoreconf`
if test -z $AUTORECONF; then
if test -z "$AUTORECONF"; then
echo "*** No autoreconf found ***"
exit 1
else
......
# gstreamer-vaapi package version number
m4_define([gst_vaapi_major_version], [0])
m4_define([gst_vaapi_minor_version], [4])
m4_define([gst_vaapi_micro_version], [0])
m4_define([gst_vaapi_micro_version], [4])
m4_define([gst_vaapi_pre_version], [1])
m4_define([gst_vaapi_version],
[gst_vaapi_major_version.gst_vaapi_minor_version.gst_vaapi_micro_version])
......@@ -42,7 +42,7 @@ m4_define([gst_plugins_bad_version],
[gst_plugins_bad_major_version.gst_plugins_bad_minor_version.gst_plugins_bad_micro_version])
# Wayland minimum version number
m4_define([wayland_api_version], [0.95.0])
m4_define([wayland_api_version], [1.0.0])
# VA-API minimum version number
m4_define([va_api_version], [0.30.4])
......@@ -75,7 +75,7 @@ AC_CONFIG_AUX_DIR([build-aux])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE
AM_INIT_AUTOMAKE([1.11 tar-ustar no-dist-gzip dist-bzip2])
TODAY="`LC_ALL=C date +'%a, %d %b %Y %X %z'`"
AC_SUBST(TODAY)
......@@ -211,41 +211,62 @@ PKG_CHECK_MODULES([GST_BASEVIDEO],
[gstreamer-basevideo-$GST_MAJORMINOR >= gst_plugins_bad_version])
dnl ... bitstream parsers
USE_CODEC_PARSERS=1
USE_LOCAL_CODEC_PARSERS=0
PKG_CHECK_MODULES([GST_CODEC_PARSERS],
[gstreamer-codecparsers-$GST_MAJORMINOR >= gst_plugins_bad_version])
dnl ... 0.10.23 addition, could be implemented otherwise
AC_CACHE_CHECK([for GstH264SliceHdr::n_emulation_prevention_bytes],
ac_cv_have_gst_h264_slice_hdr_epb_count, [
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS"
dnl ... MPEG-2 parser, with the required extensions
AC_CACHE_CHECK([for MPEG-2 parser],
ac_cv_have_gst_mpeg2_parser, [
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS"
saved_LIBS="$LIBS"
LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <gst/codecparsers/gstmpegvideoparser.h>]],
[[GstMpegVideoSequenceHdr seq_hdr;
GstMpegVideoSequenceExt seq_ext;
GstMpegVideoSequenceDisplayExt seq_dpy;
gst_mpeg_video_finalise_mpeg2_sequence_header(&seq_hdr,
&seq_ext, &seq_dpy);]])],
[ac_cv_have_gst_mpeg2_parser="yes"],
[ac_cv_have_gst_mpeg2_parser="no"]
)
CPPFLAGS="$saved_CPPFLAGS"
LIBS="$saved_LIBS"
])
AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_MPEG2],
[test "$ac_cv_have_gst_mpeg2_parser" != "yes"])
dnl ... H.264 parser, with the required extensions
AC_CACHE_CHECK([for H.264 parser],
ac_cv_have_gst_h264_parser, [
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS"
saved_LIBS="$LIBS"
LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <gst/codecparsers/gsth264parser.h>]],
[[GstH264SliceHdr slice_hdr;
slice_hdr.n_emulation_prevention_bytes = 0;]])],
[ac_cv_have_gst_h264_slice_hdr_epb_count="yes"],
[ac_cv_have_gst_h264_slice_hdr_epb_count="no"]
GstH264VUIParams vui_params;
slice_hdr.n_emulation_prevention_bytes = 0;
vui_params.par_n = 0;
vui_params.par_d = 0;]])],
[ac_cv_have_gst_h264_parser="yes"],
[ac_cv_have_gst_h264_parser="no"]
)
CFLAGS="$saved_CFLAGS"
CPPFLAGS="$saved_CPPFLAGS"
LIBS="$saved_LIBS"
])
if test "$ac_cv_have_gst_h264_slice_hdr_epb_count" = "yes"; then
AC_DEFINE_UNQUOTED(HAVE_GST_H264_SLICE_HDR_EPB_COUNT, 1,
[Defined to 1 if GstH264SliceHdr::n_emulation_prevention_bytes exists.])
fi
AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_H264],
[test "$ac_cv_have_gst_h264_parser" != "yes"])
dnl ... JPEG parser, not upstream yet
AC_CACHE_CHECK([for JPEG parser],
ac_cv_have_gst_jpeg_parser, [
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS"
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS"
saved_LIBS="$LIBS"
LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS"
AC_COMPILE_IFELSE(
......@@ -253,17 +274,13 @@ AC_CACHE_CHECK([for JPEG parser],
[[#include <gst/codecparsers/gstjpegparser.h>]],
[[GstJpegImage jpeg_image;]])],
[ac_cv_have_gst_jpeg_parser="yes"],
[ac_cv_have_gst_jpeg_parser="no" USE_LOCAL_CODEC_PARSERS=1]
[ac_cv_have_gst_jpeg_parser="no"]
)
CFLAGS="$saved_CFLAGS"
CPPFLAGS="$saved_CPPFLAGS"
LIBS="$saved_LIBS"
])
if test "$ac_cv_have_gst_jpeg_parser" = "yes"; then
AC_DEFINE_UNQUOTED(HAVE_GST_JPEG_PARSER, 1,
[Defined to 1 if JPEG parser exists.])
fi
AM_CONDITIONAL(USE_LOCAL_CODEC_PARSERS, test $USE_LOCAL_CODEC_PARSERS -eq 1)
AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_JPEG],
[test "$ac_cv_have_gst_jpeg_parser" != "yes"])
dnl GST_ALL_LDFLAGS:
dnl LDFLAGS really should only contain flags, not libs - they get added before
......@@ -278,11 +295,15 @@ GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^([_]*gst_plug
AC_SUBST(GST_PLUGIN_LDFLAGS)
dnl Check for the GStreamer plugins directory
AC_ARG_VAR([GST_PLUGIN_PATH], [installation path for gstreamer-vaapi plugin elements])
AC_MSG_CHECKING([for GStreamer plugins directory])
GST_PLUGINS_DIR=`$PKG_CONFIG gstreamer-$GST_MAJORMINOR --variable pluginsdir`
if test -z "$GST_PLUGINS_DIR"; then
echo "FAIL FAIL FAIL"
GST_PLUGINS_DIR="\$(libdir)/gstreamer-$GST_MAJORMINOR"
if test -d "$GST_PLUGIN_PATH"; then
GST_PLUGINS_DIR="$GST_PLUGIN_PATH"
else
GST_PLUGINS_DIR=`$PKG_CONFIG gstreamer-$GST_MAJORMINOR --variable pluginsdir`
if test -z "$GST_PLUGINS_DIR"; then
GST_PLUGINS_DIR="\$(libdir)/gstreamer-$GST_MAJORMINOR"
fi
fi
AC_MSG_RESULT([$GST_PLUGINS_DIR])
plugindir="$GST_PLUGINS_DIR"
......@@ -530,6 +551,7 @@ debian.upstream/libgstvaapi-x11.install.in
docs/reference/libs/libs-docs.xml
docs/reference/plugins/Makefile
docs/reference/plugins/plugins-docs.xml
ext/Makefile
gst-libs/Makefile
gst-libs/gst/Makefile
gst-libs/gst/codecparsers/Makefile
......
DOCS = \
AUTHORS \
COPYING \
COPYING.LIB \
NEWS \
README \
$(NULL)
DEBIANFILES = \
changelog \
changelog.in \
compat \
control \
control.in \
copyright \
gstreamer-vaapi.install.in \
gstreamer$(GST_MAJORMINOR)-vaapi.install \
gstreamer-vaapi-doc.install.in \
gstreamer$(GST_MAJORMINOR)-vaapi-doc.install \
libgstvaapi.install.in \
libgstvaapi$(GST_VAAPI_MAJOR_VERSION).install \
gstreamer-vaapi.install.in \
libgstvaapi-dev.install.in \
libgstvaapi-dev.install \
libgstvaapi-drm.install.in \
libgstvaapi-drm-$(GST_VAAPI_MAJOR_VERSION).install \
libgstvaapi-x11.install.in \
libgstvaapi-x11-$(GST_VAAPI_MAJOR_VERSION).install \
libgstvaapi-glx.install.in \
libgstvaapi-glx-$(GST_VAAPI_MAJOR_VERSION).install \
libgstvaapi-wayland.install.in \
libgstvaapi-wayland-$(GST_VAAPI_MAJOR_VERSION).install \
libgstvaapi-x11.install.in \
libgstvaapi.install.in \
rules \
$(NULL)
DEBIANGENFILES = \
control \
changelog \
gstreamer$(GST_MAJORMINOR)-vaapi.install \
control \
gstreamer$(GST_MAJORMINOR)-vaapi-doc.install \
gstreamer$(GST_MAJORMINOR)-vaapi.install \
libgstvaapi$(GST_VAAPI_MAJOR_VERSION).install \
libgstvaapi-dev.install \
libgstvaapi-drm-$(GST_VAAPI_MAJOR_VERSION).install \
libgstvaapi-x11-$(GST_VAAPI_MAJOR_VERSION).install \
libgstvaapi-glx-$(GST_VAAPI_MAJOR_VERSION).install \
libgstvaapi-wayland-$(GST_VAAPI_MAJOR_VERSION).install \
libgstvaapi-x11-$(GST_VAAPI_MAJOR_VERSION).install \
$(NULL)
EXTRA_DIST = \
$(DEBIANFILES)
EXTRA_DIST = $(DEBIANFILES)
dist_noinst_DATA = $(DEBIANGENFILES)
# Extra clean files so that maintainer-clean removes *everything*
MAINTAINERCLEANFILES = Makefile.in $(DEBIANGENFILES)
......@@ -9,7 +9,7 @@ Copyright:
License:
Copyright (C) 2010-2011, Splitted-Desktop Systems.
Copyright (C) 2011-2012, Intel Corporation.
Copyright (C) 2011-2013, Intel Corporation.
Copyright (C) 2011, Collabora Ltd.
gstreamer-vaapi helper libraries and plugins elements are available under
......
EXTRA_DIST =
codecparsers_srcdir = \
$(top_srcdir)/ext/codecparsers/gst-libs/gst/codecparsers
codecparsers_source_c = \
gsth264parser.c \
gstjpegparser.c \
gstmpeg4parser.c \
gstmpegvideoparser.c \
gstvc1parser.c \
parserutils.c \
$(NULL)
EXTRA_DIST += $(codecparsers_source_c:%.c=$(codecparsers_srcdir)/%.c)
codecparsers_source_h = \
gsth264parser.h \
gstjpegparser.h \
gstmpeg4parser.h \
gstmpegvideoparser.h \
gstvc1parser.h \
parserutils.h \
$(NULL)
EXTRA_DIST += $(codecparsers_source_h:%.h=$(codecparsers_srcdir)/%.h)
# Extra clean files so that maintainer-clean removes *everything*
MAINTAINERCLEANFILES = Makefile.in
codecparsers @ b8efe57d
Subproject commit b8efe57d706b90c7c0e0d55d5a7ac75b888987ab
......@@ -2,6 +2,9 @@ noinst_LTLIBRARIES = \
libgstvaapi-codecparsers.la \
$(NULL)
local_codecparsers_srcdir = \
$(top_srcdir)/ext/codecparsers/gst-libs/gst/codecparsers
libgstvaapi_codecparsers_cflags = \
-DGST_USE_UNSTABLE_API \
-I$(top_srcdir)/gst-libs \
......@@ -14,17 +17,37 @@ libgstvaapi_codecparsers_libs = \
$(GST_LIBS) \
$(NULL)
libgstvaapi_codecparsers_source_c = \
gstjpegparser.c \
$(NULL)
gen_source_c = parserutils.c
gen_source_h = parserutils.h
# Always build VC-1 parser for now
gen_source_c += gstvc1parser.c
gen_source_h += gstvc1parser.h
if USE_LOCAL_CODEC_PARSERS_JPEG
gen_source_c += gstjpegparser.c
gen_source_h += gstjpegparser.h
endif
if USE_LOCAL_CODEC_PARSERS_MPEG2
gen_source_c += gstmpegvideoparser.c
gen_source_h += gstmpegvideoparser.h
endif
if USE_LOCAL_CODEC_PARSERS_H264
gen_source_c += gsth264parser.c
gen_source_h += gsth264parser.h
endif
libgstvaapi_codecparsers_source_h = \
gstjpegparser.h \
GENFILES = \
$(gen_source_c) \
$(gen_source_h) \
$(NULL)
libgstvaapi_codecparsers_la_SOURCES = \
$(libgstvaapi_codecparsers_source_c) \
$(libgstvaapi_codecparsers_source_h) \
nodist_EXTRA_libgstvaapi_codecparsers_la_SOURCES = dummy.c
nodist_libgstvaapi_codecparsers_la_SOURCES = \
$(gen_source_c) \
$(NULL)
libgstvaapi_codecparsers_la_CFLAGS = \
......@@ -39,5 +62,17 @@ libgstvaapi_codecparsers_la_LDFLAGS = \
$(GST_ALL_LDFLAGS) \
$(NULL)
all-local: .timestamp.symlinks
.timestamp.symlinks: $(GENFILES)
touch $@
$(gen_source_c): %.c: $(local_codecparsers_srcdir)/%.c %.h
$(LN_S) -f $< $@
$(gen_source_h): %.h: $(local_codecparsers_srcdir)/%.h
$(LN_S) -f $< $@
DISTCLEANFILES = $(GENFILES) .timestamp.symlinks
# Extra clean files so that maintainer-clean removes *everything*
MAINTAINERCLEANFILES = Makefile.in
This diff is collapsed.
This diff is collapsed.
......@@ -22,6 +22,7 @@ libgstvaapi_includedir = \
libgstvaapi_cflags = \
-DGST_USE_UNSTABLE_API \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
$(GST_BASE_CFLAGS) \
$(GST_BASEVIDEO_CFLAGS) \
$(GST_VIDEO_CFLAGS) \
......@@ -37,7 +38,7 @@ libgstvaapi_libs = \
$(GST_VIDEO_LIBS) \
$(GST_CODEC_PARSERS_LIBS) \
$(LIBVA_LIBS) \
$(NULL)
$(top_builddir)/gst-libs/gst/codecparsers/libgstvaapi-codecparsers.la
libgstvaapi_source_c = \
gstvaapicodec_objects.c \
......@@ -197,11 +198,6 @@ libgstvaapi_wayland_source_priv_h = \
gstvaapiutils.h \
$(NULL)
if USE_LOCAL_CODEC_PARSERS
libgstvaapi_libs += \
$(top_builddir)/gst-libs/gst/codecparsers/libgstvaapi-codecparsers.la
endif
libgstvaapi_@GST_MAJORMINOR@_la_SOURCES = \
$(libgstvaapi_source_c) \
$(libgstvaapi_source_priv_h) \
......@@ -224,6 +220,7 @@ libgstvaapi_@GST_MAJORMINOR@_la_LIBADD = \
libgstvaapi_@GST_MAJORMINOR@_la_LDFLAGS = \
$(GST_ALL_LDFLAGS) \
-export-symbols-regex "^gst_.*vaapi.*" \
$(NULL)
libgstvaapi_drm_@GST_MAJORMINOR@_la_SOURCES = \
......@@ -311,12 +308,15 @@ libgstvaapi_glx_@GST_MAJORMINOR@_la_CFLAGS = \
-I$(top_srcdir)/gst-libs \
$(GLIB_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_VIDEO_CFLAGS) \
$(GL_CFLAGS) \
$(LIBVA_GLX_CFLAGS) \
$(NULL)
libgstvaapi_glx_@GST_MAJORMINOR@_la_LIBADD = \
$(GLIB_LIBS) \
$(GST_BASE_LIBS) \
$(GST_VIDEO_LIBS) \
$(GL_LIBS) \
$(LIBVA_GLX_LIBS) \
libgstvaapi-x11-@GST_MAJORMINOR@.la \
......
......@@ -25,6 +25,13 @@
#include <glib.h>
#include <glib-object.h>
#define G_COMPAT_DEFINE(new_api, new_args, old_api, old_args) \
static inline void \
new_api new_args \
{ \
old_api old_args; \
}
#if !GLIB_CHECK_VERSION(2,27,2)
static inline void
g_list_free_full(GList *list, GDestroyNotify free_func)
......@@ -52,31 +59,39 @@ g_clear_object_inline(volatile GObject **object_ptr)
#define g_clear_object(obj) g_clear_object_inline((volatile GObject **)(obj))
#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
#if !GLIB_CHECK_VERSION(2,31,2)
typedef GStaticMutex GCompatMutex;
G_COMPAT_DEFINE(g_compat_mutex_init, (GCompatMutex *mutex),
g_static_mutex_init, (mutex))
G_COMPAT_DEFINE(g_compat_mutex_clear, (GCompatMutex *mutex),
g_static_mutex_free, (mutex))
G_COMPAT_DEFINE(g_compat_mutex_lock, (GCompatMutex *mutex),
g_static_mutex_lock, (mutex))
G_COMPAT_DEFINE(g_compat_mutex_unlock, (GCompatMutex *mutex),
g_static_mutex_unlock, (mutex))
typedef GStaticRecMutex GCompatRecMutex;
G_COMPAT_DEFINE(g_compat_rec_mutex_init, (GCompatRecMutex *mutex),
g_static_rec_mutex_init, (mutex))
G_COMPAT_DEFINE(g_compat_rec_mutex_clear, (GCompatRecMutex *mutex),
g_static_rec_mutex_free, (mutex))
G_COMPAT_DEFINE(g_compat_rec_mutex_lock, (GCompatRecMutex *mutex),
g_static_rec_mutex_lock, (mutex))
G_COMPAT_DEFINE(g_compat_rec_mutex_unlock, (GCompatRecMutex *mutex),
g_static_rec_mutex_unlock, (mutex))
typedef GCond *GCompatCond;
G_COMPAT_DEFINE(g_compat_cond_init, (GCompatCond *cond),
*cond = g_cond_new, ())
G_COMPAT_DEFINE(g_compat_cond_clear, (GCompatCond *cond),
if (*cond) g_cond_free, (*cond))
G_COMPAT_DEFINE(g_compat_cond_signal, (GCompatCond *cond),
g_cond_signal, (*cond))
G_COMPAT_DEFINE(g_compat_cond_broadcast, (GCompatCond *cond),
g_cond_broadcast, (*cond))
static inline gboolean
g_cond_wait_until(GCond *cond, GMutex *mutex, gint64 end_time)
g_cond_wait_until(GCompatCond *cond, GStaticMutex *mutex, gint64 end_time)
{
gint64 diff_time;
GTimeVal timeout;
......@@ -84,8 +99,38 @@ g_cond_wait_until(GCond *cond, GMutex *mutex, gint64 end_time)
diff_time = end_time - g_get_monotonic_time();
g_get_current_time(&timeout);
g_time_val_add(&timeout, diff_time > 0 ? diff_time : 0);
return g_cond_timed_wait(cond, mutex, &timeout);
return g_cond_timed_wait(*cond, g_static_mutex_get_mutex(mutex), &timeout);
}
#define GMutex GCompatMutex
#undef g_mutex_init
#define g_mutex_init(mutex) g_compat_mutex_init(mutex)
#undef g_mutex_clear
#define g_mutex_clear(mutex) g_compat_mutex_clear(mutex)
#undef g_mutex_lock
#define g_mutex_lock(mutex) g_compat_mutex_lock(mutex)
#undef g_mutex_unlock
#define g_mutex_unlock(mutex) g_compat_mutex_unlock(mutex)
#define GRecMutex GCompatRecMutex
#undef g_rec_mutex_init
#define g_rec_mutex_init(mutex) g_compat_rec_mutex_init(mutex)
#undef g_rec_mutex_clear
#define g_rec_mutex_clear(mutex) g_compat_rec_mutex_clear(mutex)
#undef g_rec_mutex_lock
#define g_rec_mutex_lock(mutex) g_compat_rec_mutex_lock(mutex)
#undef g_rec_mutex_unlock
#define g_rec_mutex_unlock(mutex) g_compat_rec_mutex_unlock(mutex)
#define GCond GCompatCond
#undef g_cond_init
#define g_cond_init(cond) g_compat_cond_init(cond)
#undef g_cond_clear
#define g_cond_clear(cond) g_compat_cond_clear(cond)
#undef g_cond_signal
#define g_cond_signal(cond) g_compat_cond_signal(cond)
#endif
#undef G_COMPAT_DEFINE
#endif /* GLIB_COMPAT_H */
......@@ -2,6 +2,7 @@
* gstvapicompat.h - VA-API compatibility glue
*
* Copyright (C) 2010-2011 Splitted-Desktop Systems
* 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
......
......@@ -2,7 +2,7 @@
* gstvaapicontext.h - VA context abstraction
*
* 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
* modify it under the terms of the GNU Lesser General Public License
......
......@@ -73,17 +73,6 @@ push_buffer(GstVaapiDecoder *decoder, GstBuffer *buffer)
return TRUE;
}
static void
push_back_buffer(GstVaapiDecoder *decoder, GstBuffer *buffer)
{
GstVaapiDecoderPrivate * const priv = decoder->priv;
GST_DEBUG("requeue encoded data buffer %p (%d bytes)",
buffer, GST_BUFFER_SIZE(buffer));
g_queue_push_head(priv->buffers, buffer);
}
static GstBuffer *
pop_buffer(GstVaapiDecoder *decoder)
{
......@@ -400,7 +389,10 @@ gst_vaapi_decoder_get_caps(GstVaapiDecoder *decoder)
* Queues a #GstBuffer to the HW decoder. The decoder holds a
* reference to @buf.
*
* Caller can notify an End-Of-Stream with @buf set to %NULL.
* Caller can notify an End-Of-Stream with @buf set to %NULL. However,
* if an empty buffer is passed, i.e. a buffer with %NULL data pointer
* or size equals to zero, then the function ignores this buffer and
* returns %TRUE.
*
* Return value: %TRUE on success
*/
......@@ -409,7 +401,12 @@ gst_vaapi_decoder_put_buffer(GstVaapiDecoder *decoder, GstBuffer *buf)
{
g_return_val_if_fail(GST_VAAPI_IS_DECODER(decoder), FALSE);
return push_buffer(decoder, buf ? gst_buffer_ref(buf) : NULL);
if (buf) {
if (!GST_BUFFER_DATA(buf) || GST_BUFFER_SIZE(buf) <= 0)
return TRUE;
buf = gst_buffer_ref(buf);
}
return push_buffer(decoder, buf);
}
/**
......@@ -572,24 +569,6 @@ gst_vaapi_decoder_ensure_context(
return TRUE;
}
gboolean
gst_vaapi_decoder_push_buffer_sub(
GstVaapiDecoder *decoder,
GstBuffer *buffer,
guint offset,
guint size
)
{
GstBuffer *subbuffer;
subbuffer = gst_buffer_create_sub(buffer, offset, size);
if (!subbuffer)
return FALSE;
push_back_buffer(decoder, subbuffer);
return TRUE;
}
void
gst_vaapi_decoder_push_surface_proxy(
GstVaapiDecoder *decoder,
......
......@@ -2,7 +2,7 @@
* gstvaapidecoder.h - VA decoder abstraction
*
* 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
* modify it under the terms of the GNU Lesser General Public License
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
/*
* gstvaapidecoder_mpeg4.c - MPEG-4 decoder
*
* Copyright (C) 2011 Intel Corporation
* 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
......@@ -798,7 +798,11 @@ decode_slice(
}
static GstVaapiDecoderStatus
decode_packet(GstVaapiDecoderMpeg4 *decoder, GstMpeg4Packet packet)
decode_packet(
GstVaapiDecoderMpeg4 *decoder,
GstMpeg4Packet packet,
gboolean is_eos
)
{
GstVaapiDecoderMpeg4Private * const priv = decoder->priv;
GstMpeg4Packet *tos = &packet;
......@@ -856,7 +860,8 @@ decode_packet(GstVaapiDecoderMpeg4 *decoder, GstMpeg4Packet packet)
}
else {
// next start_code is required to determine the end of last slice
_data_size += 4;
if (!is_eos)
_data_size += 4;
GstMpeg4ParseResult ret = GST_MPEG4_PARSER_OK;
gboolean first_slice = TRUE;
......@@ -864,7 +869,10 @@ decode_packet(GstVaapiDecoderMpeg4 *decoder, GstMpeg4Packet packet)
// we can skip user data here
ret = gst_mpeg4_parse(&video_packet, TRUE, &priv->vop_hdr, _data, 0, _data_size);
if(ret != GST_MPEG4_PARSER_OK) {
break;
if (!is_eos || ret != GST_MPEG4_PARSER_NO_PACKET_END)
break;
video_packet.size = _data_size - video_packet.offset;
ret = GST_MPEG4_PARSER_OK;
}
if (first_slice) {
......@@ -910,19 +918,19 @@ static GstVaapiDecoderStatus
decode_buffer(GstVaapiDecoderMpeg4 *decoder, GstBuffer *buffer)
{
GstVaapiDecoderMpeg4Private * const priv = decoder->priv;
GstVaapiDecoderStatus status = GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN;
GstVaapiDecoderStatus status = GST_VAAPI_DECODER_STATUS_SUCCESS;
gboolean is_eos, end_of_packet;
guchar *buf;
guint pos, buf_size;
buf = GST_BUFFER_DATA(buffer);
buf_size = GST_BUFFER_SIZE(buffer);
is_eos = GST_BUFFER_IS_EOS(buffer);
// visual object sequence end
if (!buf && buf_size == 0)
return decode_sequence_end(decoder);
gst_buffer_ref(buffer);
gst_adapter_push(priv->adapter, buffer);
if (buf && buf_size > 0) {
gst_buffer_ref(buffer);
gst_adapter_push(priv->adapter, buffer);
}
if (priv->sub_buffer) {
buffer = gst_buffer_merge(priv->sub_buffer, buffer);
......@@ -944,7 +952,10 @@ decode_buffer(GstVaapiDecoderMpeg4 *decoder, GstBuffer *buffer)
while (result == GST_MPEG4_PARSER_OK && pos < buf_size) {
result = gst_h263_parse (&packet,buf, pos, buf_size);
if (result != GST_MPEG4_PARSER_OK) {
break;
if (!is_eos || result != GST_MPEG4_PARSER_NO_PACKET_END)
break;
packet.size = pos + buf_size - packet.offset;
result = GST_MPEG4_PARSER_OK;
}
status = decode_picture(decoder, packet.data+packet.offset, packet.size);
if (GST_VAAPI_DECODER_STATUS_SUCCESS == status) {
......@@ -956,8 +967,8 @@ decode_buffer(GstVaapiDecoderMpeg4 *decoder, GstBuffer *buffer)
consumed_size = packet.offset + packet.size;
pos += consumed_size;
if (gst_adapter_available(priv->adapter) >= pos)
gst_adapter_flush(priv->adapter, pos);
if (gst_adapter_available(priv->adapter) >= consumed_size)
gst_adapter_flush(priv->adapter, consumed_size);
}
else {
GST_WARNING("decode h263 packet failed\n");
......@@ -967,18 +978,23 @@ decode_buffer(GstVaapiDecoderMpeg4 *decoder, GstBuffer *buffer)
}
else {
while (pos < buf_size) {
end_of_packet = FALSE;
// don't skip user data, we need the size to pop tsb buffer
result = gst_mpeg4_parse(&packet, FALSE, NULL, buf, pos, buf_size);
if (result != GST_MPEG4_PARSER_OK) {
break;
if (!is_eos || result != GST_MPEG4_PARSER_NO_PACKET_END)
break;
packet.size = pos + buf_size - packet.offset;
result = GST_MPEG4_PARSER_OK;
end_of_packet = TRUE;
}
status = decode_packet(decoder, packet);
status = decode_packet(decoder, packet, end_of_packet);
if (GST_VAAPI_DECODER_STATUS_SUCCESS == status ||
GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA == status) {
consumed_size = packet.offset + packet.size - pos;
pos = packet.offset + packet.size;
if (gst_adapter_available(priv->adapter) >= pos)
gst_adapter_flush(priv->adapter, pos);
if (gst_adapter_available(priv->adapter) >= consumed_size)
gst_adapter_flush(priv->adapter, consumed_size);
}
else {
GST_WARNING("decode mp4 packet failed\n");
......@@ -994,6 +1010,10 @@ decode_buffer(GstVaapiDecoderMpeg4 *decoder, GstBuffer *buffer)
priv->sub_buffer = gst_buffer_create_sub(buffer, pos, buf_size-pos);
status = GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA;
}
if (is_eos && (status == GST_VAAPI_DECODER_STATUS_SUCCESS ||
status == GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA))
status = decode_sequence_end(decoder);
return status;
}
......@@ -1024,7 +1044,7 @@ decode_codec_data(GstVaapiDecoderMpeg4 *decoder, GstBuffer *buffer)
if (result != GST_MPEG4_PARSER_OK) {
break;
}
status = decode_packet(decoder, packet);
status = decode_packet(decoder, packet, FALSE);
if (GST_VAAPI_DECODER_STATUS_SUCCESS == status) {
pos = packet.offset + packet.size;
}
......
......@@ -215,13 +215,15 @@ gst_vaapi_picture_new(
GstVaapiPicture *
gst_vaapi_picture_new_field(GstVaapiPicture *picture)
{
GType type;
GstMiniObject *obj;
GstVaapiCodecObject *va_obj;
GstVaapiCodecObjectConstructorArgs args;
g_return_val_if_fail(GST_VAAPI_IS_PICTURE(picture), NULL);
obj = gst_mini_object_new(GST_VAAPI_TYPE_PICTURE);
type = G_TYPE_FROM_CLASS(GST_VAAPI_PICTURE_GET_CLASS(picture));
obj = gst_mini_object_new(type);
if (!obj)
return NULL;
......
......@@ -163,15 +163,6 @@ gst_vaapi_decoder_ensure_context(
GstVaapiContextInfo *cip
);
G_GNUC_INTERNAL
gboolean
gst_vaapi_decoder_push_buffer_sub(
GstVaapiDecoder *decoder,
GstBuffer *buffer,
guint offset,
guint size
);
G_GNUC_INTERNAL
void
gst_vaapi_decoder_push_surface_proxy(
......
This diff is collapsed.
......@@ -725,7 +725,7 @@ gst_vaapi_display_lock_default(GstVaapiDisplay *display)
if (priv->parent)
priv = priv->parent->priv;
g_static_rec_mutex_lock(&priv->mutex);
g_rec_mutex_lock(&priv->mutex);
}
static void
......@@ -735,7 +735,7 @@ gst_vaapi_display_unlock_default(GstVaapiDisplay *display)
if (priv->parent)
priv = priv->parent->priv;
g_static_rec_mutex_unlock(&priv->mutex);
g_rec_mutex_unlock(&priv->mutex);
}
static void
......@@ -745,7 +745,7 @@ gst_vaapi_display_finalize(GObject *object)
gst_vaapi_display_destroy(display);
g_static_rec_mutex_free(&display->priv->mutex);
g_rec_mutex_clear(&display->priv->mutex);
G_OBJECT_CLASS(gst_vaapi_display_parent_class)->finalize(object);
}
......@@ -998,7 +998,7 @@ gst_vaapi_display_init(GstVaapiDisplay *display)
priv->properties = NULL;
priv->create_display = TRUE;
g_static_rec_mutex_init(&priv->mutex);
g_rec_mutex_init(&priv->mutex);
}
/**
......
......@@ -73,7 +73,7 @@ G_BEGIN_DECLS
*/
struct _GstVaapiDisplayPrivate {
GstVaapiDisplay *parent;
GStaticRecMutex mutex;
GRecMutex mutex;
GstVaapiDisplayType display_type;
VADisplay display;
guint width;
......
/*
* gstvaapidisplay_wayland.c - VA/Wayland display abstraction
*
* Copyright (C) 2012 Intel Corporation
* Copyright (C) 2012-2013 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
......@@ -253,34 +253,31 @@ static const struct wl_output_listener output_listener = {
};
static void
display_handle_global(
struct wl_display *display,
uint32_t id,
const char *interface,
uint32_t version,
void *data
registry_handle_global(
void *data,
struct wl_registry *registry,
uint32_t id,
const char *interface,
uint32_t version
)
{
GstVaapiDisplayWaylandPrivate * const priv = data;
if (strcmp(interface, "wl_compositor") == 0)
priv->compositor = wl_display_bind(display, id, &wl_compositor_interface);
priv->compositor =
wl_registry_bind(registry, id, &wl_compositor_interface, 1);
else if (strcmp(interface, "wl_shell") == 0)
priv->shell = wl_display_bind(display, id, &wl_shell_interface);
priv->shell = wl_registry_bind(registry, id, &wl_shell_interface, 1);
else if (strcmp(interface, "wl_output") == 0) {
priv->output = wl_display_bind(display, id, &wl_output_interface);
priv->output = wl_registry_bind(registry, id, &wl_output_interface, 1);
wl_output_add_listener(priv->output, &output_listener, priv);
}
}
static int
event_mask_update(uint32_t mask, void *data)
{
GstVaapiDisplayWaylandPrivate * const priv = data;
priv->event_mask = mask;
return 0;
}
static const struct wl_registry_listener registry_listener = {
registry_handle_global,
NULL,
};
static gboolean
gst_vaapi_display_wayland_open_display(GstVaapiDisplay * display)
......@@ -288,19 +285,26 @@ gst_vaapi_display_wayland_open_display(GstVaapiDisplay * display)
GstVaapiDisplayWaylandPrivate * const priv =
GST_VAAPI_DISPLAY_WAYLAND(display)->priv;
if (!priv->create_display)
return priv->wl_display != NULL;
priv->wl_display = wl_display_connect(get_display_name(display));
if (!priv->wl_display)
return FALSE;
if (priv->create_display) {
priv->wl_display = wl_display_connect(get_display_name(display));
if (!priv->wl_display)
return FALSE;
}
wl_display_set_user_data(priv->wl_display, priv);
wl_display_add_global_listener(priv->wl_display, display_handle_global, priv);
priv->event_fd = wl_display_get_fd(priv->wl_display, event_mask_update, priv);
wl_display_iterate(priv->wl_display, priv->event_mask);
priv->registry = wl_display_get_registry(priv->wl_display);
wl_registry_add_listener(priv->registry, &registry_listener, priv);
priv->event_fd = wl_display_get_fd(priv->wl_display);
wl_display_roundtrip(priv->wl_display);
if (!priv->width || !priv->height) {
wl_display_roundtrip(priv->wl_display);
if (!priv->width || !priv->height) {
GST_ERROR("failed to determine the display size");
return FALSE;
}
}
if (!priv->compositor) {
GST_ERROR("failed to bind compositor interface");
return FALSE;
......@@ -477,7 +481,6 @@ gst_vaapi_display_wayland_init(GstVaapiDisplayWayland *display)
priv->phys_width = 0;
priv->phys_height = 0;
priv->event_fd = -1;
priv->event_mask = 0;
}
/**
......
......@@ -28,7 +28,7 @@ G_BEGIN_DECLS
#define GST_VAAPI_DISPLAY_WAYLAND_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE((obj), \
GST_VAAPI_TYPE_DISPLAY_WAYLAND, \
GST_VAAPI_TYPE_DISPLAY_WAYLAND, \
GstVaapiDisplayWaylandPrivate))
#define GST_VAAPI_DISPLAY_WAYLAND_CAST(display) \
......@@ -51,12 +51,12 @@ struct _GstVaapiDisplayWaylandPrivate {
struct wl_compositor *compositor;
struct wl_shell *shell;
struct wl_output *output;
struct wl_registry *registry;
guint width;
guint height;
guint phys_width;
guint phys_height;
gint event_fd;
guint32 event_mask;
guint create_display : 1;
};
......
......@@ -2,6 +2,7 @@
* gstvaapidisplay_x11.h - VA/X11 display abstraction
*
* Copyright (C) 2010-2011 Splitted-Desktop Systems
* 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
......
......@@ -2,6 +2,7 @@
* gstvaapidisplay_x11_priv.h - Internal VA/X11 interface
*
* Copyright (C) 2010-2011 Splitted-Desktop Systems
* 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
......
......@@ -33,7 +33,7 @@ struct _CacheEntry {
};
struct _GstVaapiDisplayCache {
GStaticMutex mutex;
GMutex mutex;
GList *list;
};
......@@ -86,14 +86,14 @@ error:
#define CACHE_LOOKUP(cache, res, prop, comp_func, comp_data, user_data) do { \
GList *l; \
\
g_static_mutex_lock(&(cache)->mutex); \
g_mutex_lock(&(cache)->mutex); \
for (l = (cache)->list; l != NULL; l = l->next) { \
GstVaapiDisplayInfo * const info = \
&((CacheEntry *)l->data)->info; \
if (comp_func(info->prop, comp_data, user_data)) \
break; \
} \
g_static_mutex_unlock(&(cache)->mutex); \
g_mutex_unlock(&(cache)->mutex); \
res = l; \
} while (0)
......@@ -146,7 +146,7 @@ gst_vaapi_display_cache_new(void)
if (!cache)
return NULL;
g_static_mutex_init(&cache->mutex);
g_mutex_init(&cache->mutex);
return cache;
}
......@@ -170,7 +170,7 @@ gst_vaapi_display_cache_free(GstVaapiDisplayCache *cache)
g_list_free(cache->list);
cache->list = NULL;
}
g_static_mutex_free(&cache->mutex);
g_mutex_clear(&cache->mutex);
g_slice_free(GstVaapiDisplayCache, cache);
}
......@@ -189,9 +189,9 @@ gst_vaapi_display_cache_get_size(GstVaapiDisplayCache *cache)
g_return_val_if_fail(cache != NULL, 0);
g_static_mutex_lock(&cache->mutex);
g_mutex_lock(&cache->mutex);
size = g_list_length(cache->list);
g_static_mutex_unlock(&cache->mutex);
g_mutex_unlock(&cache->mutex);
return size;
}
......@@ -220,9 +220,9 @@ gst_vaapi_display_cache_add(
if (!entry)
return FALSE;
g_static_mutex_lock(&cache->mutex);
g_mutex_lock(&cache->mutex);
cache->list = g_list_prepend(cache->list, entry);
g_static_mutex_unlock(&cache->mutex);
g_mutex_unlock(&cache->mutex);
return TRUE;
}
......@@ -246,9 +246,9 @@ gst_vaapi_display_cache_remove(
return;
cache_entry_free(m->data);
g_static_mutex_lock(&cache->mutex);
g_mutex_lock(&cache->mutex);
cache->list = g_list_delete_link(cache->list, m);
g_static_mutex_unlock(&cache->mutex);
g_mutex_unlock(&cache->mutex);
}
/**
......
......@@ -753,12 +753,11 @@ _gst_vaapi_image_map(GstVaapiImage *image, GstVaapiImageRaw *raw_image)
{
GstVaapiImagePrivate * const priv = image->priv;
GstVaapiDisplay *display;
void *image_data;
VAStatus status;
guint i;
if (_gst_vaapi_image_is_mapped(image))
return TRUE;
goto map_success;
display = GST_VAAPI_OBJECT_DISPLAY(image);
if (!display)
......@@ -767,15 +766,14 @@ _gst_vaapi_image_map(GstVaapiImage *image, GstVaapiImageRaw *raw_image)
GST_VAAPI_DISPLAY_LOCK(display);
status = vaMapBuffer(
GST_VAAPI_DISPLAY_VADISPLAY(display),
image->priv->image.buf,
&image_data
priv->image.buf,
(void **)&priv->image_data
);
GST_VAAPI_DISPLAY_UNLOCK(display);
if (!vaapi_check_status(status, "vaMapBuffer()"))
return FALSE;