platform/upstream/gstreamer.git
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().

6 years agoaggregator: only set clipped_buffer to NULL if needed
Stefan Sauer [Sun, 17 Sep 2017 19:30:37 +0000 (12:30 -0700)]
aggregator: only set clipped_buffer to NULL if needed

6 years agoaggregator: rename check_events
Stefan Sauer [Sun, 17 Sep 2017 19:25:37 +0000 (12:25 -0700)]
aggregator: rename check_events

This function also handles queries. Update the code to loop until all events and
queuries are handled.

6 years agoaggregator: add a few more comments to PadPrivate struct
Stefan Sauer [Sun, 17 Sep 2017 19:24:54 +0000 (12:24 -0700)]
aggregator: add a few more comments to PadPrivate struct

6 years agoaggregator: rename buffers field to data
Stefan Sauer [Sun, 17 Sep 2017 18:39:12 +0000 (11:39 -0700)]
aggregator: rename buffers field to data

The queue stores buffers, events and queries.

6 years agoaggregator: documentaion fixes
Stefan Sauer [Sun, 17 Sep 2017 17:18:56 +0000 (10:18 -0700)]
aggregator: documentaion fixes

Fix typos and remove params docs, where the param was moved.

6 years agocheck: Fix usage of dual probes
Edward Hervey [Tue, 5 Sep 2017 12:26:52 +0000 (14:26 +0200)]
check: Fix usage of dual probes

Using two (or more) probes on the same pad where one of the probe
returns HANDLED or DROP is tricky since the other probes might
not be called.

Instead use regular probes and a proper pad (the sinkpad already existed,
it only required to be activated and have a dummy chain function for
the events/buffers to be received/handled properly)

6 years agoaggregator: log all events
Stefan Sauer [Sun, 30 Jul 2017 10:17:57 +0000 (12:17 +0200)]
aggregator: log all events

We already log a few events explicitly, just log them all with more detail.

6 years agoaggregator: fix header formatting
Tim-Philipp Müller [Sat, 29 Jul 2017 15:54:38 +0000 (16:54 +0100)]
aggregator: fix header formatting

6 years agoaggregator: Remove the GAP event from the queue before queueing up the GAP buffer
Sebastian Dröge [Mon, 24 Jul 2017 15:38:57 +0000 (18:38 +0300)]
aggregator: Remove the GAP event from the queue before queueing up the GAP buffer

Otherwise check_events() will not remove the GAP event (as the queue
tail is not the event anymore but the GAP buffer), then the GAP buffer
is handled, then the GAP event is handled again, ... forever.

6 years agoaggregator: mark symbols explicitly for export with GST_EXPORT
Tim-Philipp Müller [Mon, 17 Jul 2017 23:30:51 +0000 (00:30 +0100)]
aggregator: mark symbols explicitly for export with GST_EXPORT

6 years agoaggregator: remove duplicated code fragment
Stefan Sauer [Thu, 13 Jul 2017 20:00:58 +0000 (22:00 +0200)]
aggregator: remove duplicated code fragment

This code already runs above when (event || query).

6 years agoaggregator: code cleanups
Stefan Sauer [Thu, 13 Jul 2017 19:55:55 +0000 (21:55 +0200)]
aggregator: code cleanups

Fix comment typos, some copy'n'paste in logging. Add more doc comments.

6 years agoaggregator: Invalidate pad's tail position ...
Mathieu Duponchelle [Thu, 13 Apr 2017 20:11:55 +0000 (22:11 +0200)]
aggregator: Invalidate pad's tail position ...

when dequeuing a segment event.

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

6 years agoaggregator: fix "'aggclass' may be used uninitialized in this function"
Stefan Sauer [Sat, 1 Jul 2017 18:23:25 +0000 (20:23 +0200)]
aggregator: fix "'aggclass' may be used uninitialized in this function"

6 years agoaggregator: Process serialized queries through the queue
Olivier Crête [Mon, 22 May 2017 22:53:57 +0000 (00:53 +0200)]
aggregator: Process serialized queries through the queue

