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

6 years agoaggregator: Rename confusinly named SRC_STREAM_LOCK macros to SRC_LOCK
Olivier Crête [Wed, 18 Feb 2015 20:11:14 +0000 (15:11 -0500)]
aggregator: Rename confusinly named SRC_STREAM_LOCK macros to SRC_LOCK

This will match the name of the lock itself. It is also not a stream
lock as it not recursive and not held while pushing.

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

6 years agoaggregator: Rename confusingly named stream lock to flush lock
Olivier Crête [Wed, 18 Feb 2015 20:06:01 +0000 (15:06 -0500)]
aggregator: Rename confusingly named stream lock to flush lock

This lock is not what is commonly known as a "stream lock" in GStremer,
it's not recursive and it's taken from the non-serialized FLUSH_START event.

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

6 years agoaggregator: Fix macro indendation
Olivier Crête [Wed, 18 Feb 2015 20:04:04 +0000 (15:04 -0500)]
aggregator: Fix macro indendation

Changes no code

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

6 years agoaggregator: drop GAP events until we handle them properly
Tim-Philipp Müller [Fri, 13 Feb 2015 23:45:20 +0000 (23:45 +0000)]
aggregator: drop GAP events until we handle them properly

6 years agoaggregator: use new gst_aggregator_pad_drop_buffer()
Tim-Philipp Müller [Fri, 13 Feb 2015 15:53:19 +0000 (15:53 +0000)]
aggregator: use new gst_aggregator_pad_drop_buffer()

6 years agoaggregator: add gst_aggregator_pad_drop_buffer()
Tim-Philipp Müller [Fri, 13 Feb 2015 15:49:50 +0000 (15:49 +0000)]
aggregator: add gst_aggregator_pad_drop_buffer()

steal_buffer() + unref seems to be a wide-spread idiom
(which perhaps indicates that something is not quite
right with the way aggregator pad works currently).

6 years agoaggregator: only post latency message if anything changed
Tim-Philipp Müller [Thu, 12 Feb 2015 13:32:39 +0000 (13:32 +0000)]
aggregator: only post latency message if anything changed

Perhaps we should check for element state as well and
only post it if in PLAYING state.

6 years agoImprove and fix LATENCY query handling
Sebastian Dröge [Wed, 11 Feb 2015 13:16:21 +0000 (14:16 +0100)]
Improve and fix LATENCY query handling

This now follows the design docs everywhere, especially the maximum latency
handling.

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

6 years agoaggregator: Pause srcpad task on flow errors
Sebastian Dröge [Tue, 10 Feb 2015 09:49:16 +0000 (10:49 +0100)]
aggregator: Pause srcpad task on flow errors

Otherwise we will call the task function over and over again until
upstream finally handled the flow return and shuts us down.

6 years agoaggregator: Streamline latency calculations
Sebastian Dröge [Fri, 6 Feb 2015 09:59:27 +0000 (10:59 +0100)]
aggregator: Streamline latency calculations

Min latency can never be invalid, latency property can never be invalid
either. So no need to check for all these things in various places.

6 years agoaggregator: If upstream has no max latency but the subclass has, take the subclass...
Sebastian Dröge [Fri, 6 Feb 2015 09:36:28 +0000 (10:36 +0100)]
aggregator: If upstream has no max latency but the subclass has, take the subclass max latency

6 years agoaggregator: Fix min>max latency error check
Sebastian Dröge [Fri, 6 Feb 2015 09:33:59 +0000 (10:33 +0100)]
aggregator: Fix min>max latency error check

We have to include the upstream latency, our own latency and the subclass
latency in the calculations.

FIXME: This is still not entirely correct

6 years agoaggregator: Don't add the latency property to the max latency
Sebastian Dröge [Fri, 6 Feb 2015 09:30:59 +0000 (10:30 +0100)]
aggregator: Don't add the latency property to the max latency

It has no meaning for the max latency and is only used to increase the min
latency.

6 years agoaggregator: Cleanup locking around AggregatorPad flush related fields
Thibault Saunier [Mon, 26 Jan 2015 16:06:29 +0000 (17:06 +0100)]
aggregator: Cleanup locking around AggregatorPad flush related fields

And document the locking

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

6 years agoaggregator: keep chain functions as dumb as possible.
Mathieu Duponchelle [Mon, 26 Jan 2015 12:11:05 +0000 (13:11 +0100)]
aggregator: keep chain functions as dumb as possible.

+ A pad chain function has no business checking other pads,
  that's what the aggregate thread is for.

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

6 years agoaggregator: More fixes around locking when accessing protected private fields
Thibault Saunier [Mon, 26 Jan 2015 10:32:47 +0000 (11:32 +0100)]
aggregator: More fixes around locking when accessing protected private fields

In some more places we were accessing GstAggregator->segment
and GstAggregator->seqnum without holding the GST_OBJECT_LOCK

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

6 years agoaggregator: Make the PAD_LOCK private
Thibault Saunier [Mon, 26 Jan 2015 10:29:08 +0000 (11:29 +0100)]
aggregator: Make the PAD_LOCK private

