Commit graph

2284 commits

Author SHA1 Message Date
Jonny Lamb
63170d52ae identity: fixes to the eos-after and error-after properties
I copied `error-after` to make the `eos-after` property, but it turned
out there were some problems with that one, so this patch: adds
separate counters (so setting to NULL and reusing the element will
still work); clarifies the properties' min values; and reports an
error when both are set.
2018-12-18 22:55:28 +00:00
Edward Hervey
1bca404191 queue2: Add details of query in debug log 2018-12-17 09:41:45 +01:00
Jonny Lamb
460c0edbfb identity: add eos-after property
Using `num-buffers` can be unpredictable as buffer sizes are often
arbitrary (filesrc, multifilesrc, etc.). The `error-after` property on
`identity` is better but obviously reports an error afterwards. This
adds `eos-after` which does exactly the same thing but reports EOS
instead.
2018-12-11 21:14:11 +00:00
Philippe Normand
9f5e65f0a2 input-selector: Let context queries pass through
By doing so GL source elements can successfully reuse the GL context and display
of downstream elements. This change fixes an issue in playbin when using
gltestsrc where the context query made by the source element would fail and the
source element would create a second (useless) GLDisplay.
2018-11-28 11:00:21 +00:00
Jordan Petridis
84512152c1
Run gst-indent through the files
This is required before we enabled an indent test in the CI.

https://gitlab.freedesktop.org/gstreamer/gstreamer-project/issues/33
2018-11-28 05:58:53 +02:00
Niels De Graef
cf3fdbe4c0 typefind: cleanup (un)reffing of several objects.
By using these functions, we can shave off a few lines, and make the
intent of that line more clear.
2018-11-09 08:44:11 +00:00
Matthew Waters
4fc4ad87d5 query: add a new bitrate query
Allows determining from downstream what the expected bitrate of a stream
may be which is useful in queue2 for setting time based limits when
upstream does not provide timing information.

Implement bitrate query handling in queue2

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/60
2018-11-07 15:04:14 +00:00
Matthew Waters
c4ccff7861 queue2: avoid ping-pong between 0% and 100% buffering messages
If upstream is pushing buffers larger than our limits, only 1 buffer
is ever in the queue at a time.  Once that single buffer has left the
queue, a 0% buffering message would be posted followed immediately by a
100% buffering message when the next buffer was inserted into the queue
a very short time later.  As per the recommendations, This would result
in the application pausing for a short while causing the appearance of
a short stutter.

The first step of a solution involves not posting a buffering message if
there is still data waiting on the sink pad for insertion into the queue.
This successfully drops the 0% messages from being posted however a
message is still posted on each transition to 100% when the new buffer
arrives resulting in a string of 100% buffering messages.  We silence
these by storing the last posted buffering percentage and only posting a
new message when it is different from or last posted message.
2018-11-07 15:04:14 +00:00
Nicolas Dufresne
e1be065293 tracers: log: Fix post query trace
The post tracer hooks have a GstQuery argument which was truncated from
the trace. As the post hook is the one that contains the useful data,
this bug was hiding the important information from that trace.
2018-11-06 15:41:01 -05:00
Matthew Waters
874ad5faca meson: generate pkg-config files for our plugins 2018-11-05 15:18:41 +00:00
Sebastian Dröge
23e6096d0b typefind: Always forward RECONFIGURE events upstream
Based on a patch by Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/67
2018-11-04 12:45:57 +02:00
Sebastian Dröge
3eb334a7f9 typefind: Lower debug level of some output related to the URI query
It's not a warning if an URI doesn't have an extension, and it's also
not mandatory that sources have an URI or even answer the URI query.
2018-10-26 09:21:42 +01:00
Edward Hervey
127e211004 multiqueue: Don't clamp running times for position calculation
Since we use full signed running times, we no longer need to clamp
the buffer time.

This avoids having the position of single queues not advancing for
buffers that are out of segment and never waking up non-linked
streams (resulting in an apparent "deadlock").
2018-10-22 15:28:45 +02:00
Edward Hervey
98fabd2fa2 queue2: Reset result flow when retrying
If we ever get a GST_FLOW_EOS from downstream, we might retry
pushing new data. But if pushing that data doesn't return a
GstFlowReturn (such as pushing events), we would end up returning
the previous GstFlowReturn (i.e. EOS).

Not properly resetting it would cause cases where queue2 would
stop pushing on the first GstEvent stored (even if there is more
data contained within).
2018-10-22 13:52:30 +02:00
Nicolas Dufresne
c81b2f6207 filesink: Fix wrong printf format
We add a guint64 and a guint, the result is a guint64. On 64bit
architecture, this is the same, but on 32bit architecture, it's not.