This ensures that they really get processed in order with
buffers. Just waiting for the queue to be empty is sometimes not
enough as the buffers are dropped from the pad before the result is
pushed to the next element, sometimes resulting in surprising
re-ordering.

6 years agoaggregator: Set flow to FLUSHING on pad stop
Olivier Crête [Mon, 22 May 2017 22:53:23 +0000 (00:53 +0200)]
aggregator: Set flow to FLUSHING on pad stop

Fixes a rare race where the pad is being stopped while doing a query.

6 years agoaggregator: Request pad templates which are not request pad
Olivier Crête [Fri, 18 Nov 2016 19:44:16 +0000 (14:44 -0500)]
aggregator: Request pad templates which are not request pad

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

6 years agoaggregator: Don't restrict sink pad names
Olivier Crête [Fri, 18 Nov 2016 19:41:54 +0000 (14:41 -0500)]
aggregator: Don't restrict sink pad names

Sink pads could have other names than sink_%u

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

6 years agoaggregator: Implement propose allocation
Olivier Crête [Sun, 21 May 2017 13:19:17 +0000 (15:19 +0200)]
aggregator: Implement propose allocation

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

6 years agoaggregator: Check for the result of caps events
Olivier Crête [Sun, 21 May 2017 12:34:13 +0000 (14:34 +0200)]
aggregator: Check for the result of caps events

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

6 years agoaggregator: Caps event always goes to the aggregate thread
Olivier Crête [Sun, 21 May 2017 12:28:00 +0000 (14:28 +0200)]
aggregator: Caps event always goes to the aggregate thread

So no need to check it here.

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

6 years agoaggregator: Add downstream allocation query
Olivier Crête [Sat, 20 May 2017 14:58:54 +0000 (16:58 +0200)]
aggregator: Add downstream allocation query

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

6 years agoaggregator: Remove unused GST_FLOW_NOT_HANDLED
Olivier Crête [Sat, 20 May 2017 13:56:16 +0000 (15:56 +0200)]
aggregator: Remove unused GST_FLOW_NOT_HANDLED

6 years agoaggregator: add simple support for caps handling
Matthew Waters [Sat, 20 May 2017 12:24:57 +0000 (14:24 +0200)]
aggregator: add simple support for caps handling

Modelled off the videoaggregator caps handling as that seems the most
mature aggregtor-using implementation that has caps handling there is.

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

6 years agoaggregator: Reset upstream latency on first buffer
Nicolas Dufresne [Sat, 20 May 2017 11:10:53 +0000 (13:10 +0200)]
aggregator: Reset upstream latency on first buffer

In the case an aggregator is created and pads are requested but only
linked later, we end up never updating the upstream latency.
This was because latency queries on pads that are not linked succeed,
so we never did a new query once a live source has been linked, so the
thread was never started.

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

6 years agoaggregator: Always handle sync'ed events on output thread
Olivier Crête [Sat, 14 May 2016 13:52:37 +0000 (15:52 +0200)]
aggregator: Always handle sync'ed events on output thread

Having all synchronized events always be handled on the output
thread should make synchronization easier.

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

6 years agoaggregator: Delay clipping to output thread
Olivier Crête [Wed, 6 Jul 2016 20:39:17 +0000 (16:39 -0400)]
aggregator: Delay clipping to output thread

This is required because the synchronized events like caps or segments
may only be processed on the output thread.

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

6 years agoaggregator: Make pad eos as soon as all buffers are processed, dont way for events
Olivier Crête [Thu, 7 Jul 2016 20:13:57 +0000 (16:13 -0400)]
aggregator: Make pad eos as soon as all buffers are processed, dont way for events

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

6 years agoaggregator: Only count buffers when declaring queue full
Olivier Crête [Thu, 7 Jul 2016 15:47:40 +0000 (11:47 -0400)]
aggregator: Only count buffers when declaring queue full

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

