Commit graph

2226 commits

Author SHA1 Message Date
Tim-Philipp Müller
10d9e18f02 Remove autotools build system 2019-10-13 16:10:42 +01:00
Aaron Boxer
509f6201e1 documentation: fix a number of typos 2019-10-06 11:12:11 -04:00
Sebastiano Barrera
89dfda56e3 base: GstBaseSrc/GstBaseSink::get_caps: add (nullable) to filter
The virtual method named `get_caps` in both `GstBaseSrc` and
`GstBaseSink` has a `filter` parameter which can be `NULL` (the
default implementation in GstBaseSrc already considers the case).
Before this commit, there was no gtk-doc annotation representing this
fact, which caused the corresponding entry in the GIR file to also
miss this fact.

This caused bugs in other places, such inducing the Vala compiler to
introduce a wrongly assert on `(filter != NULL)` in every
implementation of the `get_caps` method implemented in Vala.
2019-09-11 11:13:38 +02:00
Niels De Graef
4812c4087f Don't pass default GLib marshallers for signals
By passing NULL to `g_signal_new` instead of a marshaller, GLib will
actually internally optimize the signal (if the marshaller is available
in GLib itself) by also setting the valist marshaller. This makes the
signal emission a bit more performant than the regular marshalling,
which still needs to box into `GValue` and call libffi in case of a
generic marshaller.

Note that for custom marshallers, one would use
`g_signal_set_va_marshaller()` with the valist marshaller instead.
2019-09-09 12:16:24 +00:00
Sebastian Dröge
74797e962f aggregator: Always handle serialized events/queries directly before waiting
Otherwise it can happen that we start waiting for another pad, while one
pad already has events that can be handled and potentially also a buffer
that can be handled. That buffer would then however not be accessible by
the subclass from GstAggregator::get_next_time() as there would be the
events in front of it, which doesn't allow the subclass then to
calculate the next time based on already available buffers.

As a side-effect this also allows removing the duplicated event handling
code in the aggregate function as we'll always report pads as not ready
when there is a serialized event or query at the top of at least one
pad's queue.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/428
2019-08-19 18:55:07 +03:00
Sebastian Dröge
d7d79f2c54 aggregator: Add sink_event_pre_queue() and sink_query_pre_queue() vfuncs
These allow subclasses catching serialized events/queries before they're
queued up.
2019-08-14 18:34:31 +03:00
Sebastian Dröge
aebff1fcaa aggregator: Add GstAggregator::negotiate()
For consistency with other base classes and for allowing to completely
override the negotiation behaviour.
2019-08-14 18:34:13 +03:00
Sebastian Dröge
e024926636 aggregator: Actually handle NEED_DATA return from update_src_caps()
The documentation says that this allows the subclass to signal that it
needs more data before it can decide on caps, so let's actually
implement it that way.
2019-08-14 09:53:44 +03:00
Sebastian Dröge
21798184a0 aggregator: Assert if the sink/src pad type that is to be used is not a GstAggregatorPad or subclass thereof 2019-08-13 17:11:51 +00:00
Sebastian Dröge
b8455445c5 aggregator: Ensure that the source pad is created as a GstAggregatorPad if no type is given in the pad template
Otherwise we would create a GstPad and that causes invalid memory
accesses later.
2019-08-13 17:11:51 +00:00
Mathieu Duponchelle
9ec55072d2 aggregator: drop duplicated SEEK events
This is similar to what demuxers do, and necessary when multiple
sinks get seeked downstream of the aggregator: if we forward
duplicated seeks upstream, elements such as demuxers may drop
the flushing seeks, but return TRUE, aggregator then waits forever
for the flushing events.

Fixes #276
2019-07-19 17:31:11 +02:00
Tim-Philipp Müller
214fe0f230 basesrc: fix g-i warnings 2019-07-19 11:09:22 +01:00
Sebastian Dröge
09909d37bd aggregator: Make parsing of explicit sink pad names more robust
When passing "sink_%d" twice to aggregator before it would create two
pads called "sink_0", because it failed to parse "%d" as integer and
used 0 instead then.

