...
 
Commits (168)
[submodule "common"]
path = common
url = https://anongit.freedesktop.org/git/gstreamer/common.git
url = https://gitlab.freedesktop.org/gstreamer/common.git
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
GStreamer 1.13.x development series
GStreamer 1.14.x development series
WHAT IT IS
----------
......
This is GStreamer gst-plugins-base 1.14.0.
This is GStreamer gst-plugins-base 1.14.5.
The GStreamer team is thrilled to announce a new major feature release in the
The GStreamer team is pleased to announce another bug-fix release in the
stable 1.x API series of your favourite cross-platform multimedia framework!
As always, this release is again packed with new features, bug fixes and
other improvements.
The 1.14 release series adds new features on top of the 1.12 series and is
part of the API and ABI-stable 1.x release series of the GStreamer multimedia
framework.
The 1.14 release series has now been superseded by the stable 1.16 series
which was released on 19 April 2019 and should be backwards compatible. We
recommend you upgrade to 1.16 at your earliest convenience.
Full release notes can be found at:
https://gstreamer.freedesktop.org/releases/1.14/
......@@ -57,10 +58,10 @@ with other GStreamer modules for a complete multimedia experience.
==== Download ====
You can find source releases of gstreamer in the download
directory: https://gstreamer.freedesktop.org/src/gstreamer/
directory: https://gstreamer.freedesktop.org/src/
The git repository and details how to clone it can be found at
http://cgit.freedesktop.org/gstreamer/gstreamer/
https://gitlab.freedesktop.org/gstreamer/
==== Homepage ====
......@@ -68,10 +69,16 @@ The project's website is https://gstreamer.freedesktop.org/
==== Support and Bugs ====
We use GNOME's bugzilla for bug reports and feature requests:
http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer
We have recently moved from GNOME Bugzilla to GitLab on freedesktop.org
for bug reports and feature requests:
https://gitlab.freedesktop.org/gstreamer
Please submit patches via GitLab as well, in form of Merge Requests. See
https://gstreamer.freedesktop.org/documentation/contribute/
Please submit patches via bugzilla as well.
for more details.
For help and support, please subscribe to and send questions to the
gstreamer-devel mailing list (see below for details).
......
......@@ -5,7 +5,7 @@ dnl please read gstreamer/docs/random/autotools before changing this file
dnl initialize autoconf
dnl releases only do -Wall, git and prerelease does -Werror too
dnl use a three digit version number for releases, and four for git/prerelease
AC_INIT([GStreamer Base Plug-ins],[1.14.0],[http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer],[gst-plugins-base])
AC_INIT([GStreamer Base Plug-ins],[1.14.5],[http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer],[gst-plugins-base])
AG_GST_INIT
......@@ -56,10 +56,10 @@ dnl 1.2.5 => 205
dnl 1.10.9 (who knows) => 1009
dnl
dnl sets GST_LT_LDFLAGS
AS_LIBTOOL(GST, 1400, 0, 1400)
AS_LIBTOOL(GST, 1405, 0, 1405)
dnl *** required versions of GStreamer stuff ***
GST_REQ=1.14.0
GST_REQ=1.14.5
dnl *** autotools stuff ****
......
......@@ -3464,7 +3464,7 @@
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>Plane offsets</NICK>
<BLURB>Offsets of the planes in bytes (e.g. plane-offset="<0,76800>").</BLURB>
<BLURB>Offsets of the planes in bytes (e.g. plane-offsets="<0,76800>").</BLURB>
<DEFAULT></DEFAULT>
</ARG>
......
......@@ -3,7 +3,7 @@
<description>Adds multiple streams</description>
<filename>../../gst/adder/.libs/libgstadder.so</filename>
<basename>libgstadder.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>ALSA plugin library</description>
<filename>../../ext/alsa/.libs/libgstalsa.so</filename>
<basename>libgstalsa.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Elements used to communicate with applications</description>
<filename>../../gst/app/.libs/libgstapp.so</filename>
<basename>libgstapp.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Convert audio to different formats</description>
<filename>../../gst/audioconvert/.libs/libgstaudioconvert.so</filename>
<basename>libgstaudioconvert.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Mixes multiple audio streams</description>
<filename>../../gst/audiomixer/.libs/libgstaudiomixer.so</filename>
<basename>libgstaudiomixer.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Adjusts audio frames</description>
<filename>../../gst/audiorate/.libs/libgstaudiorate.so</filename>
<basename>libgstaudiorate.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Resamples audio</description>
<filename>../../gst/audioresample/.libs/libgstaudioresample.so</filename>
<basename>libgstaudioresample.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Creates audio test signals of given frequency and volume</description>
<filename>../../gst/audiotestsrc/.libs/libgstaudiotestsrc.so</filename>
<basename>libgstaudiotestsrc.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Read audio from CD in paranoid mode</description>
<filename>../../ext/cdparanoia/.libs/libgstcdparanoia.so</filename>
<basename>libgstcdparanoia.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>various encoding-related elements</description>
<filename>../../gst/encoding/.libs/libgstencoding.so</filename>
<basename>libgstencoding.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>GIO elements</description>
<filename>../../gst/gio/.libs/libgstgio.so</filename>
<basename>libgstgio.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>libvisual visualization plugins</description>
<filename>../../ext/libvisual/.libs/libgstlibvisual.so</filename>
<basename>libgstlibvisual.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>ogg stream manipulation (info about ogg: http://xiph.org)</description>
<filename>../../ext/ogg/.libs/libgstogg.so</filename>
<basename>libgstogg.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>OpenGL plugin</description>
<filename>../../ext/gl/.libs/libgstopengl.so</filename>
<basename>libgstopengl.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......@@ -20,13 +20,13 @@
<name>sink</name>
<direction>sink</direction>
<presence>always</presence>
<details>video/x-raw(ANY), format=(string)RGBA, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], texture-target=(string)2D; video/x-raw(memory:GLMemory), format=(string)RGBA, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], texture-target=(string)2D</details>
<details>video/x-raw(memory:GLMemory), format=(string)RGBA, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], texture-target=(string){ 2D, external-oes }; video/x-raw(memory:GLMemory, meta:GstVideoOverlayComposition), format=(string)RGBA, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], texture-target=(string){ 2D, external-oes }</details>
</caps>
<caps>
<name>src</name>
<direction>source</direction>
<presence>always</presence>
<details>video/x-raw(memory:GLMemory), format=(string)RGBA, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], texture-target=(string)2D; video/x-raw(ANY), format=(string)RGBA, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], texture-target=(string)2D</details>
<details>video/x-raw(memory:GLMemory), format=(string)RGBA, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], texture-target=(string){ 2D, external-oes }; video/x-raw(memory:GLMemory, meta:GstVideoOverlayComposition), format=(string)RGBA, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], texture-target=(string){ 2D, external-oes }</details>
</caps>
</pads>
</element>
......
......@@ -3,7 +3,7 @@
<description>OPUS plugin library</description>
<filename>../../ext/opus/.libs/libgstopus.so</filename>
<basename>libgstopus.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Pango-based text rendering and overlay</description>
<filename>../../ext/pango/.libs/libgstpango.so</filename>
<basename>libgstpango.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>gst-plugins-base dynamic types</description>
<filename>../../gst/pbtypes/.libs/libgstpbtypes.so</filename>
<basename>libgstpbtypes.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>various playback elements</description>
<filename>../../gst/playback/.libs/libgstplayback.so</filename>
<basename>libgstplayback.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Parses byte streams into raw frames</description>
<filename>../../gst/rawparse/.libs/libgstrawparse.so</filename>
<basename>libgstrawparse.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Subtitle parsing</description>
<filename>../../gst/subparse/.libs/libgstsubparse.so</filename>
<basename>libgstsubparse.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>transfer data over the network via TCP</description>
<filename>../../gst/tcp/.libs/libgsttcp.so</filename>
<basename>libgsttcp.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Theora plugin library</description>
<filename>../../ext/theora/.libs/libgsttheora.so</filename>
<basename>libgsttheora.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>default typefind functions</description>
<filename>../../gst/typefind/.libs/libgsttypefindfunctions.so</filename>
<basename>libgsttypefindfunctions.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Colorspace conversion</description>
<filename>../../gst/videoconvert/.libs/libgstvideoconvert.so</filename>
<basename>libgstvideoconvert.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Adjusts video frames</description>
<filename>../../gst/videorate/.libs/libgstvideorate.so</filename>
<basename>libgstvideorate.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Resizes video</description>
<filename>../../gst/videoscale/.libs/libgstvideoscale.so</filename>
<basename>libgstvideoscale.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Creates a test video stream</description>
<filename>../../gst/videotestsrc/.libs/libgstvideotestsrc.so</filename>
<basename>libgstvideotestsrc.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>plugin for controlling audio volume</description>
<filename>../../gst/volume/.libs/libgstvolume.so</filename>
<basename>libgstvolume.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>Vorbis plugin library</description>
<filename>../../ext/vorbis/.libs/libgstvorbis.so</filename>
<basename>libgstvorbis.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>X11 video output element based on standard Xlib calls</description>
<filename>../../sys/ximage/.libs/libgstximagesink.so</filename>
<basename>libgstximagesink.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -3,7 +3,7 @@
<description>XFree86 video output plugin using Xv extension</description>
<filename>../../sys/xvimage/.libs/libgstxvimagesink.so</filename>
<basename>libgstxvimagesink.so</basename>
<version>1.14.0</version>
<version>1.14.5</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
......
......@@ -459,6 +459,7 @@ poll:
if (ret <= 0) {
if (ret < 0 && errno == EBUSY) {
GST_INFO_OBJECT (alsamidisrc, "flushing");
gst_buffer_list_unref (buffer_list);
return GST_FLOW_FLUSHING;
}
GST_ERROR_OBJECT (alsamidisrc, "ERROR in poll: %s", strerror (errno));
......
......@@ -5,6 +5,8 @@ plugin_LTLIBRARIES = libgstopengl.la
# gstglbasemixer.h
# gstglmixer.c
# gstglmixer.h
# gstglmixerbin.h
# gstglmixerbin.c
# gstglstereomix.c
# gstglstereomix.h
# gstglvideomixer.c
......@@ -16,7 +18,6 @@ libgstopengl_la_SOURCES = \
gstgldownloadelement.c \
gstglcolorconvertelement.c \
gstglfilterbin.c \
gstglmixerbin.c \
gstglsinkbin.c \
gstglsrcbin.c \
gstglimagesink.c \
......@@ -57,7 +58,6 @@ noinst_HEADERS = \
gstgldownloadelement.h \
gstglcolorconvertelement.h \
gstglfilterbin.h \
gstglmixerbin.h \
gstglsinkbin.h \
gstglsrcbin.h \
gstglimagesink.h \
......
......@@ -54,17 +54,55 @@ GST_DEBUG_CATEGORY_STATIC (glcolorbalance_debug);
#define DEFAULT_PROP_HUE 0.0
#define DEFAULT_PROP_SATURATION 1.0
#define GST_GL_COLOR_BALANCE_VIDEO_CAPS \
"video/x-raw(" GST_CAPS_FEATURE_MEMORY_GL_MEMORY "), " \
"format = (string) RGBA, " \
"width = " GST_VIDEO_SIZE_RANGE ", " \
"height = " GST_VIDEO_SIZE_RANGE ", " \
"framerate = " GST_VIDEO_FPS_RANGE ", " \
"texture-target = (string) { 2D, external-oes } " \
" ; " \
"video/x-raw(" GST_CAPS_FEATURE_MEMORY_GL_MEMORY "," \
GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION "), " \
"format = (string) RGBA, " \
"width = " GST_VIDEO_SIZE_RANGE ", " \
"height = " GST_VIDEO_SIZE_RANGE ", " \
"framerate = " GST_VIDEO_FPS_RANGE ", " \
"texture-target = (string) { 2D, external-oes }"
static GstStaticPadTemplate gst_gl_color_balance_element_src_pad_template =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_GL_COLOR_BALANCE_VIDEO_CAPS));
static GstStaticPadTemplate gst_gl_color_balance_element_sink_pad_template =
GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_GL_COLOR_BALANCE_VIDEO_CAPS));
/* *INDENT-OFF* */
static const gchar *color_balance_frag =
static const gchar color_balance_frag_OES_preamble[] =
"#extension GL_OES_EGL_image_external : require\n"
"#ifdef GL_ES\n"
"precision mediump float;\n"
"#endif\n"
"uniform samplerExternalOES tex;\n";
static const gchar color_balance_frag_2D_preamble[] =
"#ifdef GL_ES\n"
"precision mediump float;\n"
"#endif\n"
"uniform sampler2D tex;\n";
static const gchar color_balance_frag_templ[] =
"%s\n" // Preamble
"uniform float brightness;\n"
"uniform float contrast;\n"
"uniform float saturation;\n"
"uniform float hue;\n"
"varying vec2 v_texcoord;\n"
"uniform sampler2D tex;\n"
"#define from_yuv_bt601_offset vec3(-0.0625, -0.5, -0.5)\n"
"#define from_yuv_bt601_rcoeff vec3(1.164, 0.000, 1.596)\n"
"#define from_yuv_bt601_gcoeff vec3(1.164,-0.391,-0.813)\n"
......@@ -105,7 +143,7 @@ static const gchar *color_balance_frag =
* blend-function-src-rgb=src-color and blend-function-dst-rgb=dst-color */
" float hue_cos = cos (PI * hue);\n"
" float hue_sin = sin (PI * hue);\n"
" vec4 rgba = texture2D (tex, v_texcoord);\n"
" vec4 rgba = %s (tex, v_texcoord);\n" /* texture2D / texture2DOES */
" yuv = rgb_to_yuv (rgba.rgb);\n"
" yuv.x = clamp (luma_to_narrow (luma_to_full(yuv.x) * contrast) + brightness, 0.0, 1.0);\n"
" vec2 uv = yuv.yz;\n"
......@@ -139,6 +177,28 @@ G_DEFINE_TYPE_WITH_CODE (GstGLColorBalance, gst_gl_color_balance,
G_IMPLEMENT_INTERFACE (GST_TYPE_COLOR_BALANCE,
gst_gl_color_balance_colorbalance_init));
static GstCaps *
gcb_transform_internal_caps (GstGLFilter * filter,
GstPadDirection direction, GstCaps * caps, GstCaps * filter_caps)
{
GstCaps *tmp = gst_caps_copy (caps);
gint i;
/* If we're not in passthrough mode, we can only output 2D textures,
* but can always receive any compatible texture.
* This function is not called in passthrough mode, so we can do the
* transform unconditionally */
for (i = 0; i < gst_caps_get_size (tmp); i++) {
GstStructure *outs = gst_caps_get_structure (tmp, i);
if (direction == GST_PAD_SINK) {
gst_structure_set (outs, "texture-target", G_TYPE_STRING,
gst_gl_texture_target_to_string (GST_GL_TEXTURE_TARGET_2D), NULL);
} else {
gst_structure_remove_field (outs, "texture-target");
}
}
return tmp;
}
static gboolean
gst_gl_color_balance_is_passthrough (GstGLColorBalance * glcolorbalance)
{
......@@ -169,22 +229,35 @@ _create_shader (GstGLColorBalance * balance)
GstGLBaseFilter *base_filter = GST_GL_BASE_FILTER (balance);
GstGLFilter *filter = GST_GL_FILTER (balance);
GError *error = NULL;
gchar *frag_str;
if (balance->shader)
gst_object_unref (balance->shader);
/* Can support rectangle textures in the future if needed */
if (filter->in_texture_target == GST_GL_TEXTURE_TARGET_2D)
frag_str =
g_strdup_printf (color_balance_frag_templ,
color_balance_frag_2D_preamble, "texture2D");
else
frag_str =
g_strdup_printf (color_balance_frag_templ,
color_balance_frag_OES_preamble, "texture2D");
if (!(balance->shader =
gst_gl_shader_new_link_with_stages (base_filter->context, &error,
gst_glsl_stage_new_default_vertex (base_filter->context),
gst_glsl_stage_new_with_string (base_filter->context,
GL_FRAGMENT_SHADER, GST_GLSL_VERSION_NONE,
GST_GLSL_PROFILE_ES | GST_GLSL_PROFILE_COMPATIBILITY,
color_balance_frag), NULL))) {
frag_str), NULL))) {
g_free (frag_str);
GST_ELEMENT_ERROR (balance, RESOURCE, NOT_FOUND, ("%s",
"Failed to initialize colorbalance shader"), ("%s",
error ? error->message : "Unknown error"));
return FALSE;
}
g_free (frag_str);
filter->draw_attr_position_loc =
gst_gl_shader_get_attribute_location (balance->shader, "a_position");
......@@ -292,7 +365,10 @@ gst_gl_color_balance_class_init (GstGLColorBalanceClass * klass)
GST_DEBUG_CATEGORY_INIT (glcolorbalance_debug, "glcolorbalance", 0,
"glcolorbalance");
gst_gl_filter_add_rgba_pad_templates (GST_GL_FILTER_CLASS (klass));
gst_element_class_add_static_pad_template (gstelement_class,
&gst_gl_color_balance_element_src_pad_template);
gst_element_class_add_static_pad_template (gstelement_class,
&gst_gl_color_balance_element_sink_pad_template);
gobject_class->finalize = gst_gl_color_balance_finalize;
gobject_class->set_property = gst_gl_color_balance_set_property;
......@@ -329,6 +405,7 @@ gst_gl_color_balance_class_init (GstGLColorBalanceClass * klass)
filter_class->filter_texture =
GST_DEBUG_FUNCPTR (gst_gl_color_balance_filter_texture);
filter_class->transform_internal_caps = gcb_transform_internal_caps;
}
static void
......
......@@ -170,7 +170,7 @@ gst_gl_colorscale_gl_stop (GstGLBaseFilter * base_filter)
colorscale->shader = NULL;
}
return GST_GL_BASE_FILTER_CLASS (parent_class)->gl_stop (base_filter);
GST_GL_BASE_FILTER_CLASS (parent_class)->gl_stop (base_filter);
}
static gboolean
......
......@@ -62,6 +62,8 @@ static void gst_gl_deinterlace_get_property (GObject * object,
static gboolean gst_gl_deinterlace_start (GstBaseTransform * trans);
static gboolean gst_gl_deinterlace_reset (GstBaseTransform * trans);
static GstCaps *gst_gl_deinterlace_transform_internal_caps (GstGLFilter * filter,
GstPadDirection direction, GstCaps * caps, GstCaps * caps_filter);
static gboolean gst_gl_deinterlace_init_fbo (GstGLFilter * filter);
static gboolean gst_gl_deinterlace_filter (GstGLFilter * filter,
GstBuffer * inbuf, GstBuffer * outbuf);
......@@ -264,6 +266,8 @@ gst_gl_deinterlace_class_init (GstGLDeinterlaceClass * klass)
GST_BASE_TRANSFORM_CLASS (klass)->start = gst_gl_deinterlace_start;
GST_BASE_TRANSFORM_CLASS (klass)->stop = gst_gl_deinterlace_reset;
GST_GL_FILTER_CLASS (klass)->transform_internal_caps =
gst_gl_deinterlace_transform_internal_caps;
GST_GL_FILTER_CLASS (klass)->filter = gst_gl_deinterlace_filter;
GST_GL_FILTER_CLASS (klass)->filter_texture =
gst_gl_deinterlace_filter_texture;
......@@ -327,6 +331,26 @@ gst_gl_deinterlace_reset (GstBaseTransform * trans)
return GST_BASE_TRANSFORM_CLASS (parent_class)->stop (trans);
}
static GstCaps *
gst_gl_deinterlace_transform_internal_caps (GstGLFilter * filter,
GstPadDirection direction, GstCaps * caps, GstCaps * caps_filter)
{
gint len;
GstCaps *res;
GstStructure *s;
res = gst_caps_copy (caps);
for (len = gst_caps_get_size (res); len > 0; len--) {
s = gst_caps_get_structure (res, len - 1);
if (direction == GST_PAD_SINK) {
gst_structure_remove_field (s, "interlace-mode");
}
}
return res;
}
static void
gst_gl_deinterlace_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
......
......@@ -54,14 +54,18 @@ static gboolean gst_gl_download_element_decide_allocation (GstBaseTransform *
trans, GstQuery * query);
static void gst_gl_download_element_finalize (GObject * object);
#if GST_GL_HAVE_PLATFORM_EGL && GST_GL_HAVE_DMABUF
#define EXTRA_CAPS_TEMPLATE "video/x-raw(" GST_CAPS_FEATURE_MEMORY_DMABUF "); "
#else
#define EXTRA_CAPS_TEMPLATE
#endif
static GstStaticPadTemplate gst_gl_download_element_src_pad_template =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (
#if GST_GL_HAVE_PLATFORM_EGL && GST_GL_HAVE_DMABUF
"video/x-raw(" GST_CAPS_FEATURE_MEMORY_DMABUF "); "
#endif
EXTRA_CAPS_TEMPLATE
"video/x-raw; video/x-raw(memory:GLMemory)"));
static GstStaticPadTemplate gst_gl_download_element_sink_pad_template =
......
......@@ -173,7 +173,7 @@ _connect_filter_element (GstGLFilterBin * self)
}
/*
* @filter: (transfer full):
* @filter: (transfer floating):
*/
static gboolean
gst_gl_filter_bin_set_filter (GstGLFilterBin * self, GstElement * filter)
......@@ -189,10 +189,10 @@ gst_gl_filter_bin_set_filter (GstGLFilterBin * self, GstElement * filter)
}
self->filter = filter;
if (filter && g_object_is_floating (filter))
gst_object_ref_sink (filter);
gst_object_ref_sink (filter);
if (filter && !_connect_filter_element (self)) {
gst_object_unref (self->filter);
self->filter = NULL;
return FALSE;
}
......@@ -204,8 +204,7 @@ void
gst_gl_filter_bin_finish_init_with_element (GstGLFilterBin * self,
GstElement * element)
{
if (!gst_gl_filter_bin_set_filter (self, element))
gst_object_unref (element);
gst_gl_filter_bin_set_filter (self, element);
}
void
......
......@@ -893,8 +893,7 @@ gst_glimage_sink_get_property (GObject * object, guint prop_id,
g_value_set_enum (value, glimage_sink->mview_downmix_mode);
break;
default:
if (!gst_video_overlay_set_property (object, PROP_LAST, prop_id, value))
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
......@@ -1378,6 +1377,19 @@ configure_display_from_info (GstGLImageSink * glimage_sink,
return TRUE;
}
static gboolean
_mview_modes_are_equal (GstVideoMultiviewMode a, GstVideoMultiviewMode b)
{
if (a == b)
return TRUE;
if (a == GST_VIDEO_MULTIVIEW_MODE_NONE && b == GST_VIDEO_MULTIVIEW_MODE_MONO)
return TRUE;
if (a == GST_VIDEO_MULTIVIEW_MODE_MONO && b == GST_VIDEO_MULTIVIEW_MODE_NONE)
return TRUE;
return FALSE;
}
/* Called with GST_GLIMAGE_SINK lock held, to
* copy in_info to out_info and update out_caps */
static gboolean
......@@ -1397,7 +1409,7 @@ update_output_format (GstGLImageSink * glimage_sink)
mv_mode = GST_VIDEO_INFO_MULTIVIEW_MODE (&glimage_sink->in_info);
if (glimage_sink->mview_output_mode != mv_mode) {
if (!_mview_modes_are_equal (glimage_sink->mview_output_mode, mv_mode)) {
/* Input is multiview, and output wants a conversion - configure 3d converter now,
* otherwise defer it until either the caps or the 3D output mode changes */
gst_video_multiview_video_info_change_mode (out_info,
......@@ -1426,27 +1438,29 @@ update_output_format (GstGLImageSink * glimage_sink)
* view parity properly for line-by-line modes, because that
* depends on the window being placed correctly.
* FIXME: Should this rescaling be configurable? */
new_w = MAX (1, glimage_sink->display_rect.w);
new_h = MAX (1, glimage_sink->display_rect.h);
if (new_w != out_info->width || new_h != out_info->height) {
/* Recalculate PAR if rescaling */
gint from_dar_n, from_dar_d;
if (!gst_util_fraction_multiply (out_info->width, out_info->height,
out_info->par_n, out_info->par_d, &from_dar_n,
&from_dar_d) ||
!gst_util_fraction_multiply (from_dar_n, from_dar_d, new_h, new_w,
&par_n, &par_d)) {
par_n = glimage_sink->par_n;
par_d = glimage_sink->par_d;
if (glimage_sink->display_rect.w > 0 && glimage_sink->display_rect.h > 0) {
new_w = glimage_sink->display_rect.w;
new_h = glimage_sink->display_rect.h;
if (new_w != out_info->width || new_h != out_info->height) {
/* Recalculate PAR if rescaling */
gint from_dar_n, from_dar_d;
if (!gst_util_fraction_multiply (out_info->width, out_info->height,
out_info->par_n, out_info->par_d, &from_dar_n,
&from_dar_d) ||
!gst_util_fraction_multiply (from_dar_n, from_dar_d, new_h, new_w,
&par_n, &par_d)) {
par_n = glimage_sink->par_n;
par_d = glimage_sink->par_d;
}
out_info->par_n = par_n;
out_info->par_d = par_d;
out_info->width = new_w;
out_info->height = new_h;
}
out_info->par_n = par_n;
out_info->par_d = par_d;
out_info->width = new_w;
out_info->height = new_h;
}
GST_LOG_OBJECT (glimage_sink, "Set 3D output scale to %d,%d PAR %d/%d",
out_info->width, out_info->height, out_info->par_n, out_info->par_d);
GST_LOG_OBJECT (glimage_sink, "Set 3D output scale to %dx%d PAR %d/%d",
out_info->width, out_info->height, out_info->par_n, out_info->par_d);
}
}
s = gst_caps_get_structure (glimage_sink->in_caps, 0);
......
......@@ -399,7 +399,7 @@ _connect_mixer_element (GstGLMixerBin * self)
}
/*
* @mixer: (transfer full):
* @mixer: (transfer floating):
*/
static gboolean
gst_gl_mixer_bin_set_mixer (GstGLMixerBin * self, GstElement * mixer)
......@@ -415,10 +415,10 @@ gst_gl_mixer_bin_set_mixer (GstGLMixerBin * self, GstElement * mixer)
}
self->mixer = mixer;
if (mixer && g_object_is_floating (mixer))
gst_object_ref_sink (mixer);
gst_object_ref_sink (mixer);
if (mixer && !_connect_mixer_element (self)) {
gst_object_unref (self->mixer);
self->mixer = NULL;
return FALSE;
}
......@@ -430,8 +430,7 @@ void
gst_gl_mixer_bin_finish_init_with_element (GstGLMixerBin * self,
GstElement * element)
{
if (!gst_gl_mixer_bin_set_mixer (self, element))
gst_object_unref (element);
gst_gl_mixer_bin_set_mixer (self, element);
}
void
......
......@@ -307,10 +307,10 @@ gst_gl_sink_bin_set_sink (GstGLSinkBin * self, GstElement * sink)
}
self->sink = sink;
if (sink && g_object_is_floating (sink))
gst_object_ref_sink (sink);
gst_object_ref_sink (sink);
if (sink && !_connect_sink_element (self)) {
gst_object_unref (self->sink);
self->sink = NULL;
return FALSE;
}
......@@ -322,8 +322,7 @@ void
gst_gl_sink_bin_finish_init_with_element (GstGLSinkBin * self,
GstElement * element)
{
if (!gst_gl_sink_bin_set_sink (self, element))
gst_object_unref (element);
gst_gl_sink_bin_set_sink (self, element);
}
void
......@@ -344,6 +343,7 @@ gst_gl_sink_bin_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstGLSinkBin *self = GST_GL_SINK_BIN (object);
GParamSpec *sink_pspec;
switch (prop_id) {
case PROP_SINK:
......@@ -357,8 +357,17 @@ gst_gl_sink_bin_set_property (GObject * object, guint prop_id,
g_object_set_property (G_OBJECT (self->balance), pspec->name, value);
break;
default:
if (self->sink)
g_object_set_property (G_OBJECT (self->sink), pspec->name, value);
if (self->sink) {
sink_pspec =
g_object_class_find_property (G_OBJECT_GET_CLASS (self->sink),
pspec->name);
if (sink_pspec
&& G_PARAM_SPEC_TYPE (sink_pspec) == G_PARAM_SPEC_TYPE (pspec)) {
g_object_set_property (G_OBJECT (self->sink), pspec->name, value);
} else {
GST_INFO ("Failed to set unmatched property %s", pspec->name);
}
}
break;
}
}
......
......@@ -165,7 +165,7 @@ _connect_src_element (GstGLSrcBin * self)
}
/*
* @src: (transfer full):
* @src: (transfer floating):
*/
static gboolean
gst_gl_src_bin_set_src (GstGLSrcBin * self, GstElement * src)
......@@ -181,10 +181,10 @@ gst_gl_src_bin_set_src (GstGLSrcBin * self, GstElement * src)
}
self->src = src;
if (src && g_object_is_floating (src))
gst_object_ref_sink (src);
gst_object_ref_sink (src);
if (src && !_connect_src_element (self)) {
gst_object_unref (self->src);
self->src = NULL;
return FALSE;
}
......@@ -196,8 +196,7 @@ void
gst_gl_src_bin_finish_init_with_element (GstGLSrcBin * self,
GstElement * element)
{
if (!gst_gl_src_bin_set_src (self, element))
gst_object_unref (self->src);
gst_gl_src_bin_set_src (self, element);
}
void
......
......@@ -510,11 +510,6 @@ gst_gl_test_src_start (GstBaseSrc * basesrc)
{
GstGLTestSrc *src = GST_GL_TEST_SRC (basesrc);
if (!gst_gl_ensure_element_data (src, &src->display, &src->other_context))
return FALSE;
gst_gl_display_filter_gl_api (src->display, SUPPORTED_GL_APIS);
src->running_time = 0;
src->n_frames = 0;
src->negotiated = FALSE;
......@@ -735,18 +730,6 @@ gst_gl_test_src_change_state (GstElement * element, GstStateChange transition)
gst_element_state_get_name (GST_STATE_TRANSITION_CURRENT (transition)),
gst_element_state_get_name (GST_STATE_TRANSITION_NEXT (transition)));
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
if (!gst_gl_ensure_element_data (element, &src->display,
&src->other_context))
return GST_STATE_CHANGE_FAILURE;
gst_gl_display_filter_gl_api (src->display, SUPPORTED_GL_APIS);
break;
default:
break;
}
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
if (ret == GST_STATE_CHANGE_FAILURE)
return ret;
......
......@@ -103,7 +103,7 @@ if build_gstgl and gstgl_dep.found()
optional_deps += bcm_host_dep
endif
if egl_dep.found() and cc.has_header('libdrm/drm_fourcc.h', required : false)
if egl_dep.found() and cc.has_header('libdrm/drm_fourcc.h')
optional_deps += allocators_dep
endif
......
......@@ -252,6 +252,19 @@ gst_ogg_pad_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
ogg = GST_OGG_DEMUX (parent);
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_POSITION:
{
GstFormat format;
GstOggPad *ogg_pad = GST_OGG_PAD (pad);
gst_query_parse_position (query, &format, NULL);
/* can only get position in time */
if (format != GST_FORMAT_TIME)
goto wrong_format;
gst_query_set_position (query, format, ogg_pad->position);
break;
}
case GST_QUERY_DURATION:
{
GstFormat format;
......@@ -385,7 +398,7 @@ done:
/* ERRORS */
wrong_format:
{
GST_DEBUG_OBJECT (ogg, "only query duration on TIME is supported");
GST_DEBUG_OBJECT (ogg, "only query position/duration on TIME is supported");
res = FALSE;
goto done;
}
......
This diff is collapsed.
......@@ -877,12 +877,12 @@ gst_opus_enc_get_sink_template_caps (void)
* treated as a set of individual mono channels */
s = gst_structure_copy (s2);
gst_structure_set (s, "channels", G_TYPE_INT, i, "channel-mask",
GST_TYPE_BITMASK, 0x0, NULL);
GST_TYPE_BITMASK, G_GUINT64_CONSTANT(0), NULL);
gst_caps_append_structure (caps, s);
s = gst_structure_copy (s1);
gst_structure_set (s, "channels", G_TYPE_INT, i, "channel-mask",
GST_TYPE_BITMASK, 0x0, NULL);
GST_TYPE_BITMASK, G_GUINT64_CONSTANT(0), NULL);
gst_caps_append_structure (caps, s);
}
......
......@@ -358,6 +358,7 @@ header_read_error:
}
}
/* Does not take ownership of buffer */
static GstFlowReturn
vorbis_dec_handle_header_buffer (GstVorbisDec * vd, GstBuffer * buffer)
{
......@@ -399,6 +400,14 @@ vorbis_dec_handle_header_caps (GstVorbisDec * vd)
GstBuffer *buf = NULL;
gint i = 0;
if (vd->pending_headers) {
GST_DEBUG_OBJECT (vd,
"got new headers from caps, discarding old pending headers");
g_list_free_full (vd->pending_headers, (GDestroyNotify) gst_buffer_unref);
vd->pending_headers = NULL;
}
while (result == GST_FLOW_OK && i < gst_value_array_get_size (array)) {
value = gst_value_array_get_value (array, i);
buf = gst_value_get_buffer (value);
......@@ -607,17 +616,20 @@ check_pending_headers (GstVorbisDec * vd)
/* All good, let's reset ourselves and process the headers */
vorbis_dec_reset ((GstAudioDecoder *) vd);
result = vorbis_dec_handle_header_buffer (vd, buffer1);
gst_buffer_unref (buffer1);
if (result != GST_FLOW_OK) {
gst_buffer_unref (buffer3);
gst_buffer_unref (buffer5);
return result;
}
result = vorbis_dec_handle_header_buffer (vd, buffer3);
gst_buffer_unref (buffer3);
if (result != GST_FLOW_OK) {
gst_buffer_unref (buffer5);
return result;
}
result = vorbis_dec_handle_header_buffer (vd, buffer5);
gst_buffer_unref (buffer5);
return result;
......@@ -672,21 +684,42 @@ vorbis_dec_handle_frame (GstAudioDecoder * dec, GstBuffer * buffer)
/* switch depending on packet type */
if ((gst_ogg_packet_data (packet))[0] & 1) {
/* If we get a new initialization packet after being initialized,
* store it.
* When the next non-header buffer comes in, we will check whether
* those pending headers are correct and if so reset ourselves */
if (vd->initialized) {
GST_LOG_OBJECT (vd, "storing header for later analyzis");
gboolean have_all_headers;
GST_LOG_OBJECT (vd, "storing header for later analyzis");
/* An identification packet starts a new set of headers */
if (vd->pending_headers && (gst_ogg_packet_data (packet))[0] == 0x01) {
GST_DEBUG_OBJECT (vd,
"got new identification header packet, discarding old pending headers");
g_list_free_full (vd->pending_headers, (GDestroyNotify) gst_buffer_unref);
vd->pending_headers = NULL;
}
/* if we have more than 3 headers with the new one and the new one is the
* type header, we can initialize the decoder now */
have_all_headers = g_list_length (vd->pending_headers) >= 2
&& (gst_ogg_packet_data (packet))[0] == 0x05;
if (!vd->pending_headers && (gst_ogg_packet_data (packet))[0] != 0x01) {
if (vd->initialized) {
GST_DEBUG_OBJECT (vd,
"Got another non-identification header after initialization, ignoring");
} else {
GST_WARNING_OBJECT (vd,
"First header was not a identification header, dropping");
}
result = gst_audio_decoder_finish_frame (GST_AUDIO_DECODER (vd), NULL, 1);
} else {
vd->pending_headers =
g_list_append (vd->pending_headers, gst_buffer_ref (buffer));
goto done;
result = gst_audio_decoder_finish_frame (GST_AUDIO_DECODER (vd), NULL, 1);
}
if (result == GST_FLOW_OK && have_all_headers) {
result = check_pending_headers (vd);
}
result = vorbis_handle_header_packet (vd, packet);
if (result != GST_FLOW_OK)
goto done;
/* consumer header packet/frame */
result = gst_audio_decoder_finish_frame (GST_AUDIO_DECODER (vd), NULL, 1);
} else {
GstClockTime timestamp, duration;
......
......@@ -907,7 +907,7 @@ gst_vorbis_enc_handle_frame (GstAudioEncoder * enc, GstBuffer * buffer)
if (!buffer)
return gst_vorbis_enc_clear (vorbisenc);
gst_buffer_map (buffer, &map, GST_MAP_WRITE);
gst_buffer_map (buffer, &map, GST_MAP_READ);
/* data to encode */
size = map.size / (vorbisenc->channels * sizeof (float));
......
......@@ -37,7 +37,7 @@ argn = 1
for arg in sys.argv[1:]:
cmd.append(arg)
argn += 1
if arg.endswith('glib-mkenums'):
if os.path.splitext(arg)[0].endswith('glib-mkenums'):
break
ofilename = sys.argv[argn]
headers = sys.argv[argn + 1:]
......
......@@ -75,9 +75,9 @@
typedef enum
{
NOONE_WAITING,
STREAM_WAITING, /* streaming thread is waiting for application thread */
APP_WAITING, /* application thread is waiting for streaming thread */
NOONE_WAITING = 0,
STREAM_WAITING = 1 << 0, /* streaming thread is waiting for application thread */
APP_WAITING = 1 << 1, /* application thread is waiting for streaming thread */
} GstAppSinkWaitStatus;
struct _GstAppSinkPrivate
......@@ -719,9 +719,23 @@ gst_app_sink_event (GstBaseSink * sink, GstEvent * event)
* consumed, which is a bit confusing for the application
*/
while (priv->num_buffers > 0 && !priv->flushing && priv->wait_on_eos) {
priv->wait_status = STREAM_WAITING;
if (priv->unlock) {
/* we are asked to unlock, call the wait_preroll method */
g_mutex_unlock (&priv->mutex);
if (gst_base_sink_wait_preroll (sink) != GST_FLOW_OK) {
/* Directly go out of here */
gst_event_unref (event);
return FALSE;
}
/* we are allowed to continue now */
g_mutex_lock (&priv->mutex);
continue;
}
priv->wait_status |= STREAM_WAITING;
g_cond_wait (&priv->cond, &priv->mutex);
priv->wait_status = NOONE_WAITING;
priv->wait_status &= ~STREAM_WAITING;
}
if (priv->flushing)
emit = FALSE;
......@@ -769,7 +783,7 @@ gst_app_sink_preroll (GstBaseSink * psink, GstBuffer * buffer)
GST_DEBUG_OBJECT (appsink, "setting preroll buffer %p", buffer);
gst_buffer_replace (&priv->preroll_buffer, buffer);
if (priv->wait_status == APP_WAITING)
if ((priv->wait_status & APP_WAITING))
g_cond_signal (&priv->cond);
emit = priv->emit_signals;
......@@ -885,9 +899,9 @@ restart:
}
/* wait for a buffer to be removed or flush */
priv->wait_status = STREAM_WAITING;
priv->wait_status |= STREAM_WAITING;
g_cond_wait (&priv->cond, &priv->mutex);
priv->wait_status = NOONE_WAITING;
priv->wait_status &= ~STREAM_WAITING;
if (priv->flushing)
goto flushing;
......@@ -897,7 +911,7 @@ restart:
gst_queue_array_push_tail (priv->queue, gst_mini_object_ref (data));
priv->num_buffers++;
if (priv->wait_status == APP_WAITING)
if ((priv->wait_status & APP_WAITING))
g_cond_signal (&priv->cond);
emit = priv->emit_signals;
......@@ -995,9 +1009,25 @@ gst_app_sink_query (GstBaseSink * bsink, GstQuery * query)
g_mutex_lock (&priv->mutex);
GST_DEBUG_OBJECT (appsink, "waiting buffers to be consumed");
while (priv->num_buffers > 0 || priv->preroll_buffer) {
priv->wait_status = STREAM_WAITING;
if (priv->unlock) {
/* we are asked to unlock, call the wait_preroll method */
g_mutex_unlock (&priv->mutex);
if (gst_base_sink_wait_preroll (bsink) != GST_FLOW_OK) {
/* Directly go out of here */
return FALSE;
}
/* we are allowed to continue now */
g_mutex_lock (&priv->mutex);
continue;
}
priv->wait_status |= STREAM_WAITING;
g_cond_wait (&priv->cond, &priv->mutex);
priv->wait_status = NOONE_WAITING;
priv->wait_status &= ~STREAM_WAITING;
if (priv->flushing)
break;
}
g_mutex_unlock (&priv->mutex);
ret = GST_BASE_SINK_CLASS (parent_class)->query (bsink, query);
......@@ -1511,14 +1541,14 @@ gst_app_sink_try_pull_preroll (GstAppSink * appsink, GstClockTime timeout)
/* nothing to return, wait */
GST_DEBUG_OBJECT (appsink, "waiting for the preroll buffer");
priv->wait_status = APP_WAITING;
priv->wait_status |= APP_WAITING;
if (timeout_valid) {
if (!g_cond_wait_until (&priv->cond, &priv->mutex, end_time))
goto expired;
} else {
g_cond_wait (&priv->cond, &priv->mutex);
}
priv->wait_status = NOONE_WAITING;
priv->wait_status &= ~APP_WAITING;
}
sample =
gst_sample_new (priv->preroll_buffer, priv->preroll_caps,
......@@ -1533,7 +1563,7 @@ gst_app_sink_try_pull_preroll (GstAppSink * appsink, GstClockTime timeout)
expired:
{
GST_DEBUG_OBJECT (appsink, "timeout expired, return NULL");
priv->wait_status = NOONE_WAITING;
priv->wait_status &= ~APP_WAITING;
g_mutex_unlock (&priv->mutex);
return NULL;
}
......@@ -1609,14 +1639,14 @@ gst_app_sink_try_pull_sample (GstAppSink * appsink, GstClockTime timeout)
/* nothing to return, wait */
GST_DEBUG_OBJECT (appsink, "waiting for a buffer");
priv->wait_status = APP_WAITING;
priv->wait_status |= APP_WAITING;
if (timeout_valid) {
if (!g_cond_wait_until (&priv->cond, &priv->mutex, end_time))
goto expired;
} else {
g_cond_wait (&priv->cond, &priv->mutex);
}
priv->wait_status = NOONE_WAITING;
priv->wait_status &= ~APP_WAITING;
}
obj = dequeue_buffer (appsink);
......@@ -1631,7 +1661,7 @@ gst_app_sink_try_pull_sample (GstAppSink * appsink, GstClockTime timeout)
}
gst_mini_object_unref (obj);
if (priv->wait_status == STREAM_WAITING)
if ((priv->wait_status & STREAM_WAITING))
g_cond_signal (&priv->cond);