6 years agoaggregator: Simplify clip function
Olivier Crête [Wed, 6 Jul 2016 20:41:44 +0000 (16:41 -0400)]
aggregator: Simplify clip function

The return value was ignored anyway

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

6 years agoaggregator: Only declare first buffer on actual buffer
Olivier Crête [Sun, 15 May 2016 13:04:58 +0000 (16:04 +0300)]
aggregator: Only declare first buffer on actual buffer

The function needs to be unlocked if any data is received, but only
end the first buffer processing on an actual buffer, synchronized events
don't matter on the first buffer processing.

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

6 years agoaggregator: Set initial position on first buffer
Olivier Crête [Wed, 10 May 2017 00:20:07 +0000 (20:20 -0400)]
aggregator: Set initial position on first buffer

Set the initial position on the first buffer, otherwise the queue
will grow without limits before the output thread is started.

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

6 years agoaggregator: Reset the pad's first buffer flag with the rest
Olivier Crête [Wed, 10 May 2017 00:06:29 +0000 (20:06 -0400)]
aggregator: Reset the pad's first buffer flag with the rest

There is not reason to have separate code to reset this one.

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

6 years agoaggregator: Reset pad on init
Olivier Crête [Wed, 10 May 2017 00:05:55 +0000 (20:05 -0400)]
aggregator: Reset pad on init

Factor out the pad reset code from the flushing and use it on init as well

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

6 years agoaggregator: Fix indentation
Olivier Crête [Wed, 10 May 2017 00:13:58 +0000 (20:13 -0400)]
aggregator: Fix indentation

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

6 years agodocs: Port all docstring to gtk-doc markdown
Thibault Saunier [Wed, 8 Mar 2017 18:01:13 +0000 (15:01 -0300)]
docs: Port all docstring to gtk-doc markdown

6 years agoaggregator: Make instance var name match between .c and .h
Thibault Saunier [Wed, 12 Apr 2017 15:06:52 +0000 (12:06 -0300)]
aggregator: Make instance var name match  between .c and .h

Making GI happy

6 years agogstaggregator: fix event use after free
Vincent Penquerc'h [Fri, 7 Apr 2017 09:19:43 +0000 (10:19 +0100)]
gstaggregator: fix event use after free

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

6 years agoaggregator: Use the event_full function for GstAggregatorPads
Thibault Saunier [Tue, 6 Sep 2016 19:05:53 +0000 (16:05 -0300)]
aggregator: Use the event_full function for GstAggregatorPads

Allowing us to tell GstPad why we are failing an event, which might
be because we are 'flushing' even if the sinkpad is not in flush state
at that point.

6 years agoRevert "aggregator: Start the task when linked"
Nicolas Dufresne [Wed, 25 May 2016 17:38:47 +0000 (13:38 -0400)]
Revert "aggregator: Start the task when linked"

This reverts commit 302580c3815136d29479c3a8cae611d6e2ff3709.

6 years agoaggregator: Start the task when linked
Nicolas Dufresne [Wed, 13 Apr 2016 20:30:28 +0000 (16:30 -0400)]
aggregator: Start the task when linked

Until now we would start the task when the pad is activated. Part of the
activiation concist of testing if the pipeline is live or not.
Unfortunatly, this is often too soon, as it's likely that the pad get
activated before it is fully linked in dynamic pipeline.

Instead, start the task when the first serialized event arrive. This is
a safe moment as we know that the upstream chain is complete and just
like the pad activation, the pads are locked, hence cannot change.

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

6 years agoaggregator: Check all pads for data when live
Nicolas Dufresne [Fri, 22 Apr 2016 14:15:39 +0000 (10:15 -0400)]
aggregator: Check all pads for data when live

When live, we still need to inspect all pads queue in order to determin
if we have received the first buffer or not.

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

6 years agoaggregator: Fix locking when using the clock
Nicolas Dufresne [Fri, 15 Apr 2016 20:51:17 +0000 (16:51 -0400)]
aggregator: Fix locking when using the clock