https://bugzilla.gnome.org/show_bug.cgi?id=797127
2018-09-11 21:33:51 -04:00
Sebastian Dröge
95fcced84d input-selector: Bring latency handling in sync with GstPad code 2018-08-31 12:16:43 +03:00
Sebastian Dröge
7c179e3f58 input-selector: Apply GstPad default latency handler fixes here too 2018-08-31 11:47:03 +03:00
Sebastian Dröge
6fc136ad84 concat: Improve debug output a bit by printing pad names 2018-08-29 19:26:04 +03:00
Sebastian Dröge
b324e4b802 filesink: Flush buffers before directly writing out buffers with the SYNC_AFTER flag
Otherwise we write out the SYNC_AFTER buffer immediately, and the
previously queued up buffers afterwards which then breaks the order of
data.

Also add various debug output.
2018-08-28 14:23:32 +03:00
Sebastian Dröge
035045c981 filesink: Consider the current buffer size when checking the current position 2018-08-17 17:26:17 +03:00
Sebastian Dröge
cbcad53b45 filesink: Reset the current buffer size to NULL and clear the buffer on close and FLUSH_STOP 2018-08-17 17:26:17 +03:00
Sebastian Dröge
6b4fc62b7b filesink: Implement buffering internally
We use writev() so every call ends up going to the kernel but for small
buffers we generally would prefer to do as few write calls as possible.

https://bugzilla.gnome.org/show_bug.cgi?id=794173
2018-08-16 17:01:07 +03:00
Sebastian Dröge
e975e0cae8 filesink: Remove buffer, deprecate line-buffer mode and don't use fflush()
fflush() has no effect because we use writev() directly, so fsync()
should be used instead which is actually flushing the kernel-side
buffers.

As a next step, a non-line-buffered buffering mode is to be added.

https://bugzilla.gnome.org/show_bug.cgi?id=794173
2018-08-14 13:56:08 +03:00
Sebastian Dröge
ef9619200b inputselector: Forward LATENCY query to all sinkpads
Otherwise downstream will consider the pipeline not live if the active
pad is live, even though some inactive pads might be live and might
require a non-zero latency configuration.

https://bugzilla.gnome.org/show_bug.cgi?id=796901
2018-08-01 14:23:04 +03:00
Sebastian Dröge
41f1a40704 typefind: Add new gst_type_find_helper_get_range_full() that returns flow return
And make use of it in the typefind element. It's useful to distinguish
between the different errors why typefinding can fail, and especially to
not consider GST_FLOW_FLUSHING as an actual error.

https://bugzilla.gnome.org/show_bug.cgi?id=796894
2018-08-01 14:23:04 +03:00
Nirbheek Chauhan
38ec95460f meson: Don't add static printf library to executables
They should only need to link to libgstreamer.
2018-07-25 16:02:06 +05:30
Sebastian Dröge
d196b0b904 typefind: Add _with_extension() variants for typefinding data or a buffer
And make use of that in the typefind element to also be able to make use
of the extension in push mode. It previously only did that in pull mode
and this potentially speeds up typefinding and might also prevent false
positives.

https://bugzilla.gnome.org/show_bug.cgi?id=796865
2018-07-25 01:12:11 +03:00
Edward Hervey
eeb30c2a97 concat: Properly forward the SEGMENT seqnum 2018-06-19 07:27:33 +02:00
Dimitrios Katsaros
ac7f8b6337 queue2: use GstQueueArray
When using queue2 as a queue it was using GQueue with
individually allocated queue items, so two allocs for
each item. With GstQueueArray we can avoid those.

https://bugzilla.gnome.org/show_bug.cgi?id=796483
2018-06-04 11:10:05 +01:00
Nirbheek Chauhan
4fb02fc85b meson: Update option names to omit disable_ and with- prefixes
Also yield common options to the outer project (gst-build in our case)
so that they don't have to be set manually.
2018-05-05 20:30:43 +05:30
luz.paz
4a402c1c7d Fix typos in comments and docs
Found via `codespell`

https://bugzilla.gnome.org/show_bug.cgi?id=795610
2018-05-01 11:18:03 +01:00
Xavier Claessens
b00b1d5361 Meson: Use library() to build both static and shared libs
Meson supports building both static and shared libraries in a single
library() call. It has the advantage of reusing the same .o objects and
thus avoid double compilation.

https://bugzilla.gnome.org/show_bug.cgi?id=794627
2018-04-25 00:40:30 +01:00
Tim-Philipp Müller
21decc643b multiqueue, inputselector: show pad properties in gst-inspect-1.0 2018-04-17 18:57:20 +01:00
Tim-Philipp Müller
65e0907798 inputselector, outputselector: add guards for wrong pads being set as active pads
Catch users wrongly setting foreign pads or wrong pads as
the selector's active pad, which leads to all kinds of
other issues. It's a programming error so handle it just
like we would if we had direct API.

https://bugzilla.gnome.org/show_bug.cgi?id=795309
2018-04-17 18:57:17 +01:00
Matthew Waters
5a5a548b09 plugins: Don't force 64-bit file/seek functions variants on android
Most functions are automatically chosen from the _FILE_OFFSET_BITS
define, the remaining one (fstat) is only available on API >= 21 so
check for that
2018-03-02 18:25:21 +11:00
Olivier Crête
23b32d5600 queue: Ignore thresholds if a query is queued
The queue gets filled by the tail, so a query will always be the tail
object, not the head object. Also add a _peek_tail_struct() method to the
GstQueueArray to enable looking at the tail.