Instead of using the GST_OBJECT_LOCK we should have
a dedicated mutex for the pad as it is also associated
with the mutex on the EVENT_MUTEX on which we wait
in the _chain function of the pad.

The GstAggregatorPad.segment is still protected with the
GST_OBJECT_LOCK.

Remove the gst_aggregator_pad_peak_unlocked method as it does not make
sense anymore with a private lock.

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

6 years agoaggregator: Hide GstAggregatorPad buffer and EOS fileds
Thibault Saunier [Mon, 26 Jan 2015 10:25:54 +0000 (11:25 +0100)]
aggregator: Hide GstAggregatorPad buffer and EOS fileds

And add a getter for the EOS.

The user should always use the various getters to access
those fields

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

6 years agoaggregator: Document locking of GstAggregatorPrivate members
Olivier Crête [Wed, 21 Jan 2015 23:41:43 +0000 (18:41 -0500)]
aggregator: Document locking of GstAggregatorPrivate members

Most of them are protected by the object lock, specify
which ones use a different lock.

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

6 years agoaggregator: Document how the segment is protected
Olivier Crête [Wed, 21 Jan 2015 23:47:09 +0000 (18:47 -0500)]
aggregator: Document how the segment is protected

Document that it can only be accessed with the object lock.

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

6 years agoaggregator: Protect all latency related members with the object lock
Olivier Crête [Thu, 22 Jan 2015 00:44:57 +0000 (19:44 -0500)]
aggregator: Protect all latency related members with the object lock

The locking was not consistent, now consistently use the object lock.

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

6 years agoaggregator: Document locking for gst_aggregator_get_latency_unlocked()
Olivier Crête [Thu, 22 Jan 2015 00:43:12 +0000 (19:43 -0500)]
aggregator: Document locking for gst_aggregator_get_latency_unlocked()

Renamed it to _unlocked() to make it clear.

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

6 years agoaggregator: Protect the srcpad caps negotiation with the stream lock
Olivier Crête [Thu, 22 Jan 2015 00:35:25 +0000 (19:35 -0500)]
aggregator: Protect the srcpad caps negotiation with the stream lock

Instead of adding another lock, use the srcpad stream lock, which is already
taken anyway to push out the new caps if needed.

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

6 years agoaggregator: Protect the tags with the object lock
Olivier Crête [Thu, 22 Jan 2015 00:33:18 +0000 (19:33 -0500)]
aggregator: Protect the tags with the object lock

The tags related variables were sometimes protected, sometimes not and
sometimes atomic. Put them all under the object lock.

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

6 years agoaggregator: Consistenly lock the flow_return state
Olivier Crête [Wed, 21 Jan 2015 23:53:20 +0000 (18:53 -0500)]
aggregator: Consistenly lock the flow_return state

Use the object's lock to protect it.

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

6 years agoaggregator: Consistently lock some members
Olivier Crête [Wed, 21 Jan 2015 23:45:36 +0000 (18:45 -0500)]
aggregator: Consistently lock some members

Some members sometimes used atomic access, sometimes where not locked at
all. Instead consistently use a mutex to protect them, also document
that.

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

6 years agoaggregator: Protect exported pad members with the pad's object lock
Olivier Crête [Wed, 14 Jan 2015 19:38:09 +0000 (14:38 -0500)]
aggregator: Protect exported pad members with the pad's object lock

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

6 years agoaggregator: Replace event lock with pad's object lock
Olivier Crête [Wed, 14 Jan 2015 19:35:15 +0000 (14:35 -0500)]
aggregator: Replace event lock with pad's object lock

Reduce the number of locks simplify code, what is protects
is exposed, but the lock was not.

Also means adding an _unlocked version of gst_aggregator_pad_steal_buffer().

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

6 years agoaggregator: Protect data with the same mutex as GCond
Olivier Crête [Sat, 10 Jan 2015 03:01:00 +0000 (22:01 -0500)]
aggregator: Protect data with the same mutex as GCond

Whenever a GCond is used, the safest paradigm is to protect
the variable which change is signalled by the GCond with the same
mutex that the GCond depends on.

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

6 years agoaggregator: Nitpick spacing/punctuation in debug logging
Nirbheek Chauhan [Wed, 14 Jan 2015 18:17:19 +0000 (23:47 +0530)]
aggregator: Nitpick spacing/punctuation in debug logging

6 years agoaggregator: Remove pointless atomic
Olivier Crête [Sat, 10 Jan 2015 02:51:40 +0000 (21:51 -0500)]
aggregator: Remove pointless atomic

It is only modified from the streaming thread

6 years agoaggregator: Fix query leak
Olivier Crête [Sat, 10 Jan 2015 02:30:36 +0000 (21:30 -0500)]
aggregator: Fix query leak

6 years agoaggregator: Print jitter from clock waiting in the debug logs
Sebastian Dröge [Fri, 9 Jan 2015 15:43:39 +0000 (16:43 +0100)]
aggregator: Print jitter from clock waiting in the debug logs