This fixes a race where we check if there is a clock, then it get
removed and we endup calling gst_clock_new_single_shot_id() with a NULL
pointer instead of a valid clock and also calling gst_object_unref()
with a NULL pointer later.

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

6 years agoaggregator: remove duplicated test of flow_return in pad_chain_internal
Aurélien Zanelli [Sun, 3 Apr 2016 15:56:06 +0000 (17:56 +0200)]
aggregator: remove duplicated test of flow_return in pad_chain_internal

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

6 years agoaggregator: Fix leak in unit test
Sebastian Dröge [Mon, 28 Mar 2016 10:52:07 +0000 (13:52 +0300)]
aggregator: Fix leak in unit test

GST_PAD_PROBE_HANDLED means that we should've unreffed the probe data,
it was handled by us in one way or another.

6 years agoaggregator: Fix strcmp test for sink template
Nirbheek Chauhan [Sun, 27 Mar 2016 13:36:50 +0000 (19:06 +0530)]
aggregator: Fix strcmp test for sink template

6 years agoaggregator: Don't try to be too smart while allocating pad names
Nirbheek Chauhan [Sun, 27 Mar 2016 13:11:30 +0000 (18:41 +0530)]
aggregator: Don't try to be too smart while allocating pad names

Previously, while allocating the pad number for a new pad, aggregator was
maintaining an interesting relationship between the pad count and the pad
number.

If you requested a sink pad called "sink_6", padcount (which is badly named and
actually means number-of-pads-minus-one) would be set to 6. Which means that if
you then requested a sink pad called "sink_0", it would be assigned the name
"sink_6" again, which fails the non-uniqueness test inside gstelement.c.

This can be fixed by instead setting padcount to be 7 in that case, but this
breaks manual management of pad names by the application since it then becomes
impossible to request a pad called "sink_2". Instead, we fix this by always
directly using the requested name as the sink pad name. Uniqueness of the pad
name is tested separately inside gstreamer core. If no name is requested, we use
the next available pad number.

Note that this is important since the sinkpad numbering in aggregator is not
meaningless. Videoaggregator uses it to decide the Z-order of video frames.

6 years agobad: use new gst_element_class_add_static_pad_template()
Vineeth TM [Fri, 4 Mar 2016 06:50:26 +0000 (15:50 +0900)]
bad: use new gst_element_class_add_static_pad_template()

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

6 years agotests:aggregator: fix tc failure and correct check value
Hyunjun Ko [Mon, 9 Nov 2015 07:08:30 +0000 (16:08 +0900)]
tests:aggregator: fix tc failure and correct check value

Failure by this commit 2dfa548f3645844082c3db65d96d87255701b3ad, which is
to append hooks instead of prepend.
Because of this change, aggretated_cb is not called and leads to failure.

And correct to check flush stop value instead of flush start value

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

6 years agoaggregator: use GST_STIME_FORMAT for GstClockTimeDiff
Luis de Bethencourt [Thu, 5 Nov 2015 12:36:48 +0000 (12:36 +0000)]
aggregator: use GST_STIME_FORMAT for GstClockTimeDiff

No need to manually handle negative value of deadline, GST_STIME_FORMAT does
exactly this.

6 years agoaggregator: don't compare templ instance pointers
Stefan Sauer [Wed, 4 Nov 2015 03:09:33 +0000 (19:09 -0800)]
aggregator: don't compare templ instance pointers

One can pass the PadTemplate from the element_class or the one from the factory.
While they have the same content, the addresses are different.

6 years agoaggregator: Set to running in a single place
Olivier Crête [Tue, 3 Nov 2015 19:41:57 +0000 (14:41 -0500)]
aggregator: Set to running in a single place

Only set to running when the thread is actually started.

6 years agoaggregator: Document more locking
Olivier Crête [Tue, 3 Nov 2015 19:37:26 +0000 (14:37 -0500)]
aggregator: Document more locking

6 years agoaggregator: Hold object lock while manipulating the segment
Olivier Crête [Tue, 3 Nov 2015 01:10:35 +0000 (20:10 -0500)]
aggregator: Hold object lock while manipulating the segment

