platform/upstream/gstreamer.git
6 years agoaggregator: delegate buffer skipping to the aggregate thread
Mathieu Duponchelle [Tue, 23 Jan 2018 21:49:52 +0000 (22:49 +0100)]
aggregator: delegate buffer skipping to the aggregate thread

As we do that for serialized events as well, and the subclass will
most likely need to access pad->segment to make its decisions,
doing that from the sinkpad's streaming threads was racy.

6 years agoAPI: GstAggregatorPad.skip_buffer virtual method
Mathieu Duponchelle [Thu, 28 Dec 2017 11:12:45 +0000 (12:12 +0100)]
API: GstAggregatorPad.skip_buffer virtual method

Allows subclasses to prevent buffers from being queued.

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

6 years agobasesrc: Annotate some of the virtual methods
Mathieu Duponchelle [Tue, 23 Jan 2018 19:04:02 +0000 (20:04 +0100)]
basesrc: Annotate some of the virtual methods

6 years agoaggregator: rename _get_buffer() -> _peek_buffer() and _steal -> _pop
Tim-Philipp Müller [Tue, 23 Jan 2018 08:56:34 +0000 (08:56 +0000)]
aggregator: rename _get_buffer() -> _peek_buffer() and _steal -> _pop

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

6 years agochildproxy: gracefully handle methods being NULL
Tim-Philipp Müller [Sat, 20 Jan 2018 15:30:53 +0000 (15:30 +0000)]
childproxy: gracefully handle methods being NULL

Do this for all method invoke functions for consistency.

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

6 years agowin32: fix .def file for new API
Tim-Philipp Müller [Thu, 18 Jan 2018 18:11:59 +0000 (18:11 +0000)]
win32: fix .def file for new API

Fixes check + distcheck

6 years agoptp: fix build failure with #undef USE_MEASUREMENT_FILTERING
Michele Dionisio [Tue, 1 Aug 2017 08:43:32 +0000 (10:43 +0200)]
ptp: fix build failure with #undef USE_MEASUREMENT_FILTERING

"Label ‘out’ used but not defined", since it's also used by
the USE_MEDIAN_PRE_FILTERING branch.

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

6 years agopadtemplate: And add missing GST_EXPORT to gst_pad_template_new_with_gtype()
Sebastian Dröge [Thu, 18 Jan 2018 17:16:12 +0000 (19:16 +0200)]
padtemplate: And add missing GST_EXPORT to gst_pad_template_new_with_gtype()

6 years agopadtemplate: Add missing Since: 1.14 marker to gst_pad_template_new_with_gtype()
Sebastian Dröge [Thu, 18 Jan 2018 17:15:09 +0000 (19:15 +0200)]
padtemplate: Add missing Since: 1.14 marker to gst_pad_template_new_with_gtype()

6 years agopadtemplate: Add gst_pad_template_new_with_gtype()
Sebastian Dröge [Thu, 18 Jan 2018 17:08:10 +0000 (19:08 +0200)]
padtemplate: Add gst_pad_template_new_with_gtype()

For being able to create a pad template with GType without having a
static pad template.

6 years agopadtemplate: Add Since: 1.14 marker to gst_pad_template_new_from_static_pad_template_...
Sebastian Dröge [Thu, 18 Jan 2018 17:07:49 +0000 (19:07 +0200)]
padtemplate: Add Since: 1.14 marker to gst_pad_template_new_from_static_pad_template_with_gtype()

6 years agogstpad: Avoid stream-dead-lock on deactivation
Edward Hervey [Tue, 16 Jan 2018 09:17:58 +0000 (10:17 +0100)]
gstpad: Avoid stream-dead-lock on deactivation

The following case can happen when two thread try to activate and
deactivate a pad at the same time:
T1: starts to deactivate, calls pre_activate(), sets in_activation
    to TRUE and carries on
T2: starts to activate, calls pre_activate(), in_activation is TRUE
    so it waits on the GCond
T1: calls post_activate(), tries to acquire the streaming lock ..
    but can't because T2 is currently holding it

