platform/upstream/gstreamer.git
6 years agominiobject: add gst_clear_mini_object()
Niels De Graef [Sat, 3 Nov 2018 19:00:57 +0000 (20:00 +0100)]
miniobject: add gst_clear_mini_object()

This is based on g_clear_object(). Basically, you can use this instead
of using gst_mini_object_unref (which needs to be preceded by a NULL-check).

Also fixes #275

6 years agoobject: add gst_clear_object()
Niels De Graef [Thu, 8 Feb 2018 16:31:15 +0000 (17:31 +0100)]
object: add gst_clear_object()

This is based on g_clear_object(). Basically, you can use this instead
of using g_object_unref (which needs to be preceded by a NULL-check).

Fixes #275

6 years agoClone the code from gitlab
Haihao Xiang [Mon, 5 Nov 2018 03:07:14 +0000 (11:07 +0800)]
Clone the code from gitlab

This fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/326

6 years agotypefind: Always forward RECONFIGURE events upstream
Sebastian Dröge [Sun, 4 Nov 2018 10:45:57 +0000 (12:45 +0200)]
typefind: Always forward RECONFIGURE events upstream

Based on a patch by Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/67

6 years agoclock: Move clock weak ref into its own ABI struct
Sebastian Dröge [Sat, 3 Nov 2018 16:44:48 +0000 (18:44 +0200)]
clock: Move clock weak ref into its own ABI struct

Otherwise it will be hard to add other things into the padding later
without breaking API.

6 years agoclock: Add new functions to the documentation
Sebastian Dröge [Sat, 3 Nov 2018 16:29:17 +0000 (18:29 +0200)]
clock: Add new functions to the documentation

6 years agoclock: Fix deprecation handling of the GstClock clock field
Sebastian Dröge [Sat, 3 Nov 2018 16:29:03 +0000 (18:29 +0200)]
clock: Fix deprecation handling of the GstClock clock field

6 years agoclock: Keep weak reference to underlying clock
Thomas Bluemel [Thu, 8 Sep 2016 14:49:54 +0000 (08:49 -0600)]
clock: Keep weak reference to underlying clock

Fixes potential segmentation fault when using a GstClockID that
is referencing an already freed GstClock

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/187

6 years agogst-inspect: Don't page if output fits the screen
Zeeshan Ali [Tue, 30 Oct 2018 14:30:38 +0000 (15:30 +0100)]
gst-inspect: Don't page if output fits the screen

6 years agogst-inspect: Flush stdout before closing stdout FD
Zeeshan Ali [Tue, 30 Oct 2018 13:52:15 +0000 (14:52 +0100)]
gst-inspect: Flush stdout before closing stdout FD

Otherwise, last line can be lost.

6 years agoharness: Add API for proposing meta APIs from the allocation query
Sebastian Dröge [Sun, 28 Oct 2018 15:19:38 +0000 (15:19 +0000)]
harness: Add API for proposing meta APIs from the allocation query

https://bugzilla.gnome.org/show_bug.cgi?id=797350

6 years agosegment: Allow stop == -1 in gst_segment_to_running_time() and rate < 0
Jan Schmidt [Thu, 20 Sep 2018 13:17:52 +0000 (23:17 +1000)]
segment: Allow stop == -1 in gst_segment_to_running_time() and rate < 0

If a segment has stop == -1, then gst_segment_to_running_time()
would refuse to calculate a running time for negative rates,
but gst_segment_do_seek() allows this scenario and uses a
valid duration for calculations.

Make the 2 functions consistent by using any configured duration
to calculate a running time too in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=796559

6 years agogst-inspect: Pipe stdout to less if not piped already
Zeeshan Ali [Sat, 27 Oct 2018 12:38:57 +0000 (13:38 +0100)]
gst-inspect: Pipe stdout to less if not piped already

https://bugzilla.gnome.org/show_bug.cgi?id=797344

6 years agotypefind: Lower debug level of some output related to the URI query
Sebastian Dröge [Fri, 26 Oct 2018 08:21:42 +0000 (09:21 +0100)]
typefind: Lower debug level of some output related to the URI query

It's not a warning if an URI doesn't have an extension, and it's also
not mandatory that sources have an URI or even answer the URI query.

6 years agogst: skip format specifiers from gir generation
Jordan Petridis [Tue, 16 Oct 2018 16:35:03 +0000 (19:35 +0300)]
gst: skip format specifiers from gir generation

GST_TIME_FORMAT, GST_TIME_ARGS, GST_STIME_FORMAT, GST_STIME_ARGS
GST_PTR_FORMAT, GST_SEGMENT_FORMAT, GST_FOURCC_FORMAT and
GST_FOURCC_ARGS are format specifiers.
They can't be used outside of C and should be generated in the gir.