Make sure the object lock is held when aggregator->segment is
modified.

6 years agoaggregator: Remove dead code
Olivier Crête [Tue, 3 Nov 2015 00:05:01 +0000 (19:05 -0500)]
aggregator: Remove dead code

This code will never be called as max>=min in all cases. If the upstream
latency query returned min>max, the function already returned and all
values that are added to those have max>= min.

6 years agoaggregator: Add create_new_pad() vfunc to allow subclasses to override the default...
Sebastian Dröge [Fri, 23 Oct 2015 12:42:24 +0000 (15:42 +0300)]
aggregator: Add create_new_pad() vfunc to allow subclasses to override the default behaviour

Not all aggregator subclasses will have a single pad template called sink_%u
and might do something special depending on what the application requests.

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

6 years agoaggregator: Convert GST_ERROR_OBJECT() for seek events to GST_DEBUG_OBJECT()
Sebastian Dröge [Wed, 30 Sep 2015 17:05:35 +0000 (19:05 +0200)]
aggregator: Convert GST_ERROR_OBJECT() for seek events to GST_DEBUG_OBJECT()

6 years agoaggregator: For the start time selection, only set the segment position
Sebastian Dröge [Wed, 30 Sep 2015 17:03:05 +0000 (19:03 +0200)]
aggregator: For the start time selection, only set the segment position

segment.time and segment.start can stay the same, and were always the same
before anyway because of a mistake.

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

6 years agoaggregator: Don't forward QOS events to sinkpads that had no buffer yet
Sebastian Dröge [Mon, 31 Aug 2015 13:12:40 +0000 (16:12 +0300)]
aggregator: Don't forward QOS events to sinkpads that had no buffer yet