With this patch, the deadlock will no longer happen but does not
solve the problem that:
T2: will resume activation of the pad, set the pad mode to the target
   one (PUSH or PULL) and eventually the streaming lock gets released.
T1: is able to finish calling post_activate() ... but ... the pad
   wasn't deactivated (T2 was the last one to "activate" the pad.

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

6 years agogstpad: Release pending g_cond_wait() when stopping/pausing task
Edward Hervey [Mon, 15 Jan 2018 17:13:45 +0000 (18:13 +0100)]
gstpad: Release pending g_cond_wait() when stopping/pausing task

Otherwise we would deadlock waiting forever for the streaming lock
to be released

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

6 years agotypefindhelper: fix confusing debug log message
Jun Xie [Sat, 13 Jan 2018 03:08:00 +0000 (11:08 +0800)]
typefindhelper: fix confusing debug log message

In case of a short buffer, the debug log is quite confusing.
Distinguish the two types of failure cases to make it clearer.

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

6 years agodocs: explicit refer to GObject docs for floating refs
Tim-Philipp Müller [Fri, 12 Jan 2018 18:47:17 +0000 (18:47 +0000)]
docs: explicit refer to GObject docs for floating refs

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

6 years agotests: fakesink: make notify stress test work better on Windows
Tim-Philipp Müller [Thu, 11 Jan 2018 19:52:41 +0000 (19:52 +0000)]
tests: fakesink: make notify stress test work better on Windows

Set up all ten pipelines and preroll them first, and only set
them to playing to run wild after they're all set up. If we set
them to PLAYING directly and let those threads run wild, then
it might take ages (many seconds) for the other pipelines to
even get up and running, especially on machines with only one
or two cores, and operating systems that suck at scheduling.

Now the fakesink test takes 19 secs instead of 71 secs on a
single-cpu windows machine.

6 years agotests: filesrc: more Windows fixes
Tim-Philipp Müller [Thu, 11 Jan 2018 19:32:08 +0000 (19:32 +0000)]
tests: filesrc: more Windows fixes

Fix typo in newly-added windows uri test.

6 years agoutils: use g_get_monotonic_time() as fallback in gst_utils_get_timestamp()
Tim-Philipp Müller [Thu, 11 Jan 2018 18:44:50 +0000 (18:44 +0000)]
utils: use g_get_monotonic_time() as fallback in gst_utils_get_timestamp()

This is a better fit given that the function docs say this
should (only) be used for interval measurements, but also
this seems to give much better granularity on Windows
systems, where before this change there would often be
10-20 lines of debug log with the same timestamp up front.

6 years agotests: systemclock: scale stress test threads according to number of cpus
Tim-Philipp Müller [Thu, 11 Jan 2018 18:39:50 +0000 (18:39 +0000)]
tests: systemclock: scale stress test threads according to number of cpus

Scale the number of threads used in the stress tests according to
the number of cores/cpus. We want some contention, but we also
don't want too much contention, as some operating systems are
better at handling 100 threads running wild on a single core
than others.

6 years agoplugin: plugin_load() must return a ref even if it was loaded already
Tim-Philipp Müller [Thu, 11 Jan 2018 17:10:45 +0000 (17:10 +0000)]
plugin: plugin_load() must return a ref even if it was loaded already

Fix refcounting issue when plugin was loaded already.
gst_plugin_load() is supposed to return a ref, so it
must always return a ref.

This also fixes the gstplugin unit test on windows where
fork is not available and where test_load_coreelements()
would unref a plugin ref it didn't get and then mess up
the internal registry plugin list state for the next test,
in case where the test registry does not exist yet.

6 years agotests: filesrc: fix for windows
Tim-Philipp Müller [Thu, 11 Jan 2018 14:56:42 +0000 (14:56 +0000)]
tests: filesrc: fix for windows

Location paths have backslashes on windows when converted from URI.

6 years agolibs: check: print stacktrace on unexpected criticals
Tim-Philipp Müller [Thu, 11 Jan 2018 12:27:18 +0000 (12:27 +0000)]
libs: check: print stacktrace on unexpected criticals