With unit test to prevent future regression.

https://bugzilla.gnome.org/show_bug.cgi?id=762875
2018-03-01 16:31:57 -05:00
Matthew Waters
7fad93d035 tracers: latency: allow for non parented pads to send latency probes
Such a setup is used in rtspsrc for its TCP connection

https://bugzilla.gnome.org/show_bug.cgi?id=793478
2018-02-16 13:14:40 +00:00
Jan Alexander Steffens (heftig)
b17d03cb0a multiqueue: Don't start new pads until parented
Start task on new source pads added at runtime after they
have been added to the element, not during activation.

This ensures the pads can post their CREATE stream-status
messages and the application can set thread priorities.

https://bugzilla.gnome.org/show_bug.cgi?id=756867
2017-12-24 11:51:06 +01:00
Jan Alexander Steffens (heftig)
10c3a7bd55 multiqueue: Split task handling from gst_single_queue_flush
https://bugzilla.gnome.org/show_bug.cgi?id=756867
2017-12-24 11:51:06 +01:00
Sebastian Dröge
d431ef7190 downloadbuffer: Don't hold the mutex while posint the download-complete message
Something might handle it from a sync message handler and call back into
downloadbuffer, causing a deadlock.
2017-12-21 13:47:52 +02:00
Matthew Waters
a0400a0d28 docs: include tracers in the documentation
Requires exposing the tracer GType from the GstTracerFactory in order
to link the plugin with the tracer in the documentation.

https://bugzilla.gnome.org/show_bug.cgi?id=791253
2017-12-14 14:46:46 +11:00
Tim-Philipp Müller
e04c6694f1 tracers: log: no need to link to our internal printf implementation
The call to __gst_vasprintf() was removed in commit 1a3e218b8.
2017-11-26 11:14:01 +00:00
Mikhail Fludkov
6577f5e91e gsttraceutils: actually disable tracing system hooks if configured
`./configure --disable-gst-tracer-hooks` didn't do anything, hooks were
always enabled regardless of the option. It works correctly in the
Meson build though.
2017-11-24 13:40:34 +01:00
Havard Graff
df27ec3e67 gstbasetranform: replace GST_BASE_TRANSFORM with GST_BASE_TRANSFORM_CAST
To avoid a global type-lock on chain etc.
2017-11-24 13:39:39 +01:00
Edward Hervey
922e048379 queue: Only calculate level if we have valid levels
Doing calculations with GST_CLOCK_STIME_NONE would result in
completely bogus levels
2017-11-23 15:28:39 +01:00
Edward Hervey
f03443f90c concat: Handle single-pad use-cases
When EOS reaches concat, it will switch to the next candidate as its
activate pad.

The problem arises when there is only one sinkpad, the "active" pad
becomes NULL. This results in concat becoming unusable after it receives
a *single* EOS on its single sinkpad.

If we detect there is a single sinkpad and there is no current active pad:
* If we are waiting (from selected sink event/buffer), become the current
  active pad.
* If there is a seek request, send it upstream. We don't switch the
  active_sinkpad property at that point in time, since the seek could
  fail. If the seek succeeds, the following SEGMENT (or STREAM_START)
  will cause the pad_wait() to elect that pad as the new active one.
* Flush events get forwarded

https://bugzilla.gnome.org/show_bug.cgi?id=790167
2017-11-10 14:15:46 +01:00
Edward Hervey
08ad748ced concat: Make QoS forward MT-safe
In the same way it's done for other event forwarding.
2017-11-09 17:41:51 +01:00
Guillaume Desmottes
4670036691 latency tracer: add timestamp to tracer records
Include the timestamp of the recorded log as in the 'stats' tracer.
This can be useful, for example, to plot a graph showing the latency
over time.

https://bugzilla.gnome.org/show_bug.cgi?id=781315
2017-11-04 13:51:00 -04:00
Mathieu Duponchelle
f911fe4314 gstleaks.c: always log leaks listing
https://bugzilla.gnome.org/show_bug.cgi?id=789556
2017-11-02 14:53:48 +01:00
Nicolas Dufresne
41e35c334b latency-tracer: Exclude synchronization time
The goal of this tracer is to measure the processing latency between a
src and a sink. In push mode, the time was read after the chain function
have returned. As the amount of time we wait to get synched is reverse
to the amount of latency the source introduced, the result was quite
surprising.

This patch moves the latency calculation in the pre-push hook. When
there is no processing in a a pipeline (e.g. fakesrc ! fakesink), the
latency will now be 0 as it's supposed to. For pull mode, the code was
already correct. When GstBaseSink operate in pull mode, the processing
time is done durring the pull, so pull-post is the right hook. The
synchronization will happen after the pull has ended. Note that
GstBaseSink rarely operate in pull mode.

https://bugzilla.gnome.org/show_bug.cgi?id=788431
2017-10-30 15:33:15 -04:00