Otherwise they will receive a QOS event that has earliest_time=0 (because we
can't have negative timestamps), and consider their buffer as too late

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

6 years agoaggregator: Keep at least two buffers in the queue in live mode
Olivier Crête [Thu, 17 Sep 2015 23:42:34 +0000 (19:42 -0400)]
aggregator: Keep at least two buffers in the queue in live mode

When in live mode, the queue needs to hold the currently processed
buffer and one more at least.

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

6 years agoaggregator: Document that get_next_time() should return running time
Sebastian Dröge [Fri, 11 Sep 2015 10:21:50 +0000 (12:21 +0200)]
aggregator: Document that get_next_time() should return running time

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

6 years agoaggregator: Also ignore start-time on seek from gst_element_send_event()
Olivier Crête [Sat, 29 Aug 2015 03:05:20 +0000 (23:05 -0400)]
aggregator: Also ignore start-time on seek from gst_element_send_event()

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

6 years agotests: Add test for seeking live pipelines
Olivier Crête [Thu, 2 Jul 2015 23:34:43 +0000 (19:34 -0400)]
tests: Add test for seeking live pipelines

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

6 years agotests: Make source live to re-enable aggregator timeout tests
Olivier Crête [Thu, 2 Jul 2015 23:19:33 +0000 (19:19 -0400)]
tests: Make source live to re-enable aggregator timeout tests

The live mode is only enabled if one of the sources if live.

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

6 years agoaggregator: Queue "latency" buffers at each sink pad.
Olivier Crête [Sat, 7 Mar 2015 00:50:08 +0000 (19:50 -0500)]
aggregator: Queue "latency" buffers at each sink pad.

In the case where you have a source giving the GstAggregator smaller
buffers than it uses, when it reaches a timeout, it will consume the
first buffer, then try to read another buffer for the pad. If the
previous element is not fast enough, it may get the next buffer even
though it may be queued just before. To prevent that race, the easiest
solution is to move the queue inside the GstAggregatorPad itself. It
also means that there is no need for strange code cause by increasing
the min latency without increasing the max latency proportionally.

This also means queuing the synchronized events and possibly acting
on them on the src task.

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

6 years agoaggregator: Default to "zero" start time selection mode as documented
Olivier Crête [Thu, 30 Jul 2015 00:07:09 +0000 (20:07 -0400)]
aggregator: Default to "zero" start time selection mode as documented

6 years agoaggregator: Ignore the "first" mode if the segment not a time segment
Olivier Crête [Thu, 30 Jul 2015 00:06:11 +0000 (20:06 -0400)]
aggregator: Ignore the "first" mode if the segment not a time segment

6 years agoaggregator: Add property to select how to decide on a start time
Sebastian Dröge [Mon, 15 Jun 2015 16:30:20 +0000 (18:30 +0200)]
aggregator: Add property to select how to decide on a start time

Before aggregator based elements always started at running time 0,
now it's possible to select the first input buffer running time or
explicitly set a start-time value.

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

6 years agoaggregator: Query the peer latency again on the next opportunity after a pad was...
Sebastian Dröge [Tue, 28 Jul 2015 18:15:43 +0000 (21:15 +0300)]
aggregator: Query the peer latency again on the next opportunity after a pad was added or removed

Adding a pad will add a new upstream that might have a bigger minimum latency,
so we might have to wait longer. Or it might be the first live upstream, in
which case we will have to start deadline based aggregation.

Removing a pad will remove a new upstream that might have had the biggest
latency, so we can now stop waiting a bit earlier. Or it might be the last
live upstream, in which case we can stop deadline based aggregation.

6 years agoaggregator: add a convenience macro to get the source pad
Thiago Santos [Wed, 6 May 2015 16:07:52 +0000 (13:07 -0300)]
aggregator: add a convenience macro to get the source pad

Easier than casting or acessing the parent everywhere

6 years agoaggregator: Document that the latency is in ns
Olivier Crête [Mon, 1 Jun 2015 22:50:14 +0000 (18:50 -0400)]
aggregator: Document that the latency is in ns

6 years agoaggregator: Push EOS on error return.
Jan Schmidt [Wed, 27 May 2015 14:59:39 +0000 (00:59 +1000)]
aggregator: Push EOS on error return.

Before shutting down the srcpad task due to a
downstream error, push an EOS to give downstream
a chance to shut down somewhat cleanly.

6 years agoaggregator: document gap handling behavior
Reynaldo H. Verdejo Pinochet [Sun, 29 Mar 2015 20:53:23 +0000 (17:53 -0300)]
aggregator: document gap handling behavior

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

6 years agoaggregator: drop stale white space at warning
Reynaldo H. Verdejo Pinochet [Fri, 27 Mar 2015 22:36:42 +0000 (19:36 -0300)]
aggregator: drop stale white space at warning

6 years agoaggregator: fix typo in test suite
Reynaldo H. Verdejo Pinochet [Fri, 27 Mar 2015 22:28:05 +0000 (19:28 -0300)]
aggregator: fix typo in test suite

6 years agoaggregator: add gap event handling unit test
Reynaldo H. Verdejo Pinochet [Fri, 27 Mar 2015 21:32:27 +0000 (18:32 -0300)]
aggregator: add gap event handling unit test

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

6 years agoaggregator: implement gap handling
Reynaldo H. Verdejo Pinochet [Wed, 18 Mar 2015 01:13:06 +0000 (22:13 -0300)]
aggregator: implement gap handling

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

6 years agoaggregator: Unify downstream flow return and flushing
Olivier Crête [Thu, 2 Apr 2015 02:10:11 +0000 (22:10 -0400)]
aggregator: Unify downstream flow return and flushing

Also means that having a non-OK downstream flow return
wakes up the chain functions.

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

6 years agoaggregator: Flushing is always in pad lock, no need to atomics
Olivier Crête [Thu, 2 Apr 2015 01:45:01 +0000 (21:45 -0400)]
aggregator: Flushing is always in pad lock, no need to atomics

The usage of atomics was always doubtful as it was used to release a
GCond

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

6 years agoaggregator: Reset pending_eos on pad flush
Olivier Crête [Thu, 2 Apr 2015 01:38:11 +0000 (21:38 -0400)]
aggregator: Reset pending_eos on pad flush

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

6 years agoaggregator: Unify code to set a pad flushing
Olivier Crête [Thu, 2 Apr 2015 01:37:25 +0000 (21:37 -0400)]
aggregator: Unify code to set a pad flushing

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

6 years agoaggregator: Query latency on first incoming buffer.
Olivier Crête [Sat, 7 Mar 2015 02:12:52 +0000 (21:12 -0500)]
aggregator: Query latency on first incoming buffer.

And keep on querying upstream until we get a reply.

Also, the _get_latency_unlocked() method required being calld
with a private lock, so removed the _unlocked() variant from the API.
And it now returns GST_CLOCK_TIME_NONE when the element is not live as
we think that 0 upstream latency is possible.

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

6 years agoaggregator: Be more aggressive with invalid replies to our latency query
Olivier Crête [Sat, 7 Mar 2015 02:12:13 +0000 (21:12 -0500)]
aggregator: Be more aggressive with invalid replies to our latency query

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

6 years agoaggregatory: don't redefine GST_FLOW_CUSTOM_SUCCESS
Matthew Waters [Sat, 7 Mar 2015 15:04:11 +0000 (02:04 +1100)]
aggregatory: don't redefine GST_FLOW_CUSTOM_SUCCESS

6 years agoaggregator: Use standard upstream latency querying logic
Arun Raghavan [Thu, 26 Feb 2015 18:56:00 +0000 (00:26 +0530)]
aggregator: Use standard upstream latency querying logic

The same functionality is duplicated in the default latency querying
now.

6 years agoaggregator: Use src_lock to protect latency related members
Olivier Crete [Fri, 20 Feb 2015 02:21:56 +0000 (21:21 -0500)]
aggregator: Use src_lock to protect latency related members

One has to use the src_lock anyway to protect the min/max/live so they
can be notified atomically to the src thread to wake it up on changes,
such as property changes. So no point in having a second lock.

Also, the object lock was being held across a call to
GST_ELEMENT_WARNING, guaranteeing a deadlock.

6 years agoaggregator: Remove untrue comment
Olivier Crête [Thu, 19 Feb 2015 23:53:32 +0000 (18:53 -0500)]
aggregator: Remove untrue comment

6 years agoaggregator: Don't try to push tags while flush seeking
Olivier Crête [Thu, 19 Feb 2015 23:30:35 +0000 (18:30 -0500)]
aggregator: Don't try to push tags while flush seeking

The downstream segment could have been flushed already, so
need to re-send the segment event before re-sending the tags.

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

6 years agoaggregator: Use the sinkpads iterator directly to query upstream latencies
Sebastian Dröge [Thu, 19 Feb 2015 09:04:28 +0000 (11:04 +0200)]
aggregator: Use the sinkpads iterator directly to query upstream latencies

While gst_aggregator_iterate_sinkpads() makes sure that every pad is only
visited once, even when the iterator has to resync, this is not all we have
to do for querying the latency. When the iterator resyncs we actually have
to query all pads for the latency again and forget our previous results. It
might have happened that a pad was removed, which influenced the result of
the latency query.

6 years agoaggregator: Move gst_aggregator_get_latency_unlocked() a bit
Sebastian Dröge [Thu, 19 Feb 2015 08:57:09 +0000 (10:57 +0200)]
aggregator: Move gst_aggregator_get_latency_unlocked() a bit

It was between another function and its helper function before, which was
confusing when reading the code as it had nothing to do with the other
functions.

6 years agoaggregator: Fail the latency query if one of the upstream queries fails
Sebastian Dröge [Wed, 18 Feb 2015 23:28:06 +0000 (01:28 +0200)]
aggregator: Fail the latency query if one of the upstream queries fails

6 years agoaggregator: Document locking order
Olivier Crête [Wed, 18 Feb 2015 20:53:53 +0000 (15:53 -0500)]
aggregator: Document locking order

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