6 years agotests: abi: fix abi test on 64-bit Windows
Tim-Philipp Müller [Thu, 11 Jan 2018 12:02:47 +0000 (12:02 +0000)]
tests: abi: fix abi test on 64-bit Windows

Add header with structure sizes for 64-bit windows as well.
They're almost the same as on Linux, but it looks like things
like padding unions get aligned slightly differently so there
are a handful of differences:

 sizeof(GstGhostPad) is 528, expected 536
 sizeof(GstPad) is 512, expected 520
 sizeof(GstPadProbeInfo) is 64, expected 72
 sizeof(GstProxyPad) is 520, expected 528

6 years agotests: info: fix post init cat reg test on windows and with CK_FORK=no
Tim-Philipp Müller [Thu, 11 Jan 2018 11:38:53 +0000 (11:38 +0000)]
tests: info: fix post init cat reg test on windows and with CK_FORK=no

The test checks that categories not covered by the pattern in the
GST_DEBUG string have debug level GST_LEVEL_DEFAULT set, but previous
tests mess with the default threshold, which made this test fail on
Windows or when run with CK_FORK=no. Fix this by resetting everything
at the beginning, and then also do a sanity check afterwards.

6 years agoinfo: reset default threshold to LEVEL_DEFAULT not 0
Tim-Philipp Müller [Thu, 11 Jan 2018 11:36:53 +0000 (11:36 +0000)]
info: reset default threshold to LEVEL_DEFAULT not 0

in set_threshold_from_string().

6 years agomeson: make check and tests build on Windows with msvc
Håvard Graff [Wed, 8 Nov 2017 19:05:03 +0000 (20:05 +0100)]
meson: make check and tests build on Windows with msvc

6 years agogstharness: Remove double free
Edward Hervey [Tue, 2 Jan 2018 09:02:45 +0000 (10:02 +0100)]
gstharness: Remove double free

6 years agostreams: GstStreamType/GstStream are available since 1.10
Sebastian Dröge [Tue, 26 Dec 2017 17:08:31 +0000 (18:08 +0100)]
streams: GstStreamType/GstStream are available since 1.10

Annotate them as such.

6 years agomeson: skip translations if gettext is not available
Tim-Philipp Müller [Tue, 26 Dec 2017 12:46:20 +0000 (13:46 +0100)]
meson: skip translations if gettext is not available

6 years agoaggregator: remove DEBUG_FUNCPTR
Stefan Sauer [Tue, 26 Dec 2017 11:51:22 +0000 (12:51 +0100)]
aggregator: remove DEBUG_FUNCPTR

The new gst_element_do_foreach_pad() does not print the functions anymore.

6 years agoinspect: add comment for how to improve tracer support
Stefan Sauer [Tue, 26 Dec 2017 11:17:53 +0000 (12:17 +0100)]
inspect: add comment for how to improve tracer support

6 years agosegment: add a FIXME-2.0 for the format parameters
Stefan Sauer [Tue, 26 Dec 2017 10:29:39 +0000 (11:29 +0100)]
segment: add a FIXME-2.0 for the format parameters

Capture the somewhat not ordinary use of the extra format parameter in a
comment.
See https://bugzilla.gnome.org/show_bug.cgi?id=788979

6 years agoSkip gst_deinit() if gstreamer was not initialized properly
Tim-Philipp Müller [Sun, 24 Dec 2017 15:21:38 +0000 (16:21 +0100)]
Skip gst_deinit() if gstreamer was not initialized properly

Can happen if an error occurs during option parsing, for example.

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

6 years agotests: multiqueue: Replace large test macro with function
Jan Alexander Steffens (heftig) [Sat, 23 Dec 2017 22:43:33 +0000 (23:43 +0100)]
tests: multiqueue: Replace large test macro with function

Just a bit of cleanup.

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

6 years agotests: multiqueue: Check we get CREATE+ENTER stream-statuses when adding pads
Jan Alexander Steffens (heftig) [Fri, 15 Dec 2017 08:43:40 +0000 (09:43 +0100)]
tests: multiqueue: Check we get CREATE+ENTER stream-statuses when adding pads

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

