platform/upstream/gstreamer.git
7 years agoaudioaggregator: remove buffer!=NULL check
Stefan Sauer [Thu, 5 Oct 2017 15:54:34 +0000 (17:54 +0200)]
audioaggregator: remove buffer!=NULL check

Acording to the logic this cannot happen (we already check this before). So
add a assert like we do above and remove the check. This make it clearer that
we check for the offset range.
Also remove a dead assignment since we reassign this a few lines below.

7 years agoaudioaggreator: update docs
Stefan Sauer [Thu, 5 Oct 2017 15:52:37 +0000 (17:52 +0200)]
audioaggreator: update docs

Remove wrote references to collectpads. Document the units.

7 years agoaudioaggregator: pass blocksize to mix_buffer()
Stefan Sauer [Thu, 5 Oct 2017 06:11:29 +0000 (08:11 +0200)]
audioaggregator: pass blocksize to mix_buffer()

No need to recalc the value twice per run. Establishes that it is the same
value.

7 years agoaudioaggregator: rename _fill_buffer() to _queue_new_buffer()
Stefan Sauer [Thu, 5 Oct 2017 06:12:45 +0000 (08:12 +0200)]
audioaggregator: rename _fill_buffer() to _queue_new_buffer()

It does not fill a buffer. Rename it and add a short comment.

7 years agoaudioaggregator: reduce variable scope
Stefan Sauer [Mon, 2 Oct 2017 14:57:21 +0000 (16:57 +0200)]
audioaggregator: reduce variable scope

This is a non-functional change that makes the code more alike to the previous
check. I should be more obvious when we drop a buffer.

7 years agoaudioaggregator: update comment for aggregate
Stefan Sauer [Mon, 2 Oct 2017 07:40:50 +0000 (09:40 +0200)]
audioaggregator: update comment for aggregate

Replace collect-pads left-over. Remove first paragraph, we're not doing this.
Remove 3), 4) since this is not per pad.

7 years agoaudioaggregator: fix typo in comment
Stefan Sauer [Mon, 18 Sep 2017 04:05:03 +0000 (21:05 -0700)]
audioaggregator: fix typo in comment

7 years agotests: simplify audiomixer test
Stefan Sauer [Sun, 10 Sep 2017 18:55:07 +0000 (20:55 +0200)]
tests: simplify audiomixer test

Use _link_many() and reuse a helper to reduce the test code.

7 years agoaudioaggregator: use local var
Stefan Sauer [Sun, 23 Jul 2017 11:26:23 +0000 (13:26 +0200)]
audioaggregator: use local var

Instead of the self->priv-> deref use the local var we created already.

7 years agoaudio: mark symbols explicitly for export with GST_EXPORT
Tim-Philipp Müller [Mon, 17 Jul 2017 23:29:56 +0000 (00:29 +0100)]
audio: mark symbols explicitly for export with GST_EXPORT

7 years agotests: audiomixer: set all properties at once
Stefan Sauer [Sat, 15 Jul 2017 19:28:38 +0000 (21:28 +0200)]
tests: audiomixer: set all properties at once

7 years agotests: audiomixer: use the buffer helper for other tests too
Stefan Sauer [Sat, 15 Jul 2017 17:33:21 +0000 (19:33 +0200)]
tests: audiomixer: use the buffer helper for other tests too

7 years agoaudiomixer: document caps negotiation raciness
Tim-Philipp Müller [Fri, 14 Jul 2017 12:54:31 +0000 (13:54 +0100)]
audiomixer: document caps negotiation raciness

