Commit graph

94 commits

Author SHA1 Message Date
Stefan Sauer 0a2ff1ecda aggregator: fix type for latency property (int64 -> GStClockTime)
The value is used as GstClockTiem in the code. Adapt the hack^H^H^H^Hcode
in live-adder.
2017-10-23 11:41:17 +02:00
Tim-Philipp Müller da44d1f0a9 audiomixer: document caps negotiation raciness
Until we land conversion support in audioaggregator (#773762).

https://bugzilla.gnome.org/show_bug.cgi?id=777915
2017-07-14 13:54:48 +01:00
Olivier Crête 5443aa9ac8 audioaggregate: Don't hold object locks across calls to aggregate_one
https://bugzilla.gnome.org/show_bug.cgi?id=782878
2017-05-21 18:44:53 +02:00
Olivier Crête 57ede26031 audiointerleave: Take object lock while modifying channel count 2017-05-20 17:52:00 +02:00
Matthew Waters 7c53043386 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
2017-05-20 16:21:17 +02:00
Nicolas Dufresne 4261692187 Remove plugin specific static build option
Static and dynamic plugins now have the same interface. The standard
--enable-static/--enable-shared toggle are sufficient.
2017-05-16 14:05:52 -04:00
Thibault Saunier 78022a6e0c docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -03:00
Douglas Bagnall e83573fd8d 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
2017-03-31 14:11:56 +03:00
Nirbheek Chauhan 42af2d66d8 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.
2016-08-20 11:35:54 +01:00
Vineeth TM 8cdfb13658 bad: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763081
2016-03-24 14:56:51 +02:00
Sebastian Dröge 8a1fa31c67 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
2016-01-22 12:39:48 +02:00
Vineeth TM 7c42ba97d7 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
2015-12-15 10:30:49 +00:00
Tim-Philipp Müller 01f23d88f3 audiomixer: register function name for debugging just once
Not every time aggregate is called...
2015-11-24 15:17:30 +00:00
Olivier Crête f0cbeb4140 audioaggregator: Improve log messages
Make the level of log messages saner and improve some.
2015-11-02 19:40:28 -05:00
Olivier Crête 0e2880ac2e 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
2015-10-28 18:52:24 -04:00
Tim-Philipp Müller b204d3b95e liveadder: latency property is an uint64 in audiomixer 2015-10-12 09:42:37 +01:00
Olivier Crête 305e5c7ac3 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.
2015-10-11 11:04:38 +01:00
Vineeth TM 3b89dd4768 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
2015-10-07 11:20:35 +01:00
Sebastian Dröge 40a908b1d9 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
2015-10-01 17:40:59 +02:00
Tim-Philipp Müller fccee018f3 audiomixer: fix deadlock when G_DISABLE_ASSERT is not defined
This makes the audiomixer unit test time out in master.
Broke with 587e7c4
2015-09-26 10:21:41 +01:00
Sebastian Dröge bed2c6820f audioaggregator: Stop using deprecated gst_segment_to_position() 2015-09-26 00:17:55 +02:00
Sebastian Dröge 3c44d3eca4 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.
2015-09-18 18:00:05 +02:00
Jan Schmidt 587e7c4a23 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.
2015-09-18 00:29:51 +10:00
Sebastian Dröge 637106e287 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
2015-09-14 19:57:00 +02:00
Sebastian Dröge 97fe89f351 audioaggregator: Use stream time in the position query instead of segment position
https://bugzilla.gnome.org/show_bug.cgi?id=753196
2015-09-14 19:56:51 +02:00
Olivier Crête 10ef6403b6 audiointerleave: Avoid caps processing if not yet negotiated
https://bugzilla.gnome.org/show_bug.cgi?id=745768
2015-07-30 14:00:05 -04:00
Olivier Crête 3f2bc1e4b2 audioaggregator: On timeout, resync pads with not enough data
https://bugzilla.gnome.org/show_bug.cgi?id=745768
2015-07-30 14:00:05 -04:00
Olivier Crête 6efc106a67 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
2015-07-30 14:00:05 -04:00
Olivier Crête 86fb628d09 audioaggregator: Register function name
Otherwise, it sometimes segfaults with debugging enabled
2015-07-22 19:30:19 -04:00
Olivier Crête 034feb5bb9 audioaggregator: Use 1.0 style buffer allocation 2015-07-22 19:30:12 -04:00
Nirbheek Chauhan ad8cb458ba 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
2015-07-22 19:50:38 +01:00
Olivier Crête f8f9c72cc5 audioaggregator: Read output buffer duration with lock held 2015-07-21 21:55:25 -04:00
Tim-Philipp Müller 654a5f3fc7 audiomixer: fix misleading documentation copied from adder 2015-06-09 14:37:36 +01:00
Sebastian Dröge 0034323f49 Release 1.5.1 2015-06-07 10:55:35 +02:00
Olivier Crête db5b3b5c41 audiointerleave: Always have "channels" be the actual pad count
Don't force it anywhere

https://bugzilla.gnome.org/show_bug.cgi?id=750252
2015-06-01 19:43:20 -04:00
Olivier Crête 45ef27aa46 audiointerleave: Use the channel count from the set caps
This is the same number that was used to allocate the buffer
2015-06-01 19:42:49 -04:00
Stefan Sauer 4116d11327 Revert "doc: Workaround gtkdoc issue"
This reverts commit ff6c736fe0.

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
2015-05-18 20:16:32 +02:00
Nicolas Dufresne ff6c736fe0 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.
2015-05-16 23:38:14 -04:00
Olivier Crête 34a921c31b audiomixer: Allow downstream caps with a non-default channel-mask
Instead of failing, take the downstream channel mask if the channel
count is 1.
2015-04-01 20:32:41 -04:00
Luis de Bethencourt 78ce8ff74f audioaggregator: check sink caps are valid 2015-03-24 16:18:22 +00:00
Luis de Bethencourt cfdcb14730 Revert "audioaggregator: check sink caps are valid"
This reverts commit 6d4d0d1cdf.

Never put code with side effects into an assertion, it can be compiled out
2015-03-24 16:17:00 +00:00
Luis de Bethencourt 6d4d0d1cdf audioaggregator: check sink caps are valid
CID #1291622
2015-03-24 15:53:17 +00:00
Olivier Crête 224f14a299 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
2015-03-16 16:44:03 -04:00
Olivier Crête b08b01895f audiointerleave: Add interleave element based on audioaggregator
https://bugzilla.gnome.org/show_bug.cgi?id=740236
2015-03-16 16:44:03 -04:00
Olivier Crête c565877991 audioaggregator: Print a message when a buffer is late
https://bugzilla.gnome.org/show_bug.cgi?id=740236
2015-03-16 16:44:03 -04:00
Olivier Crête 01520c7e47 audioaggregator: Don't re-send the caps if they did not change
https://bugzilla.gnome.org/show_bug.cgi?id=740236
2015-03-16 16:41:45 -04:00
Olivier Crête 959f8e4a3e 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
2015-03-16 16:41:45 -04:00
Olivier Crête ff9be3ba34 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
2015-03-16 14:31:50 -04:00
Olivier Crête 2d553d1b25 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
2015-03-16 14:31:50 -04:00
Olivier Crête 9c49624610 audiomixer: Only advance by the buffer size when a buffer is late
https://bugzilla.gnome.org/show_bug.cgi?id=745768
2015-03-16 14:31:50 -04:00