6 years agomultiqueue: Don't start new pads until parented
Jan Alexander Steffens (heftig) [Fri, 15 Dec 2017 08:14:57 +0000 (09:14 +0100)]
multiqueue: Don't start new pads until parented

Start task on new source pads added at runtime after they
have been added to the element, not during activation.

This ensures the pads can post their CREATE stream-status
messages and the application can set thread priorities.

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

6 years agomultiqueue: Split task handling from gst_single_queue_flush
Jan Alexander Steffens (heftig) [Fri, 15 Dec 2017 08:14:07 +0000 (09:14 +0100)]
multiqueue: Split task handling from gst_single_queue_flush

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

6 years agoaggregator: Avoid a maybe-uninitialized warning
Jan Alexander Steffens (heftig) [Sat, 23 Dec 2017 22:25:58 +0000 (23:25 +0100)]
aggregator: Avoid a maybe-uninitialized warning

Arch Linux x86_64, gcc 7.2.1-2, -Og -g3

6 years agodownloadbuffer: Don't hold the mutex while posint the download-complete message
Sebastian Dröge [Thu, 21 Dec 2017 11:47:52 +0000 (13:47 +0200)]
downloadbuffer: Don't hold the mutex while posint the download-complete message

Something might handle it from a sync message handler and call back into
downloadbuffer, causing a deadlock.

6 years agosystemclock: set_default() clock parameter can be NULL
Sebastian Dröge [Wed, 20 Dec 2017 16:56:23 +0000 (18:56 +0200)]
systemclock: set_default() clock parameter can be NULL

6 years agoelement: Annotate set_clock() clock parameter with allow-none
Sebastian Dröge [Wed, 20 Dec 2017 16:11:48 +0000 (18:11 +0200)]
element: Annotate set_clock() clock parameter with allow-none

6 years agoelement: Annotate set_bus() bus parameter as allow-none
Sebastian Dröge [Wed, 20 Dec 2017 16:09:28 +0000 (18:09 +0200)]
element: Annotate set_bus() bus parameter as allow-none

It's possible to replace the bus with NULL/None

6 years agogst-uninstalled: update for gl lib move from bad to base
Tim-Philipp Müller [Sun, 10 Dec 2017 22:50:05 +0000 (22:50 +0000)]
gst-uninstalled: update for gl lib move from bad to base

6 years agobasetransform: Allow going passthrough inside decide_allocation
Nicolas Dufresne [Tue, 12 Dec 2017 01:58:16 +0000 (20:58 -0500)]
basetransform: Allow going passthrough inside decide_allocation

Sub-class may want to decide to go passthrough/in-place by inspecting
the support meta APIs. This patch duplicates the check for this mode,
so we still don't do uneeded allocation query while we allow sub-classes
to switch the behaviour during it's own decide_allocation call.

Notice that such sub-class need to reset the class to non-passthrough in
set_caps() in order for decide_allocation to be called again. This is
needed otherwise we'd be doing an allocation query in element in which
it make no sense (notably capsfilter).

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

6 years agoplugin: Annotate add_dependency() arguments as NULL-terminated arrays
Sebastian Dröge [Sun, 17 Dec 2017 12:18:38 +0000 (14:18 +0200)]
plugin: Annotate add_dependency() arguments as NULL-terminated arrays

6 years agodocs: GstBus: Provide more information for ref/unref during bus watch.
Umang Jain [Wed, 13 Dec 2017 18:33:04 +0000 (00:03 +0530)]
docs: GstBus: Provide more information for ref/unref during bus watch.

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

6 years agoupdate win32 defs for tracer API addition
Matthew Waters [Thu, 14 Dec 2017 05:05:00 +0000 (16:05 +1100)]
update win32 defs for tracer API addition

6 years agoAutomatic update of common submodule
Matthew Waters [Thu, 14 Dec 2017 03:48:47 +0000 (14:48 +1100)]
Automatic update of common submodule

