...
 
Commits (44)
This diff is collapsed.
# GStreamer 1.10 Release Notes
**GStreamer 1.10.0 was released on 1st November 2016.**
GStreamer 1.10.0 was originally released on 1st November 2016.
The latest bug-fix release in the 1.10 series is [1.10.5](#1.10.5) and was
released on 15 June 2017.
The GStreamer team is proud to announce a new major feature release in the
stable 1.x API series of your favourite cross-platform multimedia framework!
......@@ -11,7 +13,7 @@ improvements.
See [https://gstreamer.freedesktop.org/releases/1.10/][latest] for the latest
version of this document.
*Last updated: Tuesday 1 Nov 2016, 15:00 UTC [(log)][gitlog]*
*Last updated: Thursday 15 Jun 2017, 09:30 UTC [(log)][gitlog]*
[latest]: https://gstreamer.freedesktop.org/releases/1.10/
[gitlog]: https://cgit.freedesktop.org/gstreamer/www/log/src/htdocs/releases/1.10/release-notes-1.10.md
......@@ -39,7 +41,7 @@ improvements.
- A new `gst-docs` module has been created, and we are in the process of moving
our documentation to a markdown-based format for easier maintenance and
updates
- A new `gst-examples` module has been create, which contains example
- A new `gst-examples` module has been created, which contains example
GStreamer applications and is expected to grow with many more examples in
the future
- Various OpenGL and OpenGL|ES-related fixes and improvements for greater
......@@ -1073,6 +1075,138 @@ which is a stable branch.
1.10.0 was released on 1st November 2016.
<a name="1.10.1"></a>
### 1.10.1
The first 1.10 bug-fix release (1.10.1) was released on 17 November 2016.
This release only contains bugfixes and it should be safe to update from 1.10.x.
#### Major bugfixes in 1.10.1
- Security-relevant bugfix in the vmnc decoder (CVE-2016-9445, CVE-2016-9446)
- Various bugfixes to playbin3/decodebin3
- Fix error at the end of playing any WAV file
- Fix usability of androidmedia plugin if the camera or sensor API is not
available, but codecs are
- Handle redirections on PLAY, and missing control attribute in the RTSP source
- Various OpenGL related bugfixes
- ... and many, many more!
For a full list of bugfixes see [Bugzilla][buglist-1.10.1]. Note that this is
not the full list of changes. For the full list of changes please refer to the
GIT logs or ChangeLogs of the particular modules.
[buglist-1.10.1]: https://bugzilla.gnome.org/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&classification=Platform&limit=0&list_id=168172&order=bug_id&product=GStreamer&query_format=advanced&resolution=FIXED&target_milestone=1.10.1
<a name="1.10.2"></a>
### 1.10.2
The second 1.10 bug-fix release (1.10.2) was released on 29 November 2016.
This release only contains bugfixes and it should be safe to update from 1.10.x.
#### Major bugfixes in 1.10.2
- Security-relevant bugfix in the FLI/FLX/FLC decoder (CVE-2016-9634,
CVE-2016-9635, CVE-2016-9636)
- Various fixes for crashes, assertions and other failures on fuzzed input
files. Among others, thanks to Hanno Böck for testing and reporting
(CVE-2016-9807, CVE-2016-9808, CVE-2016-9809, CVE-2016-9810, CVE-2016-9811,
CVE-2016-9812, CVE-2016-9813).
- SAVP/SAVPF profile in gst-rtsp-server works for live streams again, and the
correct MIKEY policy message is generated
- Further OpenGL related bugfixes
- gst-libav was updated to ffmpeg 3.2.1
- ... and many, many more!
For a full list of bugfixes see [Bugzilla][buglist-1.10.2]. Note that this is
not the full list of changes. For the full list of changes please refer to the
GIT logs or ChangeLogs of the particular modules.
[buglist-1.10.2]: https://bugzilla.gnome.org/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&classification=Platform&limit=0&list_id=168172&order=bug_id&product=GStreamer&query_format=advanced&resolution=FIXED&target_milestone=1.10.2
<a name="1.10.3"></a>
### 1.10.3
The third 1.10 bug-fix release (1.10.3) was released on 30 January 2017.
This release only contains bugfixes and it should be safe to update from 1.10.x.
#### Major bugfixes in 1.10.3
- Various fixes for crashes, assertions, deadlocks and memory leaks on fuzzed
input files and in other situations (CVE-2016-10198, CVE-2016-10199,
CVE-2017-5837, CVE-2017-5838, CVE-2017-5839, CVE-2017-5840, CVE-2017-5841,
CVE-2017-5842, CVE-2017-5843, CVE-2017-5844, CVE-2017-5845, CVE-2017-5846)
- Regression fixes for souphttpsrc with redirection tracking and retrying
- Regression fix for gst-rtsp-server not handling TCP-only medias anymore
- Various other bugfixes the RTP/RTSP codebase
- Fix for gmodule on 64 bit Android, it was never working before there
- vp8enc works again on 32 bit Windows
- Fixes to Opus PLC handling in the decoder
- Fix for stream corruption in multihandlesink when removing clients
- gst-libav was updated to ffmpeg 3.2.2
- ... and many, many more!
For a full list of bugfixes see [Bugzilla][buglist-1.10.3]. Note that this is
not the full list of changes. For the full list of changes please refer to the
GIT logs or ChangeLogs of the particular modules.
[buglist-1.10.3]: https://bugzilla.gnome.org/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&classification=Platform&limit=0&list_id=187054&order=bug_id&product=GStreamer&query_format=advanced&resolution=FIXED&target_milestone=1.10.3
<a name="1.10.4"></a>
### 1.10.4
The fourth 1.10 bug-fix release (1.10.4) was released on 23 February 2017.
This release only contains bugfixes and it should be safe to update from 1.10.x.
#### Major bugfixes in 1.10.4
- Various fixes for crashes, assertions, deadlocks and memory leaks on fuzzed
input files and in other situations (CVE-2017-5847, CVE-2017-5848)
- More regression fixes for souphttpsrc redirection tracking
- Regression fix for gmodule on 32 bit Android, which was introduced as part
of the 64 bit Android fix in 1.10.3 and broke the androidmedia plugin
- Various bugfixes for regressions and other problems in the V4L2 plugin
- Fix for 5.1, 6.1 and 7.1 channel layouts for Vorbis
- Fixes for timestamp generation of Android video encoder element
- gst-libav was updated to ffmpeg 3.2.4, fixing a couple of CVEs
- ... and many, many more!
For a full list of bugfixes see [Bugzilla][buglist-1.10.4]. Note that this is
not the full list of changes. For the full list of changes please refer to the
GIT logs or ChangeLogs of the particular modules.
[buglist-1.10.4]: https://bugzilla.gnome.org/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&classification=Platform&limit=0&list_id=187054&order=bug_id&product=GStreamer&query_format=advanced&resolution=FIXED&target_milestone=1.10.4
<a name="1.10.5"></a>
### 1.10.5
The fifth 1.10 bug-fix release (1.10.5) was released on 15 June 2017.
This release only contains bugfixes and it should be safe to update from 1.10.x.
This is most likely the last release in the stable 1.10 release series.
#### Major bugfixes in 1.10.5
- Various fixes for crashes, assertions, deadlocks and memory leaks
- Fix for regression in rtpjitterbuffer that caused PTS to be reset to 0 on
- Fix detection of some HLS streams
- Various fixes to the MOV/MP4 muxer and demuxer
gaps in the input
- gst-libav was updated to ffmpeg 3.2.5, fixing a couple of CVEs
- ... and many, many more!
For a full list of bugfixes see [Bugzilla][buglist-1.10.5]. Note that this is
not the full list of changes and also does not include bug reports that were
closed after the 1.12.0 release. For the full list of changes please refer to
the GIT logs or ChangeLogs of the particular modules.
[buglist-1.10.5]: https://bugzilla.gnome.org/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&classification=Platform&limit=0&list_id=187054&order=bug_id&product=GStreamer&query_format=advanced&resolution=FIXED&target_milestone=1.10.5
## Known Issues
- iOS builds with iOS 6 SDK and old C++ STL. You need to select iOS 6 instead
......@@ -1083,11 +1217,6 @@ which is a stable branch.
- Building applications with Android NDK r13 on Windows does not work. Other
platforms and earlier/later versions of the NDK are not affected.
[Bug #772842](https://bugzilla.gnome.org/show_bug.cgi?id=772842)
- The new leaks tracer may deadlock the application (or exhibit other undefined
behaviour) when `SIGUSR` handling is enabled via the `GST_LEAKS_TRACER_SIG`
environment variable. [Bug #770373](https://bugzilla.gnome.org/show_bug.cgi?id=770373)
- vp8enc crashes on 32 bit Windows, but was working fine in 1.6. 64 bit Windows is unaffected.
[Bug #763663](https://bugzilla.gnome.org/show_bug.cgi?id=763663)
## Schedule for 1.12
......@@ -1096,9 +1225,9 @@ development version leading up to the stable 1.12 release. The development
of 1.11/1.12 will happen in the git master branch.
The plan for the 1.12 development cycle is yet to be confirmed, but it is
expected that feature freeze will be around early/mid-January,
expected that feature freeze will be around early/mid-February,
followed by several 1.11 pre-releases and the new 1.12 stable release
in March.
in April.
1.12 will be backwards-compatible to the stable 1.10, 1.8, 1.6, 1.4, 1.2 and
1.0 release series.
......@@ -1111,4 +1240,3 @@ Müller, Reynaldo H. Verdejo Pinochet, Arun Raghavan, Thibault Saunier,
Jan Schmidt, Wim Taymans, Matthew Waters*
*License: [CC BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)*
......@@ -125,7 +125,7 @@ Sources
framework are really easy to get.
Stable source code releases can be found at:
<http://www.freedesktop.org/software/vaapi/releases/gstreamer-vaapi/>
<https://gstreamer.freedesktop.org/src/gstreamer-vaapi/>
Git repository for work-in-progress changes is available at:
<https://cgit.freedesktop.org/gstreamer/gstreamer-vaapi>
......@@ -135,7 +135,4 @@ Reporting Bugs
--------------
Bugs can be reported in the GNOME Bugzilla system at:
<https://bugzilla.gnome.org/enter_bug.cgi?product=gstreamer-vaapi>
From the main page, new bugs can be reported through New -> Other ->
gstreamer-vaapi product.
<https://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer&component=gstreamer-vaapi>
common @ 742c09d9
Subproject commit f49c55ecd35a7436194d28297f6d6f20eb6a66fa
Subproject commit 742c09d9f13748a32ddf90669204415b88dd976f
# gstreamer-vaapi package version number
m4_define([gst_vaapi_major_version], [1])
m4_define([gst_vaapi_minor_version], [10])
m4_define([gst_vaapi_micro_version], [0])
m4_define([gst_vaapi_micro_version], [5])
m4_define([gst_vaapi_nano_version], [0])
m4_define([gst_vaapi_version],
[gst_vaapi_major_version.gst_vaapi_minor_version.gst_vaapi_micro_version])
......@@ -16,9 +16,9 @@ dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
dnl - interfaces added -> increment AGE
dnl - interfaces removed -> AGE = 0
# gstreamer-vaapi library (libtool) version number
m4_define([gst_vaapi_lt_current], [1000])
m4_define([gst_vaapi_lt_current], [1005])
m4_define([gst_vaapi_lt_revision], [0])
m4_define([gst_vaapi_lt_age], [1000])
m4_define([gst_vaapi_lt_age], [1005])
# glib version number
m4_define([glib_version], [2.40])
......@@ -171,10 +171,6 @@ AC_PROG_CC_STDC
dnl check if the compiler supports '-c' and '-o' options
AM_PROG_CC_C_O
dnl check for git command for version generation in libgstvaapi
AC_PATH_PROG([GIT], [git])
AM_CONDITIONAL([HAVE_GIT], [test -n "$GIT"])
dnl check for documentation tools
GTK_DOC_CHECK([$GTKDOC_REQ])
AG_GST_PLUGIN_DOCS([$GTKDOC_REQ])
......@@ -330,7 +326,10 @@ HAVE_XRENDER=0
if test $USE_X11 -eq 1; then
dnl Check for XKB library
HAVE_XKBLIB=1
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
AC_CHECK_HEADERS([X11/XKBlib.h], [], [HAVE_XKBLIB=0])
CPPFLAGS="$saved_CPPFLAGS"
dnl Check for XRandR
PKG_CHECK_MODULES([XRANDR], [xrandr],
......@@ -458,6 +457,8 @@ if test "x$enable_egl" = "xyes" -a $GLES_VERSION_MASK -ne 0; then
saved_CPPFLAGS="$CPPFLAGS"
saved_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $EGL_CFLAGS"
LIBS="$LIBS $EGL_LIBS"
AC_CHECK_HEADERS([EGL/egl.h], [], [USE_EGL=0])
AC_CHECK_LIB([EGL], [eglGetDisplay], [], [USE_EGL=0])
CPPFLAGS="$saved_CPPFLAGS"
......@@ -494,7 +495,7 @@ if test $USE_DRM -eq 1; then
PKG_CHECK_MODULES([LIBVA_DRM], [libva-drm >= $VAAPI_DRM_REQ],
[
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$LIBVA_DRM_CFLAGS"
CPPFLAGS="$CPPFLAGS $LIBVA_DRM_CFLAGS"
AC_CHECK_HEADERS([va/va_drm.h], [], [USE_DRM=0])
CPPFLAGS="$saved_CPPFLAGS"
], [USE_DRM=0])
......@@ -712,7 +713,7 @@ if test "x$enable_encoders" = "xyes"; then
[
USE_ENCODERS=1
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$LIBVA_CFLAGS"
CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
AC_CHECK_HEADERS([va/va_enc_mpeg2.h va/va_enc_h264.h], [],
[USE_ENCODERS=0],
[
......@@ -728,6 +729,9 @@ USE_H265_ENCODER=0
USE_VP9_ENCODER=0
if test $USE_ENCODERS -eq 1; then
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
dnl Check for JPEG Encoding API (0.37.0+)
AC_CHECK_HEADERS([va/va_enc_jpeg.h], [], [],
[
......@@ -736,8 +740,6 @@ if test $USE_ENCODERS -eq 1; then
AC_CACHE_CHECK([for JPEG encoding API],
[ac_cv_have_jpeg_encoding_api],
[
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
saved_LIBS="$LIBS"
LIBS="$LIBS $LIBVA_LIBS"
AC_COMPILE_IFELSE(
......@@ -757,7 +759,6 @@ VAQMatrixBufferJPEG q_matrix;
],
[ac_cv_have_jpeg_encoding_api="yes"],
[ac_cv_have_jpeg_encoding_api="no"])
CPPFLAGS="$saved_CPPFLAGS"
LIBS="$saved_LIBS"
])
AS_IF([test "x$ac_cv_have_jpeg_encoding_api" = "xyes"], [USE_JPEG_ENCODER=1])
......@@ -770,8 +771,6 @@ VAQMatrixBufferJPEG q_matrix;
AC_CACHE_CHECK([for VP8 encoding API],
[ac_cv_have_vp8_encoding_api],
[
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
saved_LIBS="$LIBS"
LIBS="$LIBS $LIBVA_LIBS"
AC_COMPILE_IFELSE(
......@@ -791,7 +790,6 @@ VAQMatrixBufferVP8 q_matrix;
],
[ac_cv_have_vp8_encoding_api="yes"],
[ac_cv_have_vp8_encoding_api="no"])
CPPFLAGS="$saved_CPPFLAGS"
LIBS="$saved_LIBS"
])
AS_IF([test "x$ac_cv_have_vp8_encoding_api" = "xyes"], [USE_VP8_ENCODER=1])
......@@ -804,8 +802,6 @@ VAQMatrixBufferVP8 q_matrix;
AC_CACHE_CHECK([for HEVC encoding API],
[ac_cv_have_hevc_encoding_api],
[
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
saved_LIBS="$LIBS"
LIBS="$LIBS $LIBVA_LIBS"
AC_COMPILE_IFELSE(
......@@ -826,7 +822,6 @@ VAQMatrixBufferHEVC q_matrix;
],
[ac_cv_have_hevc_encoding_api="yes"],
[ac_cv_have_hevc_encoding_api="no"])
CPPFLAGS="$saved_CPPFLAGS"
LIBS="$saved_LIBS"
])
AS_IF([test "x$ac_cv_have_hevc_encoding_api" = "xyes"], [USE_H265_ENCODER=1])
......@@ -839,8 +834,6 @@ VAQMatrixBufferHEVC q_matrix;
AC_CACHE_CHECK([for VP9 encoding API],
[ac_cv_have_vp9_encoding_api],
[
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $LIBVA_CFLAGS"
saved_LIBS="$LIBS"
LIBS="$LIBS $LIBVA_LIBS"
AC_COMPILE_IFELSE(
......@@ -861,10 +854,11 @@ VAEncMiscParameterTypeVP9PerSegmantParam misc_param;
],
[ac_cv_have_vp9_encoding_api="yes"],
[ac_cv_have_vp9_encoding_api="no"])
CPPFLAGS="$saved_CPPFLAGS"
LIBS="$saved_LIBS"
])
AS_IF([test "x$ac_cv_have_vp9_encoding_api" = "xyes"], [USE_VP9_ENCODER=1])
CPPFLAGS="$saved_CPPFLAGS"
fi
dnl VA/Wayland API
......
gstvaapi_baseutils_sources = [
'gstbitwriter.c',
]
gstvaapi_baseutils_headers = [
'gstbitwriter.h',
]
gstvaapi_baseutils_deps = [gstbase_dep]
gstvaapi_baseutils = static_library('gstvaapi-baseutils-@0@'.format(api_version),
gstvaapi_baseutils_sources,
c_args : gstreamer_vaapi_args,
include_directories: [configinc, libsinc],
version : libversion,
soversion : soversion,
dependencies : gstvaapi_baseutils_deps,
)
gstvaapi_baseutils_dep = declare_dependency(link_with: gstvaapi_baseutils,
include_directories : [libsinc],
dependencies : gstvaapi_baseutils_deps)
subdir('base')
subdir('vaapi')
......@@ -143,7 +143,6 @@ libgstvaapi_source_priv_h = \
gstvaapiutils_h264_priv.h \
gstvaapiutils_h265_priv.h \
gstvaapiutils_mpeg2_priv.h \
gstvaapiversion.h \
gstvaapivideopool_priv.h \
gstvaapiwindow_priv.h \
gstvaapiworkarounds.h \
......@@ -461,6 +460,7 @@ libgstvaapi_egl_la_CFLAGS = \
$(GST_BASE_CFLAGS) \
$(GST_VIDEO_CFLAGS) \
$(LIBVA_CFLAGS) \
$(LIBVA_WAYLAND_CFLAGS) \
$(EGL_CFLAGS) \
$(NULL)
......@@ -506,38 +506,7 @@ libgstvaapi_wayland_la_LDFLAGS = \
$(GST_ALL_LDFLAGS) \
$(NULL)
VERSION_FILE = .VERSION
OLD_VERSION_FILE = $(VERSION_FILE).old
NEW_VERSION_FILE = $(VERSION_FILE).new
PKG_VERSION_FILE = $(VERSION_FILE).pkg
gstvaapiversion.h: gen-version
$(AM_V_GEN) \
OV=`[ -f $(OLD_VERSION_FILE) ] && cat $(OLD_VERSION_FILE) || :`; \
NV=`cat $(NEW_VERSION_FILE)`; \
if [ "$$OV" != "$$NV" -o ! -f gstvaapiversion.h ]; then \
cp -f $(NEW_VERSION_FILE) $(OLD_VERSION_FILE); \
$(SED) -e "s|\@GST_VAAPI_VERSION_ID\@|$${NV}|" \
$(srcdir)/gstvaapiversion.h.in > gstvaapiversion.h; \
fi
gen-version:
@echo $(VERSION) > $(NEW_VERSION_FILE)
if HAVE_GIT
@[ -d $(top_srcdir)/.git ] && \
(cd $(top_srcdir) && $(GIT) describe --tags) > $(NEW_VERSION_FILE) || :
endif
@[ -f $(srcdir)/$(PKG_VERSION_FILE) ] && \
cp -f $(srcdir)/$(PKG_VERSION_FILE) $(NEW_VERSION_FILE) || :
$(PKG_VERSION_FILE): $(NEW_VERSION_FILE)
@cp -f $< $@
BUILT_SOURCES = gstvaapiversion.h
EXTRA_DIST = gstvaapiversion.h.in $(PKG_VERSION_FILE)
DISTCLEANFILES = $(BUILT_SOURCES)
EXTRA_DIST += \
EXTRA_DIST = \
$(libgstvaapi_enc_source_c) \
$(libgstvaapi_enc_source_h) \
$(libgstvaapi_enc_source_priv_h) \
......@@ -563,10 +532,4 @@ EXTRA_DIST += \
$(libgstvaapi_egl_source_priv_h) \
$(NULL)
CLEANFILES = \
$(OLD_VERSION_FILE) \
$(NEW_VERSION_FILE) \
$(PKG_VERSION_FILE) \
$(NULL)
-include $(top_srcdir)/git.mk
......@@ -3116,6 +3116,7 @@ fill_picture_gaps (GstVaapiDecoderH264 * decoder, GstVaapiPictureH264 * picture,
GstVaapiDecoderH264Private *const priv = &decoder->priv;
GstH264SPS *const sps = get_sps (decoder);
const gint32 MaxFrameNum = 1 << (sps->log2_max_frame_num_minus4 + 4);
gint32 prev_frame_num;
GstVaapiFrameStore *prev_frame;
GstVaapiPicture *base_picture;
GstVaapiPictureH264 *lost_picture, *prev_picture;
......@@ -3143,8 +3144,20 @@ fill_picture_gaps (GstVaapiDecoderH264 * decoder, GstVaapiPictureH264 * picture,
lost_slice_hdr.dec_ref_pic_marking.adaptive_ref_pic_marking_mode_flag = 0;
/* XXX: this process is incorrect for MVC */
/* XXX: optimize to reduce the number of dummy pictures created */
priv->frame_num = priv->prev_ref_frame_num;
/* Reduce frame num gaps so we don't have to create unnecessary
* dummy pictures */
prev_frame_num = priv->prev_ref_frame_num;
if (prev_frame_num > slice_hdr->frame_num)
prev_frame_num -= MaxFrameNum;
if ((slice_hdr->frame_num - prev_frame_num) - 1 > sps->num_ref_frames) {
prev_frame_num = (slice_hdr->frame_num - sps->num_ref_frames) - 1;
if (prev_frame_num < 0)
prev_frame_num += MaxFrameNum;
}
priv->frame_num = prev_frame_num;
for (;;) {
priv->prev_ref_frame_num = priv->frame_num;
priv->frame_num = (priv->prev_ref_frame_num + 1) % MaxFrameNum;
......@@ -3231,10 +3244,17 @@ init_picture (GstVaapiDecoderH264 * decoder,
picture->frame_num = priv->frame_num;
picture->frame_num_wrap = priv->frame_num;
picture->output_flag = TRUE; /* XXX: conformant to Annex A only */
base_picture->pts = GST_VAAPI_DECODER_CODEC_FRAME (decoder)->pts;
base_picture->type = GST_VAAPI_PICTURE_TYPE_NONE;
base_picture->view_id = pi->view_id;
base_picture->voc = pi->voc;
/* If it's a cloned picture, it has some assignments from parent
* picture already. In addition, base decoder doesn't set valid pts
* to the frame corresponding to cloned picture.
*/
if (G_LIKELY (!base_picture->parent_picture)) {
base_picture->pts = GST_VAAPI_DECODER_CODEC_FRAME (decoder)->pts;
base_picture->type = GST_VAAPI_PICTURE_TYPE_NONE;
base_picture->view_id = pi->view_id;
base_picture->voc = pi->voc;
}
/* Initialize extensions */
switch (pi->nalu.extension_type) {
......
......@@ -35,7 +35,6 @@
#include "gstvaapitexturemap.h"
#include "gstvaapidisplay_priv.h"
#include "gstvaapiworkarounds.h"
#include "gstvaapiversion.h"
#define DEBUG 1
#include "gstvaapidebug.h"
......@@ -116,9 +115,6 @@ libgstvaapi_init_once (void)
GST_DEBUG_CATEGORY_INIT (gst_debug_vaapi, "vaapi", 0, "VA-API helper");
/* Dump gstreamer-vaapi version for debugging purposes */
GST_INFO ("gstreamer-vaapi version %s", GST_VAAPI_VERSION_ID);
gst_vaapi_display_properties_init ();
g_once_init_leave (&g_once, TRUE);
......
......@@ -25,6 +25,7 @@
* @short_description: VA/DRM display abstraction
*/
#define _GNU_SOURCE
#include "sysdeps.h"
#include <string.h>
#include <unistd.h>
......
......@@ -1968,6 +1968,10 @@ fill_picture (GstVaapiEncoderH264 * encoder, GstVaapiEncPicture * picture,
pic_param->ReferenceFrames[i].picture_id =
GST_VAAPI_SURFACE_PROXY_SURFACE_ID (ref_pic->pic);
pic_param->ReferenceFrames[i].TopFieldOrderCnt = ref_pic->poc;
pic_param->ReferenceFrames[i].flags |=
VA_PICTURE_H264_SHORT_TERM_REFERENCE;
pic_param->ReferenceFrames[i].frame_idx = ref_pic->frame_num;
++i;
}
g_assert (i <= 16 && i <= ref_pool->max_ref_frames);
......@@ -2076,6 +2080,11 @@ add_slice_headers (GstVaapiEncoderH264 * encoder, GstVaapiEncPicture * picture,
for (; i_ref < reflist_0_count; ++i_ref) {
slice_param->RefPicList0[i_ref].picture_id =
GST_VAAPI_SURFACE_PROXY_SURFACE_ID (reflist_0[i_ref]->pic);
slice_param->RefPicList0[i_ref].TopFieldOrderCnt =
reflist_0[i_ref]->poc;
slice_param->RefPicList0[i_ref].flags |=
VA_PICTURE_H264_SHORT_TERM_REFERENCE;
slice_param->RefPicList0[i_ref].frame_idx = reflist_0[i_ref]->frame_num;
}
g_assert (i_ref == 1);
}
......@@ -2088,6 +2097,12 @@ add_slice_headers (GstVaapiEncoderH264 * encoder, GstVaapiEncPicture * picture,
for (; i_ref < reflist_1_count; ++i_ref) {
slice_param->RefPicList1[i_ref].picture_id =
GST_VAAPI_SURFACE_PROXY_SURFACE_ID (reflist_1[i_ref]->pic);
slice_param->RefPicList1[i_ref].TopFieldOrderCnt =
reflist_1[i_ref]->poc;
slice_param->RefPicList1[i_ref].flags |=
VA_PICTURE_H264_SHORT_TERM_REFERENCE;
slice_param->RefPicList1[i_ref].frame_idx |=
reflist_1[i_ref]->frame_num;
}
g_assert (i_ref == 1);
}
......
......@@ -2166,9 +2166,9 @@ gst_vaapi_encoder_h265_get_codec_data (GstVaapiEncoder * base_encoder,
WRITE_UINT32 (&bs, 0x00, 2); /* parallelismType */
WRITE_UINT32 (&bs, 0x3f, 6); /* 111111 */
WRITE_UINT32 (&bs, 0x01, 2); /* chroma_format_idc */
WRITE_UINT32 (&bs, 0x3f, 6); /* 111111 */
WRITE_UINT32 (&bs, 0x1f, 5); /* 11111 */
WRITE_UINT32 (&bs, 0x01, 3); /* bit_depth_luma_minus8 */
WRITE_UINT32 (&bs, 0x3f, 6); /* 111111 */
WRITE_UINT32 (&bs, 0x1f, 5); /* 11111 */
WRITE_UINT32 (&bs, 0x01, 3); /* bit_depth_chroma_minus8 */
WRITE_UINT32 (&bs, 0x00, 16); /* avgFramerate */
WRITE_UINT32 (&bs, 0x00, 2); /* constatnFramerate */
......
......@@ -74,7 +74,8 @@ gst_vaapi_encoder_vp9_ref_pic_mode_type (void)
"mode-0"},
{GST_VAAPI_ENCODER_VP9_REF_PIC_MODE_1,
"Use last three frames for prediction (n:Last n-1:Gold n-2:Alt)",
"mode-1"}
"mode-1"},
{0, NULL, NULL},
};
gtype = g_enum_register_static ("GstVaapiEncoderVP9RefPicMode", values);
......@@ -433,7 +434,8 @@ gst_vaapi_encoder_vp9_init (GstVaapiEncoder * base_encoder)
encoder->sharpness_level = DEFAULT_SHARPNESS_LEVEL;
encoder->yac_qi = DEFAULT_YAC_QINDEX;
memset (encoder->ref_list, 0, G_N_ELEMENTS (encoder->ref_list));
memset (encoder->ref_list, 0,
G_N_ELEMENTS (encoder->ref_list) * sizeof (encoder->ref_list[0]));
encoder->ref_list_idx = 0;
return TRUE;
......
/*
* gstvaapiversion.h - Versioning
*
* Copyright (C) 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
* 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_VAAPI_VERSION_H
#define GST_VAAPI_VERSION_H
/**
* GST_VAAPI_VERSION_ID:
*
* The full version identifier of gstreamer-vaapi, in string form
* (suitable for string concatenation).
*/
#define GST_VAAPI_VERSION_ID "@GST_VAAPI_VERSION_ID@"
#endif /* GST_VAAPI_VERSION_H */
gstlibvaapi_sources = [
'gstvaapibufferproxy.c',
'gstvaapicodec_objects.c',
'gstvaapicontext.c',
'gstvaapicontext_overlay.c',
'gstvaapidecoder.c',
'gstvaapidecoder_dpb.c',
'gstvaapidecoder_h264.c',
'gstvaapidecoder_mpeg2.c',
'gstvaapidecoder_mpeg4.c',
'gstvaapidecoder_objects.c',
'gstvaapidecoder_unit.c',
'gstvaapidecoder_vc1.c',
'gstvaapidisplay.c',
'gstvaapidisplaycache.c',
'gstvaapifilter.c',
'gstvaapiimage.c',
'gstvaapiimagepool.c',
'gstvaapiminiobject.c',
'gstvaapiobject.c',
'gstvaapiparser_frame.c',
'gstvaapipixmap.c',
'gstvaapiprofile.c',
'gstvaapisubpicture.c',
'gstvaapisurface.c',
'gstvaapisurface_drm.c',
'gstvaapisurfacepool.c',
'gstvaapisurfaceproxy.c',
'gstvaapitexture.c',
'gstvaapitexturemap.c',
'gstvaapiutils.c',
'gstvaapiutils_core.c',
'gstvaapiutils_h264.c',
'gstvaapiutils_h265.c',
'gstvaapiutils_mpeg2.c',
'gstvaapivalue.c',
'gstvaapivideopool.c',
'gstvaapiwindow.c',
'video-format.c',
]
gstlibvaapi_headers = [
'gstvaapibufferproxy.h',
'gstvaapidecoder.h',
'gstvaapidecoder_h264.h',
'gstvaapidecoder_h265.h',
'gstvaapidecoder_mpeg2.h',
'gstvaapidecoder_mpeg4.h',
'gstvaapidecoder_vc1.h',
'gstvaapidisplay.h',
'gstvaapifilter.h',
'gstvaapiimage.h',
'gstvaapiimagepool.h',
'gstvaapiobject.h',
'gstvaapipixmap.h',
'gstvaapiprofile.h',
'gstvaapisubpicture.h',
'gstvaapisurface.h',
'gstvaapisurface_drm.h',
'gstvaapisurfacepool.h',
'gstvaapisurfaceproxy.h',
'gstvaapitexture.h',
'gstvaapitexturemap.h',
'gstvaapitypes.h',
'gstvaapiutils_h264.h',
'gstvaapiutils_h265.h',
'gstvaapiutils_mpeg2.h',
'gstvaapivalue.h',
'gstvaapivideopool.h',
'gstvaapiwindow.h',
'video-format.h',
]
if USE_JPEG_DECODER
gstlibvaapi_sources += 'gstvaapidecoder_jpeg.c'
gstlibvaapi_headers += 'gstvaapidecoder_jpeg.h'
endif
if USE_VP8_DECODER
gstlibvaapi_sources += 'gstvaapidecoder_vp8.c'
gstlibvaapi_headers += 'gstvaapidecoder_vp8.h'
endif
if USE_H265_DECODER
gstlibvaapi_sources += 'gstvaapidecoder_h265.c'
gstlibvaapi_headers += 'gstvaapidecoder_h265.h'
endif
if USE_VP9_DECODER
gstlibvaapi_sources += 'gstvaapidecoder_vp9.c'
gstlibvaapi_headers += 'gstvaapidecoder_vp9.h'
endif
if USE_ENCODERS
gstlibvaapi_sources += [
'gstvaapicodedbuffer.c',
'gstvaapicodedbufferpool.c',
'gstvaapicodedbufferproxy.c',
'gstvaapiencoder.c',
'gstvaapiencoder_h264.c',
'gstvaapiencoder_mpeg2.c',
'gstvaapiencoder_objects.c',
]
gstlibvaapi_headers += [
'gstvaapicodedbuffer.h',
'gstvaapicodedbufferpool.h',
'gstvaapicodedbufferproxy.h',
'gstvaapiencoder.h',
'gstvaapiencoder_h264.h',
'gstvaapiencoder_mpeg2.h',
]
endif
if USE_JPEG_ENCODER
gstlibvaapi_sources += 'gstvaapiencoder_jpeg.c'
gstlibvaapi_headers += 'gstvaapiencoder_jpeg.h'
endif
if USE_VP8_ENCODER
gstlibvaapi_sources += 'gstvaapiencoder_vp8.c'
gstlibvaapi_headers += 'gstvaapiencoder_vp8.h'
endif
if USE_H265_ENCODER
gstlibvaapi_sources += 'gstvaapiencoder_h265.c'
gstlibvaapi_headers += 'gstvaapiencoder_h265.h'
endif
if USE_VP9_ENCODER
gstlibvaapi_sources += 'gstvaapiencoder_vp9.c'
gstlibvaapi_headers += 'gstvaapiencoder_vp9.h'
endif
if USE_DRM
gstlibvaapi_sources += [
'gstvaapidisplay_drm.c',
'gstvaapiwindow_drm.c',
]
gstlibvaapi_headers += [
'gstvaapidisplay_drm.h',
'gstvaapiwindow_drm.h',
]
endif
if USE_X11
gstlibvaapi_sources += [
'gstvaapidisplay_x11.c',
'gstvaapipixmap_x11.c',
'gstvaapiutils_x11.c',
'gstvaapiwindow_x11.c',
]
gstlibvaapi_headers += [
'gstvaapidisplay_x11.h',
'gstvaapipixmap_x11.h',
'gstvaapiwindow_x11.h',
]
endif
if USE_GLX
gstlibvaapi_sources += [
'gstvaapidisplay_glx.c',
'gstvaapitexture_glx.c',
'gstvaapiutils_glx.c',
'gstvaapiwindow_glx.c',
]
gstlibvaapi_headers += [
'gstvaapidisplay_glx.h',
'gstvaapitexture.h',
'gstvaapitexture_glx.h',
'gstvaapiwindow_glx.h',
]
endif
if USE_EGL
gstlibvaapi_sources += [
'gstvaapidisplay_egl.c',
'gstvaapisurface_egl.c',
'gstvaapitexture_egl.c',
'gstvaapiutils_egl.c',
'gstvaapiwindow_egl.c',
]
gstlibvaapi_headers += [
'gstvaapidisplay_egl.h',
'gstvaapisurface_egl.h',
'gstvaapitexture_egl.h',
'gstvaapiwindow_egl.h',
]
endif
if USE_WAYLAND
gstlibvaapi_sources += [
'gstvaapidisplay_wayland.c',
'gstvaapiwindow_wayland.c',
]
gstlibvaapi_headers += [
'gstvaapidisplay_wayland.h',
'gstvaapiwindow_wayland.h',
]
endif
gstlibvaapi_deps = [gstbase_dep, gstvideo_dep, gstcodecparsers_dep, libva_dep, gstvaapi_baseutils_dep]
if USE_DRM
gstlibvaapi_deps += [libva_drm_dep, libdrm_dep, libudev_dep]
endif
if USE_EGL
gstlibvaapi_deps += [egl_dep, gmodule_dep]
endif
if USE_GLX
gstlibvaapi_deps += [libva_x11_dep, x11_dep, gl_dep, libdl_dep]
endif
if USE_WAYLAND
gstlibvaapi_deps += [libva_wayland_dep, wayland_client_dep]
endif
if USE_X11
gstlibvaapi_deps += [libva_x11_dep, x11_dep, xrandr_dep, xrender_dep]
endif
gstlibvaapi = static_library('gstlibvaapi-@0@'.format(api_version),
gstlibvaapi_sources,
c_args : gstreamer_vaapi_args + ['-DIN_LIBGSTVAAPI', '-DIN_LIBGSTVAAPI_CORE', '-DGST_USE_UNSTABLE_API', '-DGST_VAAPI_VERSION_ID="@0@"'.format(gst_version)],
include_directories: [configinc, libsinc],
version : libversion,
soversion : soversion,
dependencies : gstlibvaapi_deps,
)
gstlibvaapi_dep = declare_dependency(link_with: gstlibvaapi,
include_directories : [libsinc],
dependencies : gstlibvaapi_deps)
subdir('vaapi')
......@@ -200,12 +200,60 @@ gst_vaapidecode_update_sink_caps (GstVaapiDecode * decode, GstCaps * caps)
return TRUE;
}
static gboolean
gst_vaapidecode_ensure_allowed_srcpad_caps (GstVaapiDecode * decode)
{
GstCaps *out_caps, *raw_caps;
if (decode->allowed_srcpad_caps)
return TRUE;
if (!GST_VAAPI_PLUGIN_BASE_DISPLAY (decode))
return FALSE;
/* Create VA caps */
out_caps = gst_caps_from_string (GST_VAAPI_MAKE_SURFACE_CAPS);
out_caps = gst_caps_make_writable (out_caps);
#if (USE_GLX || USE_EGL)
if (gst_vaapi_display_has_opengl (GST_VAAPI_PLUGIN_BASE_DISPLAY (decode))) {
gst_caps_append (out_caps,
gst_caps_from_string (GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS));
}
#endif
raw_caps = gst_vaapi_plugin_base_get_allowed_raw_caps
(GST_VAAPI_PLUGIN_BASE (decode));
if (!raw_caps) {
gst_caps_unref (out_caps);
GST_WARNING_OBJECT (decode, "failed to create raw sink caps");
return FALSE;
}
gst_caps_append (out_caps, gst_caps_copy (raw_caps));
decode->allowed_srcpad_caps = out_caps;
GST_INFO_OBJECT (decode, "allowed srcpad caps: %" GST_PTR_FORMAT,
decode->allowed_srcpad_caps);
return TRUE;
}
static GstCaps *
gst_vaapidecode_get_allowed_srcpad_caps (GstVaapiDecode * decode)
{
GstPad *const srcpad = GST_VIDEO_DECODER_SRC_PAD (decode);
if (gst_vaapidecode_ensure_allowed_srcpad_caps (decode))
return gst_caps_ref (decode->allowed_srcpad_caps);
return gst_pad_get_pad_template_caps (srcpad);
}
static gboolean
gst_vaapidecode_update_src_caps (GstVaapiDecode * decode)
{
GstVideoDecoder *const vdec = GST_VIDEO_DECODER (decode);
GstPad *const srcpad = GST_VIDEO_DECODER_SRC_PAD (vdec);
GstCaps *templ;
GstCaps *allowed;
GstVideoCodecState *state, *ref_state;
GstVaapiCapsFeature feature;
GstCapsFeatures *features;
......@@ -223,9 +271,9 @@ gst_vaapidecode_update_src_caps (GstVaapiDecode * decode)
ref_state = decode->input_state;
format = GST_VIDEO_INFO_FORMAT (&decode->decoded_info);
templ = gst_pad_get_pad_template_caps (srcpad);
feature = gst_vaapi_find_preferred_caps_feature (srcpad, templ, &format);
gst_caps_unref (templ);
allowed = gst_vaapidecode_get_allowed_srcpad_caps (decode);
feature = gst_vaapi_find_preferred_caps_feature (srcpad, allowed, &format);
gst_caps_unref (allowed);
if (feature == GST_VAAPI_CAPS_FEATURE_NOT_NEGOTIATED)
return FALSE;
......@@ -934,6 +982,7 @@ gst_vaapidecode_close (GstVideoDecoder * vdec)
GstVaapiDecode *const decode = GST_VAAPIDECODE (vdec);
gst_vaapidecode_destroy (decode);
gst_caps_replace (&decode->allowed_srcpad_caps, NULL);
gst_vaapi_plugin_base_close (GST_VAAPI_PLUGIN_BASE (decode));
return TRUE;
}
......
......@@ -47,6 +47,7 @@ struct _GstVaapiDecode {
GCond surface_ready;
GstCaps *decoder_caps;
GstCaps *allowed_sinkpad_caps;
GstCaps *allowed_srcpad_caps;
guint current_frame_size;
guint has_texture_upload_meta : 1;
......
......@@ -30,7 +30,7 @@
* <refsect2>
* <title>Example launch line</title>
* |[
* gst-launch-1.0 -ev videotestsrc num-buffers=60 ! timeoverlay ! vaapih264enc ! mp4mux ! filesink location=test.mp4
* gst-launch-1.0 -ev videotestsrc num-buffers=60 ! timeoverlay ! vaapih264enc ! h264parse ! mp4mux ! filesink location=test.mp4
* ]|
* </refsect2>
*/
......
......@@ -29,7 +29,7 @@
* <refsect2>
* <title>Example launch line</title>
* |[
* gst-launch-1.0 -ev videotestsrc num-buffers=60 ! timeoverlay ! vaapih265enc ! matroskamux ! filesink location=test.mkv
* gst-launch-1.0 -ev videotestsrc num-buffers=60 ! timeoverlay ! vaapih265enc ! h265parse ! matroskamux ! filesink location=test.mkv
* ]|
* </refsect2>
*/
......
......@@ -1087,6 +1087,7 @@ ensure_allowed_raw_caps (GstVaapiPluginBase * plugin)
{
GArray *formats, *out_formats;
GstVaapiSurface *surface;
GstVaapiDisplay *display;
guint i;
GstCaps *out_caps;
gboolean ret = FALSE;
......@@ -1097,7 +1098,8 @@ ensure_allowed_raw_caps (GstVaapiPluginBase * plugin)
out_formats = formats = NULL;
surface = NULL;
formats = gst_vaapi_display_get_image_formats (plugin->display);
display = gst_vaapi_display_ref (plugin->display);
formats = gst_vaapi_display_get_image_formats (display);
if (!formats)
goto bail;
......@@ -1107,8 +1109,7 @@ ensure_allowed_raw_caps (GstVaapiPluginBase * plugin)
goto bail;
surface =
gst_vaapi_surface_new (plugin->display, GST_VAAPI_CHROMA_TYPE_YUV420, 64,
64);
gst_vaapi_surface_new (display, GST_VAAPI_CHROMA_TYPE_YUV420, 64, 64);
if (!surface)
goto bail;
......@@ -1118,7 +1119,7 @@ ensure_allowed_raw_caps (GstVaapiPluginBase * plugin)
if (format == GST_VIDEO_FORMAT_UNKNOWN)
continue;
image = gst_vaapi_image_new (plugin->display, format, 64, 64);
image = gst_vaapi_image_new (display, format, 64, 64);
if (!image)
continue;
if (gst_vaapi_surface_put_image (surface, image))
......@@ -1141,6 +1142,7 @@ bail:
g_array_unref (out_formats);
if (surface)
gst_vaapi_object_unref (surface);
gst_vaapi_display_unref (display);
return ret;
}
......
......@@ -380,8 +380,7 @@ set_video_template_caps (GstCaps * caps)
gst_structure_set (structure,
"width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
"height", GST_TYPE_INT_RANGE, 1, G_MAXINT,
"framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1,
"pixel-aspect-ratio", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
"framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
}
GstCaps *
......
......@@ -68,7 +68,7 @@ static const char gst_vaapipostproc_src_caps_str[] =
GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS "; "
#endif
GST_VIDEO_CAPS_MAKE (GST_VIDEO_FORMATS_ALL) ", "
GST_CAPS_INTERLACED_FALSE;
GST_CAPS_INTERLACED_MODES;
/* *INDENT-ON* */
/* *INDENT-OFF* */
......@@ -808,9 +808,9 @@ error_process_vpp:
}
error_push_buffer:
{
if (ret != GST_FLOW_FLUSHING)
GST_ERROR_OBJECT (postproc, "failed to push output buffer to video sink");
return GST_FLOW_ERROR;
GST_DEBUG_OBJECT (postproc, "failed to push output buffer: %s",
gst_flow_get_name (ret));
return ret;
}
}
......@@ -885,9 +885,9 @@ error_create_buffer:
}
error_push_buffer:
{
if (ret != GST_FLOW_FLUSHING)
GST_ERROR_OBJECT (postproc, "failed to push output buffer to video sink");
return GST_FLOW_EOS;
GST_DEBUG_OBJECT (postproc, "failed to push output buffer: %s",
gst_flow_get_name (ret));
return ret;
}
}
......@@ -981,10 +981,12 @@ gst_vaapipostproc_update_src_caps (GstVaapiPostproc * postproc, GstCaps * caps,
postproc->format != DEFAULT_FORMAT)
postproc->flags |= GST_VAAPI_POSTPROC_FLAG_FORMAT;
if ((postproc->width || postproc->height) &&
postproc->width != GST_VIDEO_INFO_WIDTH (&postproc->sinkpad_info) &&
postproc->height != GST_VIDEO_INFO_HEIGHT (&postproc->sinkpad_info))
if (GST_VIDEO_INFO_WIDTH (&postproc->srcpad_info) !=
GST_VIDEO_INFO_WIDTH (&postproc->sinkpad_info)
&& GST_VIDEO_INFO_HEIGHT (&postproc->srcpad_info) !=
GST_VIDEO_INFO_HEIGHT (&postproc->sinkpad_info))
postproc->flags |= GST_VAAPI_POSTPROC_FLAG_SIZE;
return TRUE;
}
......@@ -1029,6 +1031,7 @@ expand_allowed_srcpad_caps (GstVaapiPostproc * postproc, GstCaps * caps)
{
GValue value = G_VALUE_INIT, v_format = G_VALUE_INIT;
guint i, num_structures;
gint gl_upload_meta_idx = -1;
if (postproc->filter == NULL)
goto cleanup;
......@@ -1049,8 +1052,10 @@ expand_allowed_srcpad_caps (GstVaapiPostproc * postproc, GstCaps * caps)
GstStructure *structure;
if (gst_caps_features_contains (features,
GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META))
GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META)) {
gl_upload_meta_idx = i;
continue;
}
structure = gst_caps_get_structure (caps, i);
if (!structure)
......@@ -1059,6 +1064,13 @@ expand_allowed_srcpad_caps (GstVaapiPostproc * postproc, GstCaps * caps)
}
g_value_unset (&value);
/* remove GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META if
* the backend doesn't support opengl */
if (!gst_vaapi_display_has_opengl (GST_VAAPI_PLUGIN_BASE_DISPLAY (postproc))
&& gl_upload_meta_idx > -1) {
gst_caps_remove_structure (caps, gl_upload_meta_idx);
}
cleanup:
return caps;
}
......@@ -1273,12 +1285,13 @@ gst_vaapipostproc_set_caps (GstBaseTransform * trans, GstCaps * caps,
GstCaps * out_caps)
{
GstVaapiPostproc *const postproc = GST_VAAPIPOSTPROC (trans);
gboolean caps_changed = FALSE;
gboolean sink_caps_changed = FALSE;
gboolean src_caps_changed = FALSE;
GstVideoInfo vinfo;
gboolean ret = FALSE;
g_mutex_lock (&postproc->postproc_lock);
if (!gst_vaapipostproc_update_sink_caps (postproc, caps, &caps_changed))
if (!gst_vaapipostproc_update_sink_caps (postproc, caps, &sink_caps_changed))
goto done;
/* HACK: This is a workaround to deal with the va-intel-driver for non-native
* formats while doing advanced deinterlacing. The format of reference surfaces must
......@@ -1292,10 +1305,11 @@ gst_vaapipostproc_set_caps (GstBaseTransform * trans, GstCaps * caps,
"Advanced deinterlacing requires the native video formats used by the driver internally");
goto done;
}
if (!gst_vaapipostproc_update_src_caps (postproc, out_caps, &caps_changed))
if (!gst_vaapipostproc_update_src_caps (postproc, out_caps,
&src_caps_changed))
goto done;
if (caps_changed) {
if (sink_caps_changed || src_caps_changed) {
gst_vaapipostproc_destroy (postproc);
if (!gst_vaapipostproc_create (postproc))
goto done;
......@@ -1309,13 +1323,20 @@ gst_vaapipostproc_set_caps (GstBaseTransform * trans, GstCaps * caps,
postproc->same_caps = gst_caps_is_equal (caps, out_caps);
/* set passthrough according to caps changes or filter changes */
gst_vaapipostproc_set_passthrough (trans);
if (!src_caps_changed) {
/* set passthrough according to caps changes or filter changes */
gst_vaapipostproc_set_passthrough (trans);
}
ret = TRUE;
done:
g_mutex_unlock (&postproc->postproc_lock);
/* Updates the srcpad caps and send the caps downstream */
if (ret && src_caps_changed)
gst_base_transform_update_src_caps (trans, out_caps);
return ret;
}
......
......@@ -160,11 +160,11 @@ _fixate_frame_size (GstVaapiPostproc * postproc, GstVideoInfo * vinfo,
to_par = gst_structure_get_value (outs, "pixel-aspect-ratio");
if (!to_par) {
g_value_init (&tpar, GST_TYPE_FRACTION);
gst_value_set_fraction (&tpar, 1, 1);
gst_value_set_fraction (&tpar, GST_VIDEO_INFO_PAR_N (vinfo),
GST_VIDEO_INFO_PAR_D (vinfo));
to_par = &tpar;
gst_structure_set (outs, "pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1,
NULL);
gst_structure_set_value (outs, "pixel-aspect-ratio", &tpar);
}
/* we have both PAR but they might not be fixated */
......@@ -175,6 +175,8 @@ _fixate_frame_size (GstVaapiPostproc * postproc, GstVideoInfo * vinfo,
gint num, den;
from_par_n = GST_VIDEO_INFO_PAR_N (vinfo);
if (from_par_n == 0)
from_par_n = 1;
from_par_d = GST_VIDEO_INFO_PAR_D (vinfo);
from_w = GST_VIDEO_INFO_WIDTH (vinfo);
from_h = GST_VIDEO_INFO_HEIGHT (vinfo);
......@@ -548,6 +550,30 @@ overflow_error:
}
}
static gboolean
_set_multiview_mode (GstVaapiPostproc * postproc, GstVideoInfo * vinfo,
GstStructure * outs)
{
const gchar *caps_str;
caps_str =
gst_video_multiview_mode_to_caps_string (GST_VIDEO_INFO_MULTIVIEW_MODE
(vinfo));
if (!caps_str)
return TRUE;
gst_structure_set (outs, "multiview-mode", G_TYPE_STRING, caps_str,
"multiview-flags", GST_TYPE_VIDEO_MULTIVIEW_FLAGSET,
GST_VIDEO_INFO_MULTIVIEW_FLAGS (vinfo), GST_FLAG_SET_MASK_EXACT, NULL);
if (GST_VIDEO_INFO_VIEWS (vinfo) > 1) {
gst_structure_set (outs, "views", G_TYPE_INT, GST_VIDEO_INFO_VIEWS (vinfo),
NULL);
}
return TRUE;
}
static gboolean
_set_colorimetry (GstVaapiPostproc * postproc, GstVideoFormat format,
GstStructure * outs)
......@@ -585,6 +611,28 @@ _set_colorimetry (GstVaapiPostproc * postproc, GstVideoFormat format,
return TRUE;
}
static gboolean
_set_interlace_mode (GstVaapiPostproc * postproc, GstVideoInfo * vinfo,
GstStructure * outs)
{
const gchar *interlace_mode = NULL;
if (is_deinterlace_enabled (postproc, vinfo)) {
interlace_mode = "progressive";
} else {
interlace_mode =
gst_video_interlace_mode_to_string (GST_VIDEO_INFO_INTERLACE_MODE
(vinfo));
}
if (!interlace_mode)
return FALSE;
gst_structure_set (outs, "interlace-mode", G_TYPE_STRING, interlace_mode,
NULL);
return TRUE;
}
static gboolean
_set_preferred_format (GstStructure * outs, GstVideoFormat format)
{
......@@ -645,10 +693,14 @@ _get_preferred_caps (GstVaapiPostproc * postproc, GstVideoInfo * vinfo,
goto fixate_failed;
if (!_fixate_frame_rate (postproc, vinfo, structure))
goto fixate_failed;
_set_multiview_mode (postproc, vinfo, structure);
if (f == GST_VAAPI_CAPS_FEATURE_SYSTEM_MEMORY)
_set_colorimetry (postproc, format, structure);
if (!_set_interlace_mode (postproc, vinfo, structure))
goto interlace_mode_failed;
outcaps = gst_caps_new_empty ();
gst_caps_append_structure_full (outcaps, structure,
gst_caps_features_copy (features));
......@@ -673,6 +725,11 @@ invalid_caps:
GST_WARNING_OBJECT (postproc, "No valid src caps found");
return NULL;
}
interlace_mode_failed:
{
GST_WARNING_OBJECT (postproc, "Invalid sink caps interlace mode");
return NULL;
}
}
/**
......
......@@ -574,10 +574,8 @@ gst_vaapisink_video_overlay_expose (GstVideoOverlay * overlay)
{
GstVaapiSink *const sink = GST_VAAPISINK (overlay);
if (sink->video_buffer) {
gst_vaapisink_reconfigure_window (sink);
gst_vaapisink_show_frame (GST_VIDEO_SINK_CAST (sink), sink->video_buffer);
}
gst_vaapisink_reconfigure_window (sink);
gst_vaapisink_show_frame (GST_VIDEO_SINK_CAST (sink), NULL);
}
static void
......@@ -586,6 +584,7 @@ gst_vaapisink_video_overlay_set_event_handling (GstVideoOverlay * overlay,
{
GstVaapiSink *const sink = GST_VAAPISINK (overlay);
sink->handle_events = handle_events;
gst_vaapisink_set_event_handling (sink, handle_events);
}
......@@ -932,7 +931,6 @@ gst_vaapisink_set_event_handling (GstVaapiSink * sink, gboolean handle_events)
return;
GST_OBJECT_LOCK (sink);
sink->handle_events = handle_events;
if (handle_events && !sink->event_thread) {
/* Setup our event listening thread */
GST_DEBUG ("starting xevent thread");
......@@ -1224,6 +1222,7 @@ gst_vaapisink_stop (GstBaseSink * base_sink)
{
GstVaapiSink *const sink = GST_VAAPISINK_CAST (base_sink);
gst_vaapisink_set_event_handling (sink, FALSE);
gst_buffer_replace (&sink->video_buffer, NULL);
gst_vaapi_window_replace (&sink->window, NULL);
......@@ -1322,6 +1321,8 @@ gst_vaapisink_set_caps (GstBaseSink * base_sink, GstCaps * caps)
sink->video_height = GST_VIDEO_INFO_HEIGHT (vip);
sink->video_par_n = GST_VIDEO_INFO_PAR_N (vip);
sink->video_par_d = GST_VIDEO_INFO_PAR_D (vip);
if (sink->video_par_n == 0)
sink->video_par_n = 1;
GST_DEBUG ("video pixel-aspect-ratio %d/%d",
sink->video_par_n, sink->video_par_d);
......@@ -1362,14 +1363,22 @@ gst_vaapisink_show_frame_unlocked (GstVaapiSink * sink, GstBuffer * src_buffer)
GstVaapiSurfaceProxy *proxy;
GstVaapiSurface *surface;
GstBuffer *buffer;
GstBuffer *old_buf;
guint flags;
GstVaapiRectangle *surface_rect = NULL;
GstVaapiRectangle tmp_rect;
GstFlowReturn ret;
gint32 view_id;
GstVideoCropMeta *crop_meta;
GstVideoCropMeta *const crop_meta =
gst_buffer_get_video_crop_meta (src_buffer);
if (!src_buffer) {
if (sink->video_buffer)
src_buffer = sink->video_buffer;
else
return GST_FLOW_OK;
}
crop_meta = gst_buffer_get_video_crop_meta (src_buffer);
if (crop_meta) {
surface_rect = &tmp_rect;
surface_rect->x = crop_meta->x;
......@@ -1438,9 +1447,13 @@ gst_vaapisink_show_frame_unlocked (GstVaapiSink * sink, GstBuffer * src_buffer)
g_signal_emit (sink, gst_vaapisink_signals[HANDOFF_SIGNAL], 0, buffer);
/* Retain VA surface until the next one is displayed */
/* Need to release the lock for the duration, otherwise a deadlock is possible */
old_buf = sink->video_buffer;
sink->video_buffer = gst_buffer_ref (buffer);
/* Need to release the lock while releasing old buffer, otherwise a
* deadlock is possible */
gst_vaapi_display_unlock (GST_VAAPI_PLUGIN_BASE_DISPLAY (sink));
gst_buffer_replace (&sink->video_buffer, buffer);
if (old_buf)
gst_buffer_unref (old_buf);
gst_vaapi_display_lock (GST_VAAPI_PLUGIN_BASE_DISPLAY (sink));
ret = GST_FLOW_OK;
......@@ -1520,8 +1533,6 @@ gst_vaapisink_query (GstBaseSink * base_sink, GstQuery * query)
static void
gst_vaapisink_destroy (GstVaapiSink * sink)
{
gst_vaapisink_set_event_handling (sink, FALSE);
cb_channels_finalize (sink);
gst_buffer_replace (&sink->video_buffer, NULL);
gst_caps_replace (&sink->caps, NULL);
......
......@@ -159,6 +159,28 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool,
gst_object_replace ((GstObject **) & priv->allocator, NULL);
priv->video_info = new_vip;
{
guint surface_alloc_flags;
gboolean vinfo_changed = FALSE;
if (allocator) {
const GstVideoInfo *alloc_vinfo =