https://bugzilla.gnome.org/show_bug.cgi?id=797320

6 years agogst/gsterror.h: skip GST_ERROR_SYSTEM during gir generation
Jordan Petridis [Tue, 16 Oct 2018 16:35:03 +0000 (19:35 +0300)]
gst/gsterror.h: skip GST_ERROR_SYSTEM during gir generation

GST_ERROR_SYSTEM can't really be used outside of C and should
be skipped.

https://bugzilla.gnome.org/show_bug.cgi?id=797320

6 years agomultiqueue: Don't clamp running times for position calculation
Edward Hervey [Mon, 22 Oct 2018 13:26:25 +0000 (15:26 +0200)]
multiqueue: Don't clamp running times for position calculation

Since we use full signed running times, we no longer need to clamp
the buffer time.

This avoids having the position of single queues not advancing for
buffers that are out of segment and never waking up non-linked
streams (resulting in an apparent "deadlock").

6 years agoqueue2: Reset result flow when retrying
Edward Hervey [Mon, 22 Oct 2018 11:45:52 +0000 (13:45 +0200)]
queue2: Reset result flow when retrying

If we ever get a GST_FLOW_EOS from downstream, we might retry
pushing new data. But if pushing that data doesn't return a
GstFlowReturn (such as pushing events), we would end up returning
the previous GstFlowReturn (i.e. EOS).

Not properly resetting it would cause cases where queue2 would
stop pushing on the first GstEvent stored (even if there is more
data contained within).

6 years agotests: Use GstTestClock for processing-deadline test
Olivier Crête [Wed, 17 Oct 2018 20:38:42 +0000 (16:38 -0400)]
tests: Use GstTestClock for processing-deadline test

Use the test clock instead of using a real one to make it
easier to run in valgrind.

https://bugzilla.gnome.org/show_bug.cgi?id=797291

6 years agotests: pipeline: fix leak
Tim-Philipp Müller [Tue, 16 Oct 2018 09:48:40 +0000 (10:48 +0100)]
tests: pipeline: fix leak

6 years agoqueuearray: Only clear dropped item if it is not returned
Sebastian Dröge [Mon, 15 Oct 2018 15:47:16 +0000 (18:47 +0300)]
queuearray: Only clear dropped item if it is not returned

6 years agoqueuearray: Clear items when dropping them and a clear function was defined
Sebastian Dröge [Mon, 15 Oct 2018 12:24:07 +0000 (15:24 +0300)]
queuearray: Clear items when dropping them and a clear function was defined

6 years agogstelementfactory: Remove MEDIA_HARDWARE FactoryType
Philippe Normand [Fri, 12 Oct 2018 14:34:45 +0000 (15:34 +0100)]
gstelementfactory: Remove MEDIA_HARDWARE FactoryType

Using the MEDIA_ classifier prefix was inappropriate. It is sufficient to
specify the additional klass name that element can set in their metadata.

(follow-up of commit ca4b61c55562a4b74f241fe54cf1e5639a2aea25)

https://bugzilla.gnome.org/show_bug.cgi?id=796921

6 years agogstelementfactory: Add MEDIA_HARDWARE klass classifier
Philippe Normand [Fri, 5 Oct 2018 10:19:46 +0000 (12:19 +0200)]
gstelementfactory: Add MEDIA_HARDWARE klass classifier

The Harware factory type classifier allows elements (decoders and encoders,
mostly) to advertize they rely on hardware devices to perform encoding or
decoding operations. This classifier can be used by applications to filter and
select only the elements that use hardware devices, for instance to ensure
zero-copy support is enabled for a specific pipeline.

https://bugzilla.gnome.org/show_bug.cgi?id=796921

6 years agogst-uninstalled: add libnice to LD_LIBRARY_PATH
Aleix Conchillo Flaqué [Wed, 10 Oct 2018 07:00:14 +0000 (00:00 -0700)]
gst-uninstalled: add libnice to LD_LIBRARY_PATH

https://bugzilla.gnome.org/show_bug.cgi?id=797269

6 years agoptp clock: Wait for ANNOUNCE before selecting a master
Jan Schmidt [Thu, 11 Oct 2018 03:34:40 +0000 (14:34 +1100)]
ptp clock: Wait for ANNOUNCE before selecting a master

Previously, with opportunistic sync we'd track a master
clock as soon as we see a SYNC message, and hence sync up
faster, but then we'd announce we're synched before seeing
the ANNOUNCE, leaving the clock details like grandmaster-clock
empty.

A better way is to start tracking the clock opportunistically,
but not announce we're synched until we've also seen the ANNOUNCE.

6 years agoptp clock: improve debug
Jan Schmidt [Thu, 11 Oct 2018 03:33:35 +0000 (14:33 +1100)]
ptp clock: improve debug