From e8c7a71 to 3fa2c9e

6 years agodocs: include tracers in the documentation
Matthew Waters [Tue, 5 Dec 2017 10:36:34 +0000 (21:36 +1100)]
docs: include tracers in the documentation

Requires exposing the tracer GType from the GstTracerFactory in order
to link the plugin with the tracer in the documentation.

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

6 years agocheck/harness: fix transfer annotations on buffer passing functions
Matthew Waters [Tue, 5 Dec 2017 09:56:09 +0000 (20:56 +1100)]
check/harness: fix transfer annotations on buffer passing functions

6 years agobasesrc: add buffer list support
Tim-Philipp Müller [Wed, 30 Aug 2017 12:03:28 +0000 (13:03 +0100)]
basesrc: add buffer list support

Add a gst_base_src_submit_buffer_list() function that allows subclasses
to produce a bufferlist containing multiple buffers in the ::create()
function. The buffers in the buffer list will then also be pushed out
in one go as a GstBufferList. This can reduce push overhead
significantly for sources with packetised inputs (such as udpsrc)
in high-throughput scenarios.

The _submit_buffer_list() approach was chosen because it is fairly
straight-forward, backwards-compatible, bindings-friendly (as opposed
to e.g. making the create function return a mini object instead),
and it allows the subclass maximum control: the subclass can decide
dynamically at runtime whether to return a list or a single buffer
(which would be messier if we added a create_list virtual method).

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

6 years agobasesrc: minor code readability improvement
Tim-Philipp Müller [Thu, 31 Aug 2017 00:18:28 +0000 (01:18 +0100)]
basesrc: minor code readability improvement

6 years agodocs: Fix a few gtk-doc warnings
Tim-Philipp Müller [Thu, 7 Dec 2017 12:05:23 +0000 (12:05 +0000)]
docs: Fix a few gtk-doc warnings

Broken links mostly.

6 years agotests: aggregator: fix caps leak in unit test
Tim-Philipp Müller [Wed, 6 Dec 2017 20:58:42 +0000 (20:58 +0000)]
tests: aggregator: fix caps leak in unit test

6 years agogstpad: Handle GST_PAD_PROBE_HANDLED on sticky event push
Edward Hervey [Wed, 6 Dec 2017 16:07:29 +0000 (17:07 +0100)]
gstpad: Handle GST_PAD_PROBE_HANDLED on sticky event push

When actually pushing an event, if we get GST_FLOW_CUSTOM_SUCCESS_1
(which is the conversion of GST_PAD_PROBE_HANDLED return value),
don't consider the stick event push as ignored, but as handled

6 years agoevent/query/message: Annotate get_structure() return value as nullable
Sebastian Dröge [Wed, 6 Dec 2017 11:40:46 +0000 (13:40 +0200)]
event/query/message: Annotate get_structure() return value as nullable

6 years agoquery: Add an empty structure in writable_structure() if there is none yet
Sebastian Dröge [Wed, 6 Dec 2017 11:36:30 +0000 (13:36 +0200)]
query: Add an empty structure in writable_structure() if there is none yet

This is consistent with how it works for GstEvent already.

6 years agodocs: Misc addition/fixes
Edward Hervey [Tue, 5 Dec 2017 17:21:00 +0000 (18:21 +0100)]
docs: Misc addition/fixes

And also add the "Since" API sections for 1.12 and 1.14

6 years agodocs: Add documentation for GST_SEQNUM_INVALID
Edward Hervey [Tue, 5 Dec 2017 17:20:34 +0000 (18:20 +0100)]
docs: Add documentation for GST_SEQNUM_INVALID

And link to it

6 years agoutils: Never return a group_id of 0, add GST_GROUP_ID_INVALID
Edward Hervey [Tue, 5 Dec 2017 16:28:55 +0000 (17:28 +0100)]
utils: Never return a group_id of 0, add GST_GROUP_ID_INVALID

Various plugins use special values (0 or G_MAXUINT32) as an
invalid/unset group_id, but nothing guarantees a groupid won't have
that value.