6 years agoaggregator: don't use iterator when setting flush pending on pads
Tim-Philipp Müller [Sun, 4 Jan 2015 17:15:37 +0000 (17:15 +0000)]
aggregator: don't use iterator when setting flush pending on pads

6 years agoaggregator: check if pads are ready more efficiently
Tim-Philipp Müller [Sun, 4 Jan 2015 16:57:05 +0000 (16:57 +0000)]
aggregator: check if pads are ready more efficiently

No need to use an iterator for this which creates a temporary
structure every time and also involves taking and releasing the
object lock many times in the course of iterating. Not to mention
all that GList handling in gst_aggregator_iterate_sinkpads().

6 years agoaggregator: name vfunc arguments consistently
Tim-Philipp Müller [Sun, 4 Jan 2015 12:59:19 +0000 (12:59 +0000)]
aggregator: name vfunc arguments consistently

6 years agoaggregator: add g-i transfer and scope annotations
Tim-Philipp Müller [Thu, 1 Jan 2015 15:46:00 +0000 (15:46 +0000)]
aggregator: add g-i transfer and scope annotations

6 years agoaggregator: register names of iterate_sinkpads functions with debug system
Tim-Philipp Müller [Thu, 1 Jan 2015 14:10:05 +0000 (14:10 +0000)]
aggregator: register names of iterate_sinkpads functions with debug system

6 years agoaggregator: reduce debug messages for taking/releasing logs to TRACE level
Tim-Philipp Müller [Thu, 1 Jan 2015 14:03:02 +0000 (14:03 +0000)]
aggregator: reduce debug messages for taking/releasing logs to TRACE level

Don't spam debug log with this stuff.

6 years agoaggregator: move property member into private structure
Tim-Philipp Müller [Wed, 31 Dec 2014 18:16:21 +0000 (18:16 +0000)]
aggregator: move property member into private structure

Our locking (or lack thereof) while accessing this also
looks generally quite dodgy.

6 years agoaggregator: remove empty dispose function
Tim-Philipp Müller [Wed, 31 Dec 2014 14:50:58 +0000 (14:50 +0000)]
aggregator: remove empty dispose function

6 years agoaggregator: give private functions namespace prefix
Tim-Philipp Müller [Tue, 30 Dec 2014 23:58:34 +0000 (23:58 +0000)]
aggregator: give private functions namespace prefix

Especially the GST_DEBUG_FUNCPTR ones.

6 years agoaggregator: fix up some docs comments in header
Tim-Philipp Müller [Wed, 31 Dec 2014 12:35:06 +0000 (12:35 +0000)]
aggregator: fix up some docs comments in header

6 years agoaggregator: remove now-unused system clock member
Tim-Philipp Müller [Tue, 30 Dec 2014 23:44:46 +0000 (23:44 +0000)]
aggregator: remove now-unused system clock member

6 years agoaggregator: make GstAggregatorPadForeachFunc take an GstAggregatorPad
Tim-Philipp Müller [Tue, 30 Dec 2014 19:22:01 +0000 (19:22 +0000)]
aggregator: make GstAggregatorPadForeachFunc take an GstAggregatorPad

6 years agoaggregator: bring start/stop vfunc semantics in line with other baseclasses
Tim-Philipp Müller [Tue, 30 Dec 2014 17:50:17 +0000 (17:50 +0000)]
aggregator: bring start/stop vfunc semantics in line with other baseclasses

Sub-class should not have to chain up to GstAggregator's start/stop
vfuncs, same as in GstBaseSrc, GstBaseSink, GstBaseTransform etc.

6 years agoaggregator: remove pointless GST_DEBUG_FUNCPTR
Tim-Philipp Müller [Sun, 28 Dec 2014 18:26:49 +0000 (18:26 +0000)]
aggregator: remove pointless GST_DEBUG_FUNCPTR

Not useful for GObject vfuncs.

6 years agoaggregator: remove duplicate pad parent_class variable
Tim-Philipp Müller [Sun, 28 Dec 2014 18:24:21 +0000 (18:24 +0000)]
aggregator: remove duplicate pad parent_class variable

G_DEFINE_TYPE already provides one, just need to use it.

6 years agoaggregator: add _CAST() variants for cast macros
Tim-Philipp Müller [Sun, 28 Dec 2014 18:22:57 +0000 (18:22 +0000)]
aggregator: add _CAST() variants for cast macros

6 years agoaggregator: make padding larger
Tim-Philipp Müller [Sun, 28 Dec 2014 01:13:33 +0000 (01:13 +0000)]
aggregator: make padding larger

Esp. the class structures, can't have enough
spare space for virtual functions.

6 years agoaggregator: Log to the pad instead of the element
Nirbheek Chauhan [Sat, 27 Dec 2014 10:45:41 +0000 (16:15 +0530)]
aggregator: Log to the pad instead of the element

More correct way of doing the same thing as before