Log message arrival times. Fix a typo in one debug string

6 years agoptp clock: Increase tolerance for late follow-up and delay-resp
Jan Schmidt [Thu, 11 Oct 2018 03:29:47 +0000 (14:29 +1100)]
ptp clock: Increase tolerance for late follow-up and delay-resp

The follow-up and delay-resp messages carry precise
timestamps for the arrival at the clock master, but
the local return time is unimportant, so we should be very
lenient in accepting them late. Some PTP masters don't
prioritise sending those packets, and we reject all the
responses and never sync - or take forever to do so.

Increase the tolerance to 20x the mean path delay.

Also fix a typo in one debug output that would print
the absolute time of the delay-resp message, not the offset
from the delay-req that it's actually being compared against.

6 years agoptpclock: Add TRACE level debug output
Jan Schmidt [Mon, 17 Sep 2018 23:36:45 +0000 (09:36 +1000)]
ptpclock: Add TRACE level debug output

Add some debugging to be able to tell what is happening
inside the PTP clock protocol handling.

6 years agomeson: use new 'python' module instead of deprecated 'python3' one
Tim-Philipp Müller [Sun, 7 Oct 2018 18:51:41 +0000 (19:51 +0100)]
meson: use new 'python' module instead of deprecated 'python3' one

https://github.com/mesonbuild/meson/pull/4169

6 years agoaggregator: document new "min-upstream-latency" property is in nanosecs
Tim-Philipp Müller [Wed, 3 Oct 2018 23:30:52 +0000 (00:30 +0100)]
aggregator: document new "min-upstream-latency" property is in nanosecs

https://bugzilla.gnome.org/show_bug.cgi?id=797213

6 years agoprotection: Fix the string to define unspecified system id
Thibault Saunier [Wed, 3 Oct 2018 16:23:01 +0000 (18:23 +0200)]
protection: Fix the string to define unspecified system id

Setting it to "unspecified-system-id".

6 years agoprotection: Add a new definition for unspecified system protection
Yacine Bandou [Mon, 1 Oct 2018 10:11:47 +0000 (12:11 +0200)]
protection: Add a new definition for unspecified system protection

In some cases the system protection ID is not present in the contents
or in their metadata.
This define is used to set the value of the "system_id" field in GstProtectionEvent,
with this value, the application will use an external information to choose which
protection system to use.

Example: The matroskademux uses this value in the case of encrypted WebM,
the application will choose the appropriate protection system based on the information
received through EME API.

https://bugzilla.gnome.org/show_bug.cgi?id=797231

6 years agoqueuearray: Add set_clear_func and clear functions
Vivia Nikolaidou [Thu, 27 Sep 2018 14:30:25 +0000 (17:30 +0300)]
queuearray: Add set_clear_func and clear functions

gst_queue_array_clear will clear the GstQueueArray,
gst_queue_array_set_clear_func will set a clear function for each
element to be called on _clear and on _free.

https://bugzilla.gnome.org/show_bug.cgi?id=797218

6 years agoaggregator: add gtk-doc blurb for new min-upstream-latency prop
Mathieu Duponchelle [Thu, 27 Sep 2018 11:20:10 +0000 (13:20 +0200)]
aggregator: add gtk-doc blurb for new min-upstream-latency prop

6 years agoaggregator: add min-upstream-latency property.
Mathieu Duponchelle [Thu, 27 Sep 2018 10:42:30 +0000 (12:42 +0200)]
aggregator: add min-upstream-latency property.

This is exposed as a solution to the use case of plugging in
sources with a higher latency after the aggregator has started
playing with an initial set of sources, allowing to avoid resyncing.

https://bugzilla.gnome.org/show_bug.cgi?id=797213

6 years agoelement: remove inactive pad g_warning in add_pad
Mathieu Duponchelle [Thu, 20 Sep 2018 14:28:35 +0000 (16:28 +0200)]
element: remove inactive pad g_warning in add_pad

The documentation incorrectly used to state that the pads were
not automatically activated when added, whereas we actually do
that when appropriate.

Callers of gst_element_add_pad must not hold the object lock,
which implies that they cannot perform the same checks as
add_pad in a non-racy manner.

This updates the documentation, and removes the g_warning
that was output before performing automatic activation.

https://bugzilla.gnome.org/show_bug.cgi?id=797181

6 years agomeson: use library() for libgstcheck instead of always building a shared lib
Tim-Philipp Müller [Wed, 19 Sep 2018 18:37:38 +0000 (19:37 +0100)]
meson: use library() for libgstcheck instead of always building a shared lib