Instead define a value which group_id will never have and make
gst_group_id_next() always return a value different from that.

API: GST_GROUP_ID_INVALID

6 years agoharness: make bindings use the GBytes variant for _take_all_data()
Tim-Philipp Müller [Tue, 5 Dec 2017 16:42:57 +0000 (16:42 +0000)]
harness: make bindings use the GBytes variant for _take_all_data()

6 years agoharness: use new take_all_data() function in _dump_to_file().
Havard Graff [Wed, 23 Nov 2016 12:12:36 +0000 (13:12 +0100)]
harness: use new take_all_data() function in _dump_to_file().

6 years agoharness: add gst_harness_take_all_data() + _take_all_data_as_{bytes,buffer}()
Tim-Philipp Müller [Tue, 5 Dec 2017 15:28:43 +0000 (15:28 +0000)]
harness: add gst_harness_take_all_data() + _take_all_data_as_{bytes,buffer}()

Convenience function to just grab all pending data
from the harness, e.g. if we just want to check if
it matches what we expect and we don't care about
the chunking or buffer metadata.

Based on patch by: Havard Graff <havard.graff@gmail.com>

6 years agobuffer: document that _extract_dup() will return NULL for 0-sized buf
Tim-Philipp Müller [Tue, 5 Dec 2017 15:16:36 +0000 (15:16 +0000)]
buffer: document that _extract_dup() will return NULL for 0-sized buf

And make it explicit, and don't call _extract() on NULL data buffer.

6 years agomeson: Use array syntax instead of .get() in tests
Nirbheek Chauhan [Tue, 5 Dec 2017 06:57:18 +0000 (12:27 +0530)]
meson: Use array syntax instead of .get() in tests

6 years agomeson: Use new find_program fallback syntax
Nirbheek Chauhan [Thu, 23 Nov 2017 21:09:43 +0000 (02:39 +0530)]
meson: Use new find_program fallback syntax

We use this syntax in libs/gst/helpers/meson.build already.

6 years agogst: gst_element_remove_pad() is transfer none for the pad
Sebastian Dröge [Mon, 4 Dec 2017 16:08:39 +0000 (18:08 +0200)]
gst: gst_element_remove_pad() is transfer none for the pad

While the refcount of the pad is decreased, it's the refcount that is
owned by the parent (i.e. the element) and not the one passed in by the
caller.

Fixes a memory leak in bindings.

6 years agoaggregator: add finish_buffer() vfunc
Tim-Philipp Müller [Mon, 4 Dec 2017 11:24:47 +0000 (11:24 +0000)]
aggregator: add finish_buffer() vfunc

So subclasses can override the finish behaviour
and/or decorate or modify buffers before they
get pushed out.

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

6 years agoaggregator: disable tag merging and forwarding for now
Tim-Philipp Müller [Mon, 4 Dec 2017 12:29:05 +0000 (12:29 +0000)]
aggregator: disable tag merging and forwarding for now

Subclasses should handle this for now.

6 years agodevicemonitor: Avoid maybe-uninitialized compiler warning
Jan Alexander Steffens (heftig) [Mon, 6 Nov 2017 19:23:12 +0000 (20:23 +0100)]
devicemonitor: Avoid maybe-uninitialized compiler warning

On Arch Linux x86_64, gcc 7.2.0-3, -Og -g3:

gstdevicemonitor.c: In function ‘bus_sync_message’:
gstdevicemonitor.c:276:8: error: ‘matches’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

This commit also simplifies the code a bit.

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

6 years agogst: Annotate various strings as type filename if they represent a path/filename
Sebastian Dröge [Sun, 3 Dec 2017 12:48:22 +0000 (14:48 +0200)]
gst: Annotate various strings as type filename if they represent a path/filename

6 years agoaggregator: hook up to docs
Tim-Philipp Müller [Sat, 2 Dec 2017 15:44:48 +0000 (15:44 +0000)]
aggregator: hook up to docs

6 years agoaggregator: hook up to build system
Tim-Philipp Müller [Sat, 2 Dec 2017 15:24:22 +0000 (15:24 +0000)]
aggregator: hook up to build system

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