Instead validate that parsing was actually successful and also don't
even try to parse if the requested pad name contains a '%'.
2019-07-09 08:09:29 +00:00
Carlos Rafael Giani
6412988975 basesrc: Add public gst_base_src_negotiate () function
This is useful for when format changes occur mid-stream.
2019-07-01 11:16:09 +02:00
Michael Bunk
4bc68bb3fe Fixing various typos 2019-06-20 15:20:27 +00:00
Mathieu Duponchelle
6d16615093 aggregator: don't try to take STREAM_LOCK on sink pad flush
This was a misguided effort to try and guarantee the buffers of
the sink pads would not change during aggregate, when an upstream
branch is seeked independently, however this is simply incorrect
as downstream has not necessarily been flushed, or the aggregate
function might be waiting to receive buffers on other pads.
2019-06-11 22:09:33 +02:00
Mathieu Duponchelle
4087361da3 aggregator: send flush_stop ourselves if needed
In !159 , we switched to sending flush_start ourselves from the
do_seek implementation. If no flushing seek successfully made its
way upstream, we need to send flush_stop ourselves as well.
2019-06-11 15:20:18 +02:00
Mathieu Duponchelle
c55c61eb84 aggregator: don't hold stream lock when flushing
Releasing a GRecMutex from a different thread is undefined
behaviour.

There should be no reason to hold the stream lock from the
moment aggregator receives a flush_start until it receives
the last flush_stop: the source pad task is stopped, and can
only be restarted once the last flush_stop has arrived.

I can only speculate as to the reason why this was done,
as it was that way since the original commit. My best
guess is that aggregator originally didn't marshall events
and queries to the aggregate thread, and this somehow
helped work around this.
2019-06-10 23:04:31 +02:00
Mathieu Duponchelle
25383eaa5c aggregator: refactor flushing logic
Instead of tracking "pending_flush_*" on the pads and the
aggregator, we now simply track the last seqnum for flush start
and flush stop events on the pads, and use it to determine whether
we should enter or exit our flushing state.