Otherwise we try to build a shared lib when we build the rest
of GStreamer statically, which won't work because we pass
-DGST_STATIC_COMPILATION when building statically, which means
we won't dllimport public symbols from our libs which means
that on Windows the unit tests will fail to link to libgstcheck.

https://bugzilla.gnome.org/show_bug.cgi?id=797185

6 years agotests: netclock-replay: fix build with new api export/import
Tim-Philipp Müller [Sat, 25 Aug 2018 23:23:23 +0000 (01:23 +0200)]
tests: netclock-replay: fix build with new api export/import

Can't mix/match imports and exports from the same library
here, so just include all .c files needed instead and don't
link to gstnet at all then.

https://bugzilla.gnome.org/show_bug.cgi?id=797185

6 years agolibs: figure out right export define in configure
Tim-Philipp Müller [Sat, 25 Aug 2018 21:56:01 +0000 (23:56 +0200)]
libs: figure out right export define in configure

Add new GST_API_EXPORT in config.h and use that for GST_*_API
decorators instead of GST_EXPORT.

The right export define depends on the toolchain and whether
we're using -fvisibility=hidden or not, so it's better to set it
to the right thing directly than hard-coding a compiler whitelist
in the public header.

We put the export define into config.h instead of passing it via the
command line to the compiler because it might contain spaces and brackets
and in the autotools scenario we'd have to pass that through multiple
layers of plumbing and Makefile/shell escaping and we're just not going
to be *that* lucky.

The export define is only used if we're compiling our lib, not by external
users of the lib headers, so it's not a problem to put it into config.h

Also, this means all .c files of libs need to include config.h
to get the export marker defined, so fix up a few that didn't
include config.h.

This commit depends on a common submodule commit that makes gst-glib-gen.mak
add an #include "config.h" to generated enum/marshal .c files for the
autotools build.

https://bugzilla.gnome.org/show_bug.cgi?id=797185

6 years agolibs: fix 'inconsistent DLL linkage' warnings on Windows
Tim-Philipp Müller [Sat, 25 Aug 2018 21:09:12 +0000 (23:09 +0200)]
libs: fix 'inconsistent DLL linkage' warnings on Windows

For each lib we build export its own API in headers when we're
building it, otherwise import the API from the headers.

This fixes linker warnings on Windows when building with MSVC.

The problem was that we had defined all GST_*_API decorators
unconditionally to GST_EXPORT. This was intentional and only
supposed to be temporary, but caused linker warnings because
we tell the linker that we want to export all symbols even
those from externall DLLs, and when the linker notices that
they were in external DLLS and not present locally it warns.

What we need to do when building each library is: export
the library's own symbols and import all other symbols. To
this end we define e.g. BUILDING_GST_FOO and then we define
the GST_FOO_API decorator either to export or to import
symbols depending on whether BUILDING_GST_FOO is set or not.
That way external users of each library API automatically
get the import.

https://bugzilla.gnome.org/show_bug.cgi?id=797185

6 years agogstconfig.h: add GST_API_IMPORT define
Tim-Philipp Müller [Sat, 25 Aug 2018 20:53:07 +0000 (22:53 +0200)]
gstconfig.h: add GST_API_IMPORT define