6 years agoMove GstAggregator from -bad to core
Tim-Philipp Müller [Sat, 2 Dec 2017 15:12:25 +0000 (15:12 +0000)]
Move GstAggregator from -bad to core

Merge branch 'aggregator-move'

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

6 years agoaggregator: Remove klass->sinkpads_type
Mathieu Duponchelle [Mon, 6 Nov 2017 20:07:51 +0000 (21:07 +0100)]
aggregator: Remove klass->sinkpads_type

This posed problems for the python bindings (and possibly others).

Instead, subclasses now use add_pad_template_with_gtype.

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

6 years agoaggregator: add doc blurb for gst_aggregator_pad_is_eos()
Tim-Philipp Müller [Thu, 2 Nov 2017 18:32:55 +0000 (18:32 +0000)]
aggregator: add doc blurb for gst_aggregator_pad_is_eos()

6 years agoaggregator: also remove now-unused PadForeachFunc declaration
Tim-Philipp Müller [Thu, 2 Nov 2017 16:05:12 +0000 (16:05 +0000)]
aggregator: also remove now-unused PadForeachFunc declaration

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

6 years agoaggregator: Remove pad iterator function
Olivier Crête [Wed, 2 Aug 2017 16:08:26 +0000 (12:08 -0400)]
aggregator: Remove pad iterator function

Use new gst_element_foreach_sink_pad() from core instead.

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

6 years agoaggregator: use new gst_element_foreach_sink_pad()
Tim-Philipp Müller [Thu, 2 Nov 2017 12:46:26 +0000 (12:46 +0000)]
aggregator: use new gst_element_foreach_sink_pad()

Instead of gst_aggregator_iterate_sinkpads() which will
soon be removed.

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

6 years agoaggregator: add more comments
Stefan Sauer [Wed, 1 Nov 2017 14:18:08 +0000 (15:18 +0100)]
aggregator: add more comments

6 years agotests: comment and logging cleanups for audiomixer and aggregator
Stefan Sauer [Mon, 23 Oct 2017 09:52:38 +0000 (11:52 +0200)]
tests: comment and logging cleanups for audiomixer and aggregator

Remove some references to 'collectpads'. Logs pads through the object variants.
Add some more comments. Remove a left over comment.

6 years agoaggregator: fix type for latency property (int64 -> GStClockTime)
Stefan Sauer [Sun, 22 Oct 2017 17:43:17 +0000 (19:43 +0200)]
aggregator: fix type for latency property (int64 -> GStClockTime)

The value is used as GstClockTiem in the code. Adapt the hack^H^H^H^Hcode
in live-adder.

6 years agoaggregator: Don't take flush lock from output thread
Olivier Crête [Thu, 13 Jul 2017 23:03:19 +0000 (19:03 -0400)]
aggregator: Don't take flush lock from output thread

Instead just take it in the chain function.

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

6 years agoaggregator: Don't block if adding to the tail of the queue
Olivier Crête [Thu, 13 Jul 2017 22:38:34 +0000 (18:38 -0400)]
aggregator: Don't block if adding to the tail of the queue

If we're adding to the tail of the queue, it's because we're converting
a gap event, so don't block there it means we're calling from the output
thread.

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

6 years agoaggregator: review code related to time level
Stefan Sauer [Tue, 17 Oct 2017 06:03:02 +0000 (08:03 +0200)]
aggregator: review code related to time level

Add a comment for when the state matters. Use a local var for priv in
update_time_level() to improve readability. Move the our_latency local
var below the query results checks.

6 years agoaggregator: init latency values with 0 instead of FALSE
Stefan Sauer [Tue, 17 Oct 2017 05:51:51 +0000 (07:51 +0200)]
aggregator: init latency values with 0 instead of FALSE

6 years agoaggregator: code cleanup for event and query func
Stefan Sauer [Sun, 15 Oct 2017 18:46:09 +0000 (20:46 +0200)]
aggregator: code cleanup for event and query func