See https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/977
2019-06-10 23:04:31 +02:00
Niels De Graef
09141c6e1f Use G_DEFINE_AUTOPTR_CLEANUP_FUNC unconditionally
Since we started depending on GLib 2.44, we can be sure this macro is
defined (it will be a no-op on compilers that don't support it). For
plugins we should just start using `G_DECLARE_FINAL_TYPE` which means
we no longer need the macro there, but for most types in core we don't
want to break ABI, which means it's better to just keep it like it is
(and use the `#ifdef` instead).
2019-06-04 08:50:59 +02:00
Thibault Saunier
6dac555e32 aggregator: Minor documentation fix 2019-05-25 10:56:50 -04:00
Tim-Philipp Müller
1a3bf3234f aggregator: fix flow-return boolean return type mismatch
Not that it matters, since we don't check the return value
anyway. Unclear why the aggregator pad flush function should
have a return value at all really, and perhaps it should be
called reset anyway. Spotted by dv on irc.
2019-05-25 14:33:27 +02:00
Sebastian Dröge
904d552176 basesink: Remove leading space from Since maker of gst_base_sink_get_stats()
gobject-introspection does not like this.
2019-05-16 15:24:02 +00:00
Sebastian Dröge
f23f864774 basesink: Fix syntax for gtk-doc comment of the new stats property 2019-05-16 15:24:02 +00:00
Thibault Saunier
949fba4b1f doc: Fix hotdoc warnings
* Making sure that `static inline` function are in the GIR (by first
  defining them, and make sure to mark as skiped)
* Do not try to link to unexisting symbols
* Also generate GIR information about gst_tracers
2019-05-13 16:34:09 -04:00
Thibault Saunier
a0c65067e0 Port to hotdoc 2019-05-13 16:34:09 -04:00
Víctor Manuel Jáquez Leal
19467a7d8d gstbasesink: Fix gir annotation 2019-05-09 08:59:59 +02:00
Aaron Boxer
fa99a88558 gstbasesink: add stats getter method
fixes #355
2019-05-08 14:45:42 -04:00
Sebastian Dröge
f57e79a073 bitwriter: Fix inclusion of header in C++ code
../subprojects/gstreamer/libs/gst/base/gstbitwriter.h: In function 'gboolean _gst_bit_writer_check_remaining(GstBitWriter*, guint32)':
../subprojects/gstreamer/libs/gst/base/gstbitwriter.h:161:31: error: invalid conversion from 'gpointer' {aka 'void*'} to 'guint8*' {aka 'unsigned char*'} [-fpermissive]
   bitwriter->data = g_realloc (bitwriter->data, (new_bit_size >> 3));
                     ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-04-23 15:15:56 +00:00
Sebastian Dröge
e823f02b5a base: Include gstbitwriter.h in the single-include header 2019-04-23 15:15:56 +00:00
Sebastian Dröge
52f1c98443 libs: Fix various Since markers 2019-04-23 15:07:08 +03:00
Sebastian Dröge
0a0496f98f aggregator: Mark all public structs as Since: 1.14 2019-04-23 14:54:03 +03:00
Sebastian Dröge
0058eeb1de bitwriter: Mark the whole type as Since: 1.16 2019-04-23 14:53:11 +03:00
Olivier Crête
61f2d9b07a basesrc: Downgrade EOS warning
In the case of pushfilesrc, this is the expected behaviour, so let's
downgrade the warning to a debug message to avoid confusing users.
2019-04-18 13:55:47 +00:00
Tim-Philipp Müller
41f873fa0a aggregator: fix doc chunk for new buffer-consumed signal
Fixes 'Warning: GstBase: incorrect number of parameters in
comment block, parameter annotations will be ignored.' from
g-ir-scanner.
2019-04-16 23:51:19 +01:00
Mathieu Duponchelle
fee108f7cf basesrc: do not send EOS when automatic_eos is FALSE 2019-04-05 18:00:29 +00:00
Mathieu Duponchelle
ae57b1c76d aggregator: add buffer-consumed pad signal
The signal will be emitted when a buffer was consumed on
a pad, if the newly-added "emit-signals" property has been
set to TRUE.

Handlers connected to the signal will receive a valid reference on
the consumed buffer, allowing for example the retrieval of metas in
order to forward them once an output buffer is pushed out.
2019-04-05 12:13:54 +00:00
Tim-Philipp Müller
cef902814d bitwriter: mark as 'skip' for gobject-introspection
Silences g-ir-scanner warnings. We do the same for ByteWriter.
2019-03-23 17:53:07 +00:00
Matthew Waters
c6691abba1 aggregator: don't leak gap buffer when out of segment 2019-03-21 19:18:46 +11:00
Matthew Waters
619dfc91bb aggregator: take the pad lock around queue gap event removal
As is done for every other queue interaction
2019-03-21 19:18:46 +11:00
Matthew Waters
b8d00b9e6e baseparse: don't reset the disable-passthrough property value
Resetting as a result of _reset() on PAUSED->READY is unexpected.
2019-03-20 17:44:30 +11:00
Tim-Philipp Müller
41d5f22334 aggregator: fix typo in docs 2019-01-05 18:55:12 +00:00
Tim-Philipp Müller
33267b2ecc basesrc: ensure submitted buffer list is writable
Fixes flaky appsrc unit test where depending on scheduling
the submitted list might not be writable if submitted via
an action signal from the application thread.

Fixes gst-plugins-base#522
2018-12-19 00:34:40 +00:00
KimTaeSoo
bf1979e55f baseparse: Use buffer from short reads instead of pulling again
baseparse internally uses a 64kb buffer for pulling data from upstream.
If a 64kb pull is failing with a short read, it would previously pull
again the requested size.

Doing so is not only inefficient but also seems to cause problems with
some elements (rawvideoparse) where the second pull would fail with EOS.

Short reads are only allowed in GStreamer at EOS.

Closes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/294
2018-11-28 17:38:58 +02:00
Thomas Bluemel
36ab067905 clock: Keep weak reference to underlying clock
Fixes potential segmentation fault when using a GstClockID that
is referencing an already freed GstClock

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/187
2018-11-03 19:00:22 +02:00
Sebastian Dröge
fc3602aec8 queuearray: Only clear dropped item if it is not returned 2018-10-15 18:47:16 +03:00
Sebastian Dröge
2481e542c7 queuearray: Clear items when dropping them and a clear function was defined 2018-10-15 15:28:35 +03:00
Tim-Philipp Müller
135932872e aggregator: document new "min-upstream-latency" property is in nanosecs
https://bugzilla.gnome.org/show_bug.cgi?id=797213
2018-10-04 00:30:52 +01:00
Vivia Nikolaidou
22d0f40716 queuearray: Add set_clear_func and clear functions
gst_queue_array_clear will clear the GstQueueArray,
gst_queue_array_set_clear_func will set a clear function for each
element to be called on _clear and on _free.

https://bugzilla.gnome.org/show_bug.cgi?id=797218
2018-09-27 19:32:54 +03:00
Mathieu Duponchelle
62d7eaf3aa aggregator: add gtk-doc blurb for new min-upstream-latency prop 2018-09-27 13:20:10 +02:00