This is for use by the various GST_*_API decorators and
will be what they get defined to when a library API is being
used by external users of that library (not the library itself
whilst it's being compiled).

In most cases it will simply map to a plain 'extern' but on
Windows with MSVC it will need to map to __declspec(dllimport).
For functions this is not strictly needed, but for exported
variables it is.

https://bugzilla.gnome.org/show_bug.cgi?id=797185

6 years agomeson: Specify encoding to UTF-8 when building with MSVC
Seungha Yang [Fri, 21 Sep 2018 13:26:00 +0000 (22:26 +0900)]
meson: Specify encoding to UTF-8 when building with MSVC

Fix build on some non-US locale Windows systems

Error:
  gstreamer/gst/gstdebugutils.c(194): error C2001

https://bugzilla.gnome.org/show_bug.cgi?id=797186

6 years agoaggregator: define autoptr cleanup functions
Mathieu Duponchelle [Thu, 20 Sep 2018 14:22:14 +0000 (16:22 +0200)]
aggregator: define autoptr cleanup functions

6 years agodocs: gst: default to single include also for protection meta API
Tim-Philipp Müller [Wed, 19 Sep 2018 14:42:06 +0000 (15:42 +0100)]
docs: gst: default to single include also for protection meta API

https://bugzilla.gnome.org/show_bug.cgi?id=797165

6 years agodocs: libs: move all includes to canonical single header includes
Tim-Philipp Müller [Wed, 19 Sep 2018 14:07:36 +0000 (15:07 +0100)]
docs: libs: move all includes to canonical single header includes

And fix up bogus libs/ prefix for controller lib includes.

https://bugzilla.gnome.org/show_bug.cgi?id=797165

6 years agodocs: Update include directive for gstreamer-base components
Linus Svensson [Tue, 18 Sep 2018 13:44:24 +0000 (15:44 +0200)]
docs: Update include directive for gstreamer-base components

Change to always include gst/libs/base.h in order to also
include base-prelude.h, but also because it's the right
thing for people to include anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=797165

6 years agomeson: add glib-checks option to disable API guards and such
Tim-Philipp Müller [Wed, 19 Sep 2018 10:31:43 +0000 (11:31 +0100)]
meson: add glib-checks option to disable API guards and such

We want this enabled by default, also in releases, but people
may want to disable this for performance-critical workloads or
on embedded devices.

6 years agomeson: fix missing closing bracket in option descriptions
Tim-Philipp Müller [Wed, 19 Sep 2018 10:25:24 +0000 (11:25 +0100)]
meson: fix missing closing bracket in option descriptions

6 years agotests: Use a different rate in a segment test.
Jan Schmidt [Mon, 17 Sep 2018 12:13:22 +0000 (22:13 +1000)]
tests: Use a different rate in a segment test.

Using a rate of 1.1 in the test is causing the test to
fail on 32-bit because ceil(1.1 * 10) can round to 12.

Instead use a rate 2.0 that can be expressed as floating
point number and doesn't trigger the problem.

https://bugzilla.gnome.org/show_bug.cgi?id=797154

6 years agofilesink: Fix wrong printf format
Nicolas Dufresne [Wed, 12 Sep 2018 01:32:27 +0000 (21:32 -0400)]
filesink: Fix wrong printf format

We add a guint64 and a guint, the result is a guint64. On 64bit
architecture, this is the same, but on 32bit architecture, it's not.

https://bugzilla.gnome.org/show_bug.cgi?id=797127

6 years agobin: Fix use-after-free issue in gst_bin_add()
Philippe Normand [Sat, 8 Sep 2018 12:05:13 +0000 (13:05 +0100)]
bin: Fix use-after-free issue in gst_bin_add()

gst_element_post_message() takes ownership of the message so we need to increase
its refcount until we no longer require access to its data (context_type).

https://bugzilla.gnome.org/show_bug.cgi?id=797099

6 years agomeson: Always use a dependency object for dependencies
Nirbheek Chauhan [Wed, 5 Sep 2018 11:02:07 +0000 (16:32 +0530)]
meson: Always use a dependency object for dependencies

Fixes a configure error with gst-build:

subprojects/gst-plugins-base/meson.build:235:2: ERROR:  Fetched variable 'gst_check_dep' in the subproject 'gstreamer' is not a dependency object.

6 years agoutils: Set default values for position and duration query results
Philippe Normand [Mon, 3 Sep 2018 11:06:35 +0000 (12:06 +0100)]
utils: Set default values for position and duration query results

https://bugzilla.gnome.org/show_bug.cgi?id=797066

6 years agobaseparse: avg_bitrate calculation critical warning fix
Philippe Normand [Thu, 30 Aug 2018 16:44:07 +0000 (17:44 +0100)]
baseparse: avg_bitrate calculation critical warning fix

The avg_bitrate is an unsigned int, so the gst_util_uin64_scale() function can't
be used for it, as it expects signed integers for the fraction parts arguments.

https://bugzilla.gnome.org/show_bug.cgi?id=797054

6 years agoinput-selector: Bring latency handling in sync with GstPad code
Sebastian Dröge [Fri, 31 Aug 2018 09:15:16 +0000 (12:15 +0300)]
input-selector: Bring latency handling in sync with GstPad code

6 years agoRevert "pad: Don't drop LATENCY queries with default implementation"
Sebastian Dröge [Fri, 31 Aug 2018 09:12:13 +0000 (12:12 +0300)]
Revert "pad: Don't drop LATENCY queries with default implementation"

This reverts commit 794944f779f954375fc74a3fffcc2067bba6a3e5.

Accumulating non-live latency values generally makes no sense and often
gives invalid results with min>max

6 years agoRevert "pad: Accumulate live/non-live latency values separately"
Sebastian Dröge [Fri, 31 Aug 2018 09:12:09 +0000 (12:12 +0300)]
Revert "pad: Accumulate live/non-live latency values separately"

This reverts commit f5783e1cacb09867d81ba089b229faa7dd0edd0c.

6 years agomeson: Maintain macOS ABI through dylib versioning
Nirbheek Chauhan [Tue, 28 Aug 2018 20:33:28 +0000 (02:03 +0530)]
meson: Maintain macOS ABI through dylib versioning

Requires Meson 0.48, but the feature will be ignored on older versions
so it's safe to add it without bumping the requirement.

Documentation:
https://github.com/mesonbuild/meson/blob/master/docs/markdown/Reference-manual.md#shared_library

6 years agoinput-selector: Apply GstPad default latency handler fixes here too
Sebastian Dröge [Fri, 31 Aug 2018 08:47:03 +0000 (11:47 +0300)]
input-selector: Apply GstPad default latency handler fixes here too

6 years agopad: Accumulate live/non-live latency values separately
Sebastian Dröge [Fri, 31 Aug 2018 08:41:47 +0000 (11:41 +0300)]
pad: Accumulate live/non-live latency values separately

And only ever use the non-live values if all pads are non-live,
otherwise only use the results of all live pads.

It's unclear what one would use the values for in the non-live case, but
by this we at least pass them through correctly then.

This is a follow-up for 794944f779f954375fc74a3fffcc2067bba6a3e5, which
causes wrong latency calculations if the first pad is non-live but a
later pad is actually live. In that case the live values would be
accumulated together with the values of the non-live first pad,
generally causing wrong min/max latencies to be calculated.

6 years agoconcat: Improve debug output a bit by printing pad names
Sebastian Dröge [Wed, 29 Aug 2018 16:26:04 +0000 (19:26 +0300)]
concat: Improve debug output a bit by printing pad names

6 years agofilesink: Flush buffers before directly writing out buffers with the SYNC_AFTER flag
Sebastian Dröge [Tue, 28 Aug 2018 11:22:16 +0000 (14:22 +0300)]
filesink: Flush buffers before directly writing out buffers with the SYNC_AFTER flag

Otherwise we write out the SYNC_AFTER buffer immediately, and the
previously queued up buffers afterwards which then breaks the order of
data.

Also add various debug output.

6 years agogstsegment: Add check for gst_segment_offset_running_time()
Jan Schmidt [Mon, 27 Aug 2018 12:32:01 +0000 (22:32 +1000)]
gstsegment: Add check for gst_segment_offset_running_time()

Add a check for gst_segment_offset_running_time() that values
are taken directly from the segment base if possible.

6 years agogstsegment: Handle positions before the segment properly
Jan Schmidt [Thu, 23 Aug 2018 12:34:47 +0000 (22:34 +1000)]
gstsegment: Handle positions before the segment properly

Fixes for gst_segment_position_from_running_time_full() when
converting running_times that precede the segment start (or
stop in a negative rate segment)

The return value was incorrectly negated in those cases.

Add some more unit test checks for those cases, and especially
for segments with offsets.

6 years agotests: meta: fix msvc compiler warnings
Tim-Philipp Müller [Sat, 25 Aug 2018 22:45:45 +0000 (00:45 +0200)]
tests: meta: fix msvc compiler warnings

gstmeta.c(167): warning C4090: 'function': different 'const' qualifiers
gstmeta.c(172): warning C4090: 'function': different 'const' qualifiers
gstmeta.c(211): warning C4090: 'function': different 'const' qualifiers
gstmeta.c(216): warning C4090: 'function': different 'const' qualifiers

6 years agocheck: testclock: fix deprecation guards
Tim-Philipp Müller [Sat, 25 Aug 2018 22:34:44 +0000 (00:34 +0200)]
check: testclock: fix deprecation guards

Make our own deprecation marker for libgstcheck,
since the function declaration must contain the
right API export decorator (GST_CHECK_API) and
not the one for GStreamer core.

6 years agobitwriter: fix compiler warning
Tim-Philipp Müller [Sat, 25 Aug 2018 22:16:51 +0000 (00:16 +0200)]
bitwriter: fix compiler warning

Don't return a value from a function that doesn't
return a value using the returned value from a
function that also doesn't return a value.

gstbitwriter.h(265): warning C4098: 'gst_bit_writer_align_bytes_unchecked': 'void' function returning a value

6 years agofilesink: Use SYNC_AFTER flag in seeking test
Sebastian Dröge [Fri, 17 Aug 2018 14:24:59 +0000 (17:24 +0300)]
filesink: Use SYNC_AFTER flag in seeking test

Otherwise it's not guaranteed that buffers are actually on disk after
pushing them, and reading the file via g_file_get_contents() might not
include them yet.

6 years agofilesink: Consider the current buffer size when checking the current position
Sebastian Dröge [Fri, 17 Aug 2018 14:24:19 +0000 (17:24 +0300)]
filesink: Consider the current buffer size when checking the current position

6 years agofilesink: Reset the current buffer size to NULL and clear the buffer on close and...
Sebastian Dröge [Fri, 17 Aug 2018 14:23:52 +0000 (17:23 +0300)]
filesink: Reset the current buffer size to NULL and clear the buffer on close and FLUSH_STOP

6 years agomeson: host_system is 'ios' when building for iOS
Nirbheek Chauhan [Thu, 16 Aug 2018 21:24:00 +0000 (02:54 +0530)]
meson: host_system is 'ios' when building for iOS

The cross file sets this value, and we use 'ios' in Cerbero.

6 years agofilesink: Implement buffering internally
Sebastian Dröge [Tue, 14 Aug 2018 08:28:00 +0000 (11:28 +0300)]
filesink: Implement buffering internally

We use writev() so every call ends up going to the kernel but for small
buffers we generally would prefer to do as few write calls as possible.

https://bugzilla.gnome.org/show_bug.cgi?id=794173

6 years agofilesink: Remove buffer, deprecate line-buffer mode and don't use fflush()
Sebastian Dröge [Tue, 14 Aug 2018 07:58:26 +0000 (10:58 +0300)]
filesink: Remove buffer, deprecate line-buffer mode and don't use fflush()

fflush() has no effect because we use writev() directly, so fsync()
should be used instead which is actually flushing the kernel-side
buffers.

As a next step, a non-line-buffered buffering mode is to be added.

https://bugzilla.gnome.org/show_bug.cgi?id=794173

6 years agoaggregator: Fixup for previous commit to prevent infinite loop if no events are pending
Sebastian Dröge [Tue, 14 Aug 2018 09:30:19 +0000 (12:30 +0300)]
aggregator: Fixup for previous commit to prevent infinite loop if no events are pending

6 years agoaggregator: Return an error directly if negotiation of a sink pad failed
Sebastian Dröge [Mon, 13 Aug 2018 11:50:57 +0000 (14:50 +0300)]
aggregator: Return an error directly if negotiation of a sink pad failed

And don't give buffers to subclasses in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=796951

6 years agowin32: remove .def file with exports
Tim-Philipp Müller [Sun, 12 Aug 2018 21:57:41 +0000 (22:57 +0100)]
win32: remove .def file with exports

They're no longer needed, symbol exporting is now explicit
via GST_*_API export decorators in all cases, that is
autotools and meson, incl. MSVC.

6 years agoautotools: stop controlling symbol visibility with -export-symbols-regex
Tim-Philipp Müller [Sun, 12 Aug 2018 18:04:51 +0000 (19:04 +0100)]
autotools: stop controlling symbol visibility with -export-symbols-regex

Instead, use -fvisibility=hidden and explicit exports via GST_EXPORT.
This should result in consistent behaviour for the autotools and
Meson builds where this is done already, and will allow us to drop
the win32 .def files.

6 years agobitwriter: fix g-i scanner warning
Tim-Philipp Müller [Sun, 12 Aug 2018 19:07:02 +0000 (20:07 +0100)]
bitwriter: fix g-i scanner warning

gstbitwriter.h:45: Warning: GstBase: "@bit_capacity" parameter unexpected at this location:
 * @bit_capacity: Capacity of the allocated @data

6 years agomeson: add options to disable gobject cast checks and glib asserts
Tim-Philipp Müller [Sat, 11 Aug 2018 17:17:29 +0000 (18:17 +0100)]
meson: add options to disable gobject cast checks and glib asserts

And match what we do for autotools here currently.

6 years agomeson: define G_DISABLE_DEPRECATED for development versions
Tim-Philipp Müller [Fri, 10 Aug 2018 08:22:51 +0000 (09:22 +0100)]
meson: define G_DISABLE_DEPRECATED for development versions

Like in autotools.

6 years agomeson: add option to disable build of GStreamer unit test library
Tim-Philipp Müller [Fri, 10 Aug 2018 00:23:35 +0000 (01:23 +0100)]
meson: add option to disable build of GStreamer unit test library

6 years agomeson: add memory-alignment option
Tim-Philipp Müller [Thu, 9 Aug 2018 23:33:58 +0000 (00:33 +0100)]
meson: add memory-alignment option

6 years agomeson: add option to disable command-line option parsing
Tim-Philipp Müller [Thu, 9 Aug 2018 23:18:55 +0000 (00:18 +0100)]
meson: add option to disable command-line option parsing

6 years agomeson: add option to disable parse-launch pipeline string parser
Tim-Philipp Müller [Thu, 9 Aug 2018 23:08:43 +0000 (00:08 +0100)]
meson: add option to disable parse-launch pipeline string parser

6 years agomeson: add options to disable tests, examples, benchmarks and tools
Tim-Philipp Müller [Thu, 9 Aug 2018 22:32:49 +0000 (23:32 +0100)]
meson: add options to disable tests, examples, benchmarks and tools

And remove duplicate option 'poisoning' and unused 'build_tools' one.

6 years agoconfigure: Enable poisoning by default for non-release builds
Sebastian Dröge [Fri, 3 Aug 2018 10:18:12 +0000 (13:18 +0300)]
configure: Enable poisoning by default for non-release builds

6 years agogst: Add poisoning to more types
Sebastian Dröge [Fri, 3 Aug 2018 10:16:21 +0000 (13:16 +0300)]
gst: Add poisoning to more types

6 years agomeson: fix setting of extra checks option
Tim-Philipp Müller [Fri, 3 Aug 2018 09:36:21 +0000 (10:36 +0100)]
meson: fix setting of extra checks option

It's checked for with #ifdef so setting it to 0 or 1
will always enable it.

6 years agomeson: add option to enable poisoning of deallocated objects
Tim-Philipp Müller [Fri, 3 Aug 2018 09:35:07 +0000 (10:35 +0100)]
meson: add option to enable poisoning of deallocated objects

6 years agotypefindhelper: Mark gst_type_find_helper_get_range_full() as Since 1.14.3
Sebastian Dröge [Thu, 2 Aug 2018 07:55:40 +0000 (10:55 +0300)]
typefindhelper: Mark gst_type_find_helper_get_range_full() as Since 1.14.3

6 years agoinputselector: Forward LATENCY query to all sinkpads
Sebastian Dröge [Tue, 31 Jul 2018 16:25:03 +0000 (19:25 +0300)]
inputselector: Forward LATENCY query to all sinkpads

Otherwise downstream will consider the pipeline not live if the active
pad is live, even though some inactive pads might be live and might
require a non-zero latency configuration.

https://bugzilla.gnome.org/show_bug.cgi?id=796901

6 years agopad: Update pad offsets on the current event if the offset changed in pad probes
Sebastian Dröge [Tue, 31 Jul 2018 13:46:25 +0000 (16:46 +0300)]
pad: Update pad offsets on the current event if the offset changed in pad probes

https://bugzilla.gnome.org/show_bug.cgi?id=796898

6 years agopad: Ensure that the pad is blocked for IDLE probes if they are called from the strea...
Sebastian Dröge [Mon, 30 Jul 2018 15:51:35 +0000 (18:51 +0300)]
pad: Ensure that the pad is blocked for IDLE probes if they are called from the streaming thread too

IDLE probes that are directly called when being added will increase /
decrease the "number of IDLE probes running" counter around the call,
but when running from the streaming thread this won't happen.

This has the effect that when running from a streaming thread it is
possible to push serialized events or data out of the pad without
problems, but otherwise it would deadlock because serialized data would
wait for the IDLE probe to finish first (it is blocking after all!).

With this change it will now always consistently deadlock instead of
just every once in a while, which should make it obvious why this
happens and prevent racy deadlocks in application code.

https://bugzilla.gnome.org/show_bug.cgi?id=796895

6 years agotypefind: Add new gst_type_find_helper_get_range_full() that returns flow return
Sebastian Dröge [Mon, 30 Jul 2018 15:10:31 +0000 (18:10 +0300)]
typefind: Add new gst_type_find_helper_get_range_full() that returns flow return

And make use of it in the typefind element. It's useful to distinguish
between the different errors why typefinding can fail, and especially to
not consider GST_FLOW_FLUSHING as an actual error.

https://bugzilla.gnome.org/show_bug.cgi?id=796894

6 years agoaggregator: annotate GstAggregatorClass::update_src_caps
Mathieu Duponchelle [Fri, 27 Jul 2018 21:22:42 +0000 (23:22 +0200)]
aggregator: annotate GstAggregatorClass::update_src_caps

6 years agomeson: Add feature options for optional deps
Nirbheek Chauhan [Wed, 25 Jul 2018 02:04:19 +0000 (07:34 +0530)]
meson: Add feature options for optional deps

Everything should be behind an option now.

https://bugzilla.gnome.org/show_bug.cgi?id=795107

6 years agoaggregator: Don't leak peer pad of inactive pads when (not) forwarding QoS events...
Sebastian Dröge [Wed, 25 Jul 2018 23:31:05 +0000 (02:31 +0300)]
aggregator: Don't leak peer pad of inactive pads when (not) forwarding QoS events to them

6 years agomeson: Install bash completion helper in prefix
Nicolas Dufresne [Wed, 25 Jul 2018 22:51:58 +0000 (18:51 -0400)]
meson: Install bash completion helper in prefix

A regression was causing the helpers to be installed in /share which
would lead to permission denied error or PolicyKit to promtp for
permission. See:

  054fa3aa2 meson: Use new define_variable: feature instead of run_command()

6 years agomeson: host_machine.system() is darwin even on iOS
Nirbheek Chauhan [Wed, 25 Jul 2018 10:30:28 +0000 (16:00 +0530)]
meson: host_machine.system() is darwin even on iOS

Also use host_system everywhere.