Only look up klass for non serialized events/queries. For events remove
superfluous assignment for the return value in the flushing case.

6 years agoaggregator: simplify pad_event_func for FLUSH_STOP events
Stefan Sauer [Sun, 15 Oct 2017 15:46:45 +0000 (17:46 +0200)]
aggregator: simplify pad_event_func for FLUSH_STOP events

We want to skip serialization for FLUSH_STOP events (apparently). We can
simplify the code to add it to the top-level conditions. There was nothing
done in the first code path if the event was FLUSH_STOP.

6 years agoaggregator: drop special casing for eos
Stefan Sauer [Sun, 15 Oct 2017 14:57:13 +0000 (16:57 +0200)]
aggregator: drop special casing for eos

Just queue it like any other serialized event. This way we don't need to
check if there still are buffers in the queue.

Validated with the tests and gst-launch-1.0 pipelines.

6 years agoaggregator: add a doc-blob for the event_func
Stefan Sauer [Sun, 15 Oct 2017 14:51:21 +0000 (16:51 +0200)]
aggregator: add a doc-blob for the event_func

6 years agoaggregator: rename a local variable
Stefan Sauer [Sun, 15 Oct 2017 14:48:21 +0000 (16:48 +0200)]
aggregator: rename a local variable

The variable tracks wheter the queue is not empty, but num_buffers==0. That
means we have events or queries to process. Rename accordingly.

6 years agoaggregator: remove commented code
Stefan Sauer [Sun, 15 Oct 2017 10:17:42 +0000 (12:17 +0200)]
aggregator: remove commented code

The SEGMENT_DONE event does not require any special treatment. This is
commented out in 6efc106a67.

6 years agoaggregator: move the comment for the locks to the lock macros
Stefan Sauer [Sun, 15 Oct 2017 10:14:28 +0000 (12:14 +0200)]
aggregator: move the comment for the locks to the lock macros

Looks like some code was inserted afterwards.

6 years agoaggregator: improve section docs
Stefan Sauer [Sun, 15 Oct 2017 08:44:44 +0000 (10:44 +0200)]
aggregator: improve section docs

Mention how data ends up in the queues. Document the relation of the pad
functions and the class vmethods to get events and queries.

6 years agoaggregator: add two more tests for a sequence of data
Stefan Sauer [Sat, 14 Oct 2017 16:18:44 +0000 (18:18 +0200)]
aggregator: add two more tests for a sequence of data

This verifies that we handle events and queries at the head of the queue and
then buffers.

6 years agoaggregator: refactor the test helper
Stefan Sauer [Sat, 14 Oct 2017 11:26:02 +0000 (13:26 +0200)]
aggregator: refactor the test helper

Make the test helpers use a queue. This lets us also test sequences of events,
queries and data.

6 years agoaggregator: test cleanup
Stefan Sauer [Sat, 14 Oct 2017 10:08:19 +0000 (12:08 +0200)]
aggregator: test cleanup

Remove gst_init() from a few tests. Use _OBJECT variants in logging. Remove
arbitrary extra blank lines. Make push_event() more like push_buffer() - set
the event to NULL and add cleanup to _chain_data_clear().

6 years agoaggregator: cleanup event forwarding
Stefan Sauer [Tue, 3 Oct 2017 10:36:10 +0000 (12:36 +0200)]
aggregator: cleanup event forwarding

Don't copy the whole event struct. Set the input params when we call the
forwarding helper. Initialize the internal fields and return values in the
helper.

6 years agoaggregator: simplify src_event
Stefan Sauer [Tue, 3 Oct 2017 10:08:42 +0000 (12:08 +0200)]
aggregator: simplify src_event

Avoid extra ref/unref, we have a ref and do_seek unrefs. Just return the result
as we have. This lets us remove the local var plus the label.

6 years agoaggregator: register func for do_events_and_queries
Stefan Sauer [Sun, 17 Sep 2017 19:37:03 +0000 (12:37 -0700)]
aggregator: register func for do_events_and_queries

This fixes logging the func ptr from _iterate_sinkpads().