Until we land conversion support in audioaggregator (#773762).

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

7 years agoaudiomixer: add a helper for buffer creation
Stefan Sauer [Fri, 14 Jul 2017 06:09:25 +0000 (08:09 +0200)]
audiomixer: add a helper for buffer creation

This makes the test setup easier to read.

7 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.

7 years agoaudiomixer: use test helper once more
Stefan Sauer [Thu, 13 Jul 2017 19:54:55 +0000 (21:54 +0200)]
audiomixer: use test helper once more

7 years agoaudiomixer: more test cleanups
Stefan Sauer [Mon, 10 Jul 2017 19:08:09 +0000 (21:08 +0200)]
audiomixer: more test cleanups

Port over the test helpers from the adder tests.

7 years agoaudiomixer: refactor test
Stefan Sauer [Mon, 10 Jul 2017 18:16:10 +0000 (20:16 +0200)]
audiomixer: refactor test

Apply cleanups from the adder tests. Use a fixture for common code.

7 years agotests: Make audiomixer test_clip verify the resulting timestamps too
Olivier Crête [Mon, 22 May 2017 21:06:01 +0000 (23:06 +0200)]
tests: Make audiomixer test_clip verify the resulting timestamps too

7 years agotests: audiointerleave: Remove drain with manual clock
Olivier Crête [Mon, 22 May 2017 22:52:27 +0000 (00:52 +0200)]
tests: audiointerleave: Remove drain with manual clock

Now that the queries go onto the queue, you may need to pull the crank
in order for them to be processed, making this test difficult.

7 years agoaudioaggregate: Don't hold object locks across calls to aggregate_one
Olivier Crête [Sat, 20 May 2017 17:00:23 +0000 (19:00 +0200)]
audioaggregate: Don't hold object locks across calls to aggregate_one

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

7 years agoaudioaggregator: Use downstream allocator and params if available
Olivier Crête [Sat, 20 May 2017 15:59:19 +0000 (17:59 +0200)]
audioaggregator: Use downstream allocator and params if available

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

7 years agoaudiointerleave: Take object lock while modifying channel count
Olivier Crête [Sat, 20 May 2017 15:47:04 +0000 (17:47 +0200)]
audiointerleave: Take object lock while modifying channel count

7 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

7 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

7 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

7 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

7 years agoRemove plugin specific static build option
Nicolas Dufresne [Tue, 16 May 2017 18:05:52 +0000 (14:05 -0400)]
Remove plugin specific static build option

Static and dynamic plugins now have the same interface. The standard
--enable-static/--enable-shared toggle are sufficient.

7 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

7 years agoaudiointerleave: don't overflow channel map with >64 channels
Douglas Bagnall [Fri, 31 Mar 2017 10:40:05 +0000 (23:40 +1300)]
audiointerleave: don't overflow channel map with >64 channels

When there are more than 64 channels, we don't want to exceed the
bounds of the ordering_map buffer, and in these cases we don't want to
remap at all. Here we avoid doing that.

Based on a patch originally for plugins-good/interleave in
https://bugzilla.gnome.org/show_bug.cgi?id=780331

8 years agoFix incorrect return type in several functions
Nirbheek Chauhan [Thu, 27 Oct 2016 03:38:41 +0000 (09:08 +0530)]
Fix incorrect return type in several functions

All these should return GstFlowReturn, not gboolean

8 years agoAdd support for Meson as alternative/parallel build system
Nirbheek Chauhan [Fri, 12 Aug 2016 15:51:45 +0000 (21:21 +0530)]
Add support for Meson as alternative/parallel build system

https://github.com/mesonbuild/meson

With contributions from:

Tim-Philipp Müller <tim@centricular.com>
Matej Knopp <matej.knopp@gmail.com>
Jussi Pakkanen <jpakkane@gmail.com> (original port)

Highlights of the features provided are:
* Faster builds on Linux (~40-50% faster)
* The ability to build with MSVC on Windows
* Generate Visual Studio project files
* Generate XCode project files
* Much faster builds on Windows (on-par with Linux)
* Seriously fast configure and building on embedded

... and many more. For more details see:

http://blog.nirbheek.in/2016/05/gstreamer-and-meson-new-hope.html
http://blog.nirbheek.in/2016/07/building-and-developing-gstreamer-using.html

Building with Meson should work on both Linux and Windows, but may
need a few more tweaks on other operating systems.

8 years agotests: fix bus leak
Guillaume Desmottes [Fri, 15 Jul 2016 08:31:35 +0000 (10:31 +0200)]
tests: fix bus leak

gst_bus_remove_signal_watch() has to be called to release the ref
taken by gst_bus_add_signal_watch().

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

8 years agofix event leaks in tests
Guillaume Desmottes [Thu, 19 May 2016 08:19:20 +0000 (11:19 +0300)]
fix event leaks in tests

The events are supposed to be unreffed when finishing the test, not
reffed.

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

8 years agoaudiointerleave: fix message leaks by flushing the bus
Guillaume Desmottes [Thu, 19 May 2016 08:19:01 +0000 (11:19 +0300)]
audiointerleave: fix message leaks by flushing the bus

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

8 years agoaudioaggregator: fix buffer leak
Guillaume Desmottes [Thu, 19 May 2016 08:16:37 +0000 (11:16 +0300)]
audioaggregator: fix buffer leak

If the pad was still owning a buffer when being destroyed it was leaked.

Fix a leak with the test_flush_start_flush_stop test.

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

8 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

8 years agoaudio: Move audioaggregator base class to a library
Sebastian Dröge [Sat, 16 Jan 2016 16:56:26 +0000 (18:56 +0200)]
audio: Move audioaggregator base class to a library

It's useful enough already to be used in other elements for audio aggregation,
let's give people the opportunity to use it and give it some API testing.

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

8 years agoplugins-bad: Fix example pipelines
Vineeth TM [Mon, 14 Dec 2015 02:09:46 +0000 (11:09 +0900)]
plugins-bad: Fix example pipelines

rename gst-launch --> gst-launch-1.0
replace old elements with new elements(ffmpegcolorspace -> videoconvert, ffenc_** -> avenc_**)
fix caps in examples

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

8 years agoaudiomixer: register function name for debugging just once
Tim-Philipp Müller [Tue, 24 Nov 2015 00:20:36 +0000 (00:20 +0000)]
audiomixer: register function name for debugging just once

Not every time aggregate is called...

9 years agoaudioaggregator: Improve log messages
Olivier Crête [Tue, 3 Nov 2015 00:40:28 +0000 (19:40 -0500)]
audioaggregator: Improve log messages

Make the level of log messages saner and improve some.

9 years agoliveadder: Make latency property be a uint in millisecs
Olivier Crête [Mon, 26 Oct 2015 23:58:04 +0000 (19:58 -0400)]
liveadder: Make latency property be a uint in millisecs

This restores roughly the same behaviour as the old liveadder element.
Except that the latency now also includes the output-buffer-duration.

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

9 years agoliveadder: latency property is an uint64 in audiomixer
Tim-Philipp Müller [Mon, 12 Oct 2015 08:36:29 +0000 (09:36 +0100)]
liveadder: latency property is an uint64 in audiomixer

9 years agoliveadder: Remove plugin, replace by compat subclass of audiomixer
Olivier Crête [Sun, 4 Oct 2015 23:55:36 +0000 (00:55 +0100)]
liveadder: Remove plugin, replace by compat subclass of audiomixer

New subclass with a similar behaviour as the old liveadder, but
a slightly different API as the latency is in nanoseconds, not
milliseconds. Also, the new liveadder has a effective latency that
is latency + output-buffer-duration. In practice, just setting a non-zero
latency with the new audiomixer gives you the right behavior in 99% of the
cases.

9 years agoaudioaggregator: Fix build error
Vineeth TM [Tue, 6 Oct 2015 23:48:15 +0000 (08:48 +0900)]
audioaggregator: Fix build error

Build error due to wrong argument type in debug message
aagg->priv->offset and next_offset are of type int64, but uint64
formatter is being used in logs. Changing all those to int64

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

9 years agoaudioaggregator: Select the initial offset based on the start segment position
Sebastian Dröge [Wed, 30 Sep 2015 17:01:21 +0000 (19:01 +0200)]
audioaggregator: Select the initial offset based on the start segment position

instead of always using 0. Otherwise we might output a lot of silence in the
beginning instead of outputting from the relevant position.

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

9 years agoaudiointerleave: typecast bit-mask to guint64 to fix segmentation fault
Vineeth TM [Wed, 30 Sep 2015 04:13:19 +0000 (13:13 +0900)]
audiointerleave: typecast bit-mask to guint64 to fix segmentation fault

While creating caps in audiointerleave tests, bitmask is being set as 0x9
This is resulting in segmentation fault. Fix the same by typecasting to guint64

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

9 years agoaudiomixer: fix deadlock when G_DISABLE_ASSERT is not defined
Tim-Philipp Müller [Sat, 26 Sep 2015 09:21:41 +0000 (10:21 +0100)]
audiomixer: fix deadlock when G_DISABLE_ASSERT is not defined

This makes the audiomixer unit test time out in master.
Broke with 587e7c4

9 years agoaudioaggregator: Stop using deprecated gst_segment_to_position()
Sebastian Dröge [Fri, 25 Sep 2015 22:17:55 +0000 (00:17 +0200)]
audioaggregator: Stop using deprecated gst_segment_to_position()

9 years agoaudioaggregator: Only skip the remaining part of a GAP buffer
Sebastian Dröge [Fri, 18 Sep 2015 16:00:05 +0000 (18:00 +0200)]
audioaggregator: Only skip the remaining part of a GAP buffer

We might've queued up a GAP buffer that is only partially inside the current
output buffer (i.e. we received it too late!). In that case we should only
skip the part of the GAP buffer that is inside the current output buffer, not
also the remaining part. Otherwise we forward this pad too far into the future
and break synchronization.

9 years agoDon't throw compiler warnings with G_DISABLE_ASSERT
Jan Schmidt [Thu, 17 Sep 2015 14:20:13 +0000 (00:20 +1000)]
Don't throw compiler warnings with G_DISABLE_ASSERT

Disable code that warns about unused variables when G_DISABLE_ASSERT
is defined, as it is in tarballs and pre-releases.

9 years agoaudioaggregator: Fix mixup of running times and segment positions
Sebastian Dröge [Fri, 11 Sep 2015 19:37:08 +0000 (21:37 +0200)]
audioaggregator: Fix mixup of running times and segment positions

We have to queue buffers based on their running time, not based on
the segment position.

Also return running time from GstAggregator::get_next_time() instead of
a segment position, as required by the API.

Also only update the segment position after we pushed a buffer, otherwise
we're going to push down a segment event with the next position already.

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

9 years agoaudioaggregator: Use stream time in the position query instead of segment position
Sebastian Dröge [Fri, 11 Sep 2015 14:56:40 +0000 (16:56 +0200)]
audioaggregator: Use stream time in the position query instead of segment position

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

9 years agotests: audiomixer: remove duplicated word in comment
hoonhee.lee [Fri, 21 Aug 2015 07:44:43 +0000 (16:44 +0900)]
tests: audiomixer: remove duplicated word in comment

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

9 years agotests: Add audiointerleave test to show that queuing works
Olivier Crête [Thu, 2 Jul 2015 22:37:28 +0000 (18:37 -0400)]
tests: Add audiointerleave test to show that queuing works

This tests fails without the queuing patch because incoming buffers are
not delivered before they are needed.

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

9 years agoaudiointerleave: Avoid caps processing if not yet negotiated
Olivier Crête [Thu, 2 Jul 2015 22:33:43 +0000 (18:33 -0400)]
audiointerleave: Avoid caps processing if not yet negotiated

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

9 years agoaudioaggregator: On timeout, resync pads with not enough data
Olivier Crête [Mon, 16 Mar 2015 21:06:46 +0000 (17:06 -0400)]
audioaggregator: On timeout, resync pads with not enough data

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

9 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

9 years agoaudioaggregator: Register function name
Olivier Crête [Wed, 22 Jul 2015 23:27:19 +0000 (19:27 -0400)]
audioaggregator: Register function name

Otherwise, it sometimes segfaults with debugging enabled

9 years agoaudioaggregator: Use 1.0 style buffer allocation
Olivier Crête [Wed, 22 Jul 2015 23:26:42 +0000 (19:26 -0400)]
audioaggregator: Use 1.0 style buffer allocation

9 years agoaudioaggregator: Sync pad values before aggregating
Nirbheek Chauhan [Tue, 19 May 2015 10:38:08 +0000 (16:08 +0530)]
audioaggregator: Sync pad values before aggregating

We need to sync the pad values before taking the aggregator and pad locks
otherwise the element will just deadlock if there's any property changes
scheduled using GstController since that involves taking the aggregator and pad
locks.

Also add a test for this.

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

9 years agoaudioaggregator: Read output buffer duration with lock held
Olivier Crête [Wed, 22 Jul 2015 00:52:23 +0000 (20:52 -0400)]
audioaggregator: Read output buffer duration with lock held

9 years agoaudiomixer: fix misleading documentation copied from adder
Tim-Philipp Müller [Tue, 9 Jun 2015 13:37:36 +0000 (14:37 +0100)]
audiomixer: fix misleading documentation copied from adder

9 years agoRelease 1.5.1
Sebastian Dröge [Sun, 7 Jun 2015 08:55:35 +0000 (10:55 +0200)]
Release 1.5.1

9 years agotests: audiointerleave: test not setting positions
Olivier Crête [Tue, 2 Jun 2015 19:45:13 +0000 (15:45 -0400)]
tests: audiointerleave: test not setting positions

Disable "channel-positions-from-input", but without actually giving
a position table, so every position should be NONE

9 years agotests: Fix indentation in audiointerleave test
Olivier Crête [Tue, 2 Jun 2015 19:44:57 +0000 (15:44 -0400)]
tests: Fix indentation in audiointerleave test

9 years agoaudiointerleave: Always have "channels" be the actual pad count
Olivier Crête [Mon, 1 Jun 2015 23:43:20 +0000 (19:43 -0400)]
audiointerleave: Always have "channels" be the actual pad count

Don't force it anywhere

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

9 years agoaudiointerleave: Use the channel count from the set caps
Olivier Crête [Mon, 1 Jun 2015 23:42:49 +0000 (19:42 -0400)]
audiointerleave: Use the channel count from the set caps

This is the same number that was used to allocate the buffer

9 years agoRevert "doc: Workaround gtkdoc issue"
Stefan Sauer [Mon, 18 May 2015 18:16:32 +0000 (20:16 +0200)]
Revert "doc: Workaround gtkdoc issue"

This reverts commit ff6c736fe08e01f4320c4b02e811a0b57cf97cc1.

This is fixed by the gtk-doc 1.23 release.

<para> cannot contain <refsect2>:
http://www.docbook.org/tdg/en/html/para.html
http://www.docbook.org/tdg/en/html/refsect2.html

9 years agodoc: Workaround gtkdoc issue
Nicolas Dufresne [Sun, 17 May 2015 03:38:14 +0000 (23:38 -0400)]
doc: Workaround gtkdoc issue

With gtkdoc 1.22, the XML generator fails when a itemizedlist is
followed by a refsect2. Workaround the issue by wrapping the
refsect2 into para.

9 years agotests: fix type mismatch in varargs passing
Vincent Penquerc'h [Thu, 9 Apr 2015 15:20:44 +0000 (16:20 +0100)]
tests: fix type mismatch in varargs passing

A bitmask is 64 bits, but integer immediates are passed as int
in varargs, which happen to be 32 bit with high probability.

This triggered a valgrind jump-relies-on-uninitalized-value
report well away from the site, since it doesn't trigger on
stack accesses, and there must have been enough zeroes to stop
g_object_set at the right place.

9 years agoaudiomixer: Allow downstream caps with a non-default channel-mask
Olivier Crête [Thu, 2 Apr 2015 00:32:41 +0000 (20:32 -0400)]
audiomixer: Allow downstream caps with a non-default channel-mask

Instead of failing, take the downstream channel mask if the channel
count is 1.

9 years agoaudioaggregator: check sink caps are valid
Luis de Bethencourt [Tue, 24 Mar 2015 16:18:22 +0000 (16:18 +0000)]
audioaggregator: check sink caps are valid

9 years agoRevert "audioaggregator: check sink caps are valid"
Luis de Bethencourt [Tue, 24 Mar 2015 16:17:00 +0000 (16:17 +0000)]
Revert "audioaggregator: check sink caps are valid"

This reverts commit 6d4d0d1cdf7c7531fbf72ce39e1eab1260d20550.

Never put code with side effects into an assertion, it can be compiled out

9 years agoaudioaggregator: check sink caps are valid
Luis de Bethencourt [Tue, 24 Mar 2015 15:45:25 +0000 (15:45 +0000)]
audioaggregator: check sink caps are valid

CID #1291622

9 years agoaudiointerleave: Add unit tests
Olivier Crête [Fri, 14 Nov 2014 01:39:11 +0000 (20:39 -0500)]
audiointerleave: Add unit tests

Almost a copy of the "interleave" unit tests, improved to support
the thread on the src pad on GstAggregator.

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

9 years agoaudiointerleave: Set src caps in aggregate
Olivier Crête [Fri, 6 Mar 2015 18:49:48 +0000 (13:49 -0500)]
audiointerleave: Set src caps in aggregate

This prevents races between the setcaps of the sink pads

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

9 years agoaudiointerleave: Add interleave element based on audioaggregator
Olivier Crête [Thu, 13 Nov 2014 20:40:15 +0000 (15:40 -0500)]
audiointerleave: Add interleave element based on audioaggregator

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

9 years agoaudioaggregator: Print a message when a buffer is late
Olivier Crête [Fri, 6 Mar 2015 21:51:12 +0000 (16:51 -0500)]
audioaggregator: Print a message when a buffer is late

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

9 years agoaudioaggregator: Don't re-send the caps if they did not change
Olivier Crête [Sat, 15 Nov 2014 22:54:51 +0000 (17:54 -0500)]
audioaggregator: Don't re-send the caps if they did not change

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

9 years agoaudioaggregator: Split base class from audiomixer
Olivier Crête [Thu, 6 Nov 2014 22:15:17 +0000 (17:15 -0500)]
audioaggregator: Split base class from audiomixer

Also:
-  Don't modify size on early buffer
   The size is the size of the buffer, not of remaining part.
- Use the input caps when manipulating the input buffer
   Also store in in the sink pad
- Reply to the position query in bytes too
- Put GAP flag on output if all inputs are GAP data
- Only try to clip buffer if the incoming segment is in time or samples
- Use incoming segment with incoming timestamp
   Handle non-time segments and NONE timestamps
- Don't reset the position when pushing out new caps
- Make a number of member variables private
- Correctly handle case where no pad has a buffer
  If none of the pads have buffers that can be handled, don't claim to be EOS.
- Ensure proper locking
- Only support time segments

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

9 years agoaudiomixer: Release pad object lock before dropping buffer
Olivier Crête [Sun, 8 Mar 2015 03:08:40 +0000 (22:08 -0500)]
audiomixer: Release pad object lock before dropping buffer

Otherwise, the locking order is violated and deadlocks happen.

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

9 years agoaudiomixer: Only ignore pads with no buffers on timeout
Olivier Crête [Sat, 7 Mar 2015 01:22:13 +0000 (20:22 -0500)]
audiomixer: Only ignore pads with no buffers on timeout

When the timeout is reached, only ignore pads with no buffers, iterate
over the other pads until all buffers have been read. This is important
in the cases where the input buffers are smaller than the output buffer.

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

9 years agoaudiomixer: Only advance by the buffer size when a buffer is late
Olivier Crête [Sat, 7 Mar 2015 01:25:03 +0000 (20:25 -0500)]
audiomixer: Only advance by the buffer size when a buffer is late

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

9 years agoaudiomixer: Fix discont detection and buffer alignment code
Sebastian Dröge [Thu, 12 Mar 2015 17:11:31 +0000 (17:11 +0000)]
audiomixer: Fix discont detection and buffer alignment code

Actually accumulate the sample counter to check the accumulated error
between actual timestamps and expected ones instead of just resetting
the error back to 0 with every new buffer.

Also don't reset discont_time whenever we don't resync. The whole point of
discont_time is to remember when we first detected a discont until we actually
act on it a bit later if the discont stayed around for discont_wait time.

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

9 years agoaudiomixer: Add locking to fill_buffer and fix mix_buffer
Nirbheek Chauhan [Wed, 11 Mar 2015 20:19:58 +0000 (01:49 +0530)]
audiomixer: Add locking to fill_buffer and fix mix_buffer

The audiomixer pad struct fields may be changed from other threads

9 years agoaudiomixer: Mark a discont when we receive a new segment event
Nirbheek Chauhan [Wed, 11 Mar 2015 20:26:44 +0000 (01:56 +0530)]
audiomixer: Mark a discont when we receive a new segment event

This allows us to handle new segment events correctly; either by dropping
buffers or inserting silence; for example if the offset is changed on an srcpad
connected to audiomixer.

9 years agoRevert "audiomixer: Latency is twice the output buffer duration, not only once"
Sebastian Dröge [Wed, 4 Mar 2015 12:16:03 +0000 (13:16 +0100)]
Revert "audiomixer: Latency is twice the output buffer duration, not only once"

This reverts commit d387cf67df91b59540f32ee17b4c02f747969add.

The analysis was wrong: The first 20ms of latency are introduced by the source
already and put into the latency query, making it only necessary to cover the
additional 20ms of audiomixer inside audiomixer.

9 years agoaudiomixer: Latency is twice the output buffer duration, not only once
Sebastian Dröge [Tue, 3 Mar 2015 19:03:55 +0000 (20:03 +0100)]
audiomixer: Latency is twice the output buffer duration, not only once

Let's assume a source that outputs outputs 20ms buffers, and audiomixer having
a 20ms output buffer duration. However timestamps don't align perfectly, the
source buffers are offsetted by 5ms.

For our ASCII art picture, each letter is 5ms, each pipe is the start of a
20ms buffer. So what happens is the following:

0   20  40  60
OOOOOOOOOOOOOOOO
|   |   |   |

  5   25  45  65
  IIIIIIIIIIIIIIII
  |   |   |   |

This means that the second output buffer (20 to 40ms) only gets its last 5ms
at time 45ms (the timestamp of the next buffer is the time when the buffer
arrives). But if we only have a latency of 20ms, we would wait until 40ms
to generate the output buffer and miss the last 5ms of the input buffer.

9 years agoaudiomixer: use new gst_aggregator_pad_drop_buffer()
Tim-Philipp Müller [Fri, 13 Feb 2015 16:06:34 +0000 (16:06 +0000)]
audiomixer: use new gst_aggregator_pad_drop_buffer()

9 years agotests: remove GST_DISABLE_PARSE guards from two tests that don't require it
Tim-Philipp Müller [Thu, 12 Feb 2015 15:48:07 +0000 (15:48 +0000)]
tests: remove GST_DISABLE_PARSE guards from two tests that don't require it

9 years agoaudiomixer: calculate stream_time used to sync pad values correctly
Tim-Philipp Müller [Thu, 12 Feb 2015 11:26:44 +0000 (11:26 +0000)]
audiomixer: calculate stream_time used to sync pad values correctly

Use pad (input) segment to calculate the stream time from the
input timestamp, not the aggregator (output) segment.

9 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

9 years agoaudiomixer: remove now-unused base_time field in object structure
Tim-Philipp Müller [Thu, 5 Feb 2015 15:57:59 +0000 (15:57 +0000)]
audiomixer: remove now-unused base_time field in object structure

9 years agotests: audiomixer: add unit test for proper segment.base handling
Tim-Philipp Müller [Thu, 5 Feb 2015 15:23:04 +0000 (15:23 +0000)]
tests: audiomixer: add unit test for proper segment.base handling

As adjusted by gst_pad_set_offset(), or when doing segment seeks
or looping for example. See previous audiomixer commit.

9 years agoaudiomixer: Remove weird and wrong segment handling
Sebastian Dröge [Thu, 5 Feb 2015 15:02:54 +0000 (16:02 +0100)]
audiomixer: Remove weird and wrong segment handling

There's no reason why audiomixer should override the segment
base of upstream with whatever value it got from a SEEK event,
or even worse... with 0 if there was no SEEK event yet. This
broke synchronization if upstream provided a segment base other
than 0, e.g. when using pad offsets.
Also that this code did things conditional on the element's state
should've been a big warning already that something is just wrong.
If this breaks anything else now, let's fix it properly :)

Also don't do fancy segment position trickery when receiving a
segment event. It's just not correct.

9 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

9 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

9 years agoaudiomixer: Make flush start/stop test non-racy
Olivier Crête [Thu, 22 Jan 2015 00:09:13 +0000 (19:09 -0500)]
audiomixer: Make flush start/stop test non-racy

The flush stop could have happened between the source trying
to push the segment event and the buffer, this would cause a warning.
Prevent that by taking the source's stream lock while flushing.

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

9 years agoaudiomixer: Replace racy timeout based tested with drain query
Olivier Crête [Thu, 22 Jan 2015 22:41:24 +0000 (17:41 -0500)]
audiomixer: Replace racy timeout based tested with drain query

Using the drain query, we can be certain that the buffer has done going
through the aggregator by taking the stream locks.

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