Commit graph

61 commits

Author SHA1 Message Date
Stéphane Cerveau
01d1bbd1da playback: remove useless ret test
Use GST_ELEMENT_REGISTER_DEFINE_CUSTOM instead
of GST_ELEMENT_REGISTER_DEFINE_WITH_CODE if a specific
init needs to be tested before registering the element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1060>
2021-03-10 20:06:20 +01:00
Stéphane Cerveau
1e02717e83 playback: allow per feature registration
Split plugin into features including
elements and device providers which
can be indiviually registered during
a static build.

More details here:

https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/900>
2020-12-10 13:01:57 +00:00
Seungha Yang
5aa831223d urisourcebin: Fix crash caused by use after free
OutputSlotInfo doesn't hold ref of queue, so gst_bin_remove()
will free the queue memory.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/888>
2020-10-22 11:42:37 +00:00
Thibault Saunier
909baa2360 Pass the code through codespell 2019-08-30 13:05:36 +00:00
Niels De Graef
0314b482f3 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-08-27 07:31:57 +02:00
Mathieu Duponchelle
d98835fdef doc: remove xml from comments 2019-05-30 01:12:59 +02:00
Tim-Philipp Müller
b87f830700 uridecodebin, urisourcebin: fix buffering for ssh:// URIs
Protocols that are in the stream_uris list should always
be streams, no matter what they respond to the scheduling
query. The flag in the scheduling query is just another
way to declare something that needs buffering without the
whitelist, the absence of the flag shouldn't make us ignore
our known protocol list.

Also set is_stream always to a boolean and not a mask value.
2019-05-22 09:55:08 +01:00
Víctor Manuel Jáquez Leal
aa30e8d373 urisourcebin: don't set watermarks when download
downloadbuffer element doesn't handle the properties low-watermark and
high-watermark, those are handled by queue2.

Currently hi and low watermarks are set regardless queue2 or
downloadbuffer are used. Thus, when the later is set, a warning is
raised.

This patch sets the watermark properties first, if no download.
2019-04-08 11:16:22 +00:00
Edward Hervey
23d1440a60 urisourcebin: Avoid potential unitialized/wrong bitrate value
Only calculate and set the bitrate if all conditions are met.
2018-11-09 12:22:31 +01:00
Edward Hervey
18942d7875 urisourcebin: Fix previous commit
rebase wasn't correct :)
2018-11-07 16:28:28 +01:00
Matthew Waters
af166b5b22 urisourcebin: add a statistics property for queueing
It contains the minimum/maximum/average byte and time levels of the
queues inside this urisourcebin

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/60
2018-11-07 15:10:05 +00:00
Matthew Waters
81e00791bf uisourcebin: update forwarded properties on change
Allows changing queueing properties at runtime

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/60
2018-11-07 15:10:05 +00:00
Matthew Waters
784e621b54 urisourcebin: add low/high-watermark properties
These are forwarded to the contained queues.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/60
2018-11-07 15:10:05 +00:00
Matthew Waters
8b69b689c0 urisourcebin: limit the byte size of the queue based on the buffer-size
Use the bitrate advertised by queue2 to determine the limits to
set across possibly multiple queue2/downloadbuffer elements.  e.g.
with two queue2's and a max-bytes based on the ratio of the
bitrate/cumulative_bitrate multiplied by the buffer_size set on urisourcebin.

This allows finer grained control over the buffer used by all the queue
elements inside urisourcebin.  Instead of a maximum of
n_streams*buffer_size being used, only buffer_size will be used however
we will fallback to n_streams*buffer_size if one of the queue2's does
not have bitrate information.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/60
2018-11-07 15:10:05 +00:00
Matthew Waters
a8e2f76731 urisourcebin: remove unused instance variable streams 2018-11-07 15:10:05 +00:00
Wonchul Lee
53ae7df2e2 urisourcebin: Rename urisourcebin variable and query functions
https://bugzilla.gnome.org/show_bug.cgi?id=770693
2018-07-18 11:11:50 +02:00
Seungha Yang
e3362e459b urisourcebin: Set streams-aware flag
https://bugzilla.gnome.org/show_bug.cgi?id=777213

https://bugzilla.gnome.org/show_bug.cgi?id=775132
2018-07-18 09:22:56 +02:00
Seungha Yang
4567fcc64c urisourcebin: Do not modify structure of EOS event
https://bugzilla.gnome.org/show_bug.cgi?id=795981
2018-05-10 09:09:08 +02:00
Thibault Saunier
f0399ed435 urisourcebin: Avoid unreffing a pad we are not owning
expose_output_pad takes ownership of the pad.
2018-04-12 16:10:44 -03:00
Edward Hervey
ebf138e29e urisourcebin: Add 'about-to-finish' signal
With push-based sources, urisourcebin will emit this signal when
the stream has been fully consumed.

This signal can be used to know when the source is done providing
data.
2018-02-10 12:24:09 +01:00
Edward Hervey
1717e33da5 urisourcebin: Remove auto-plugging signals
They were never used and we need a better system
2018-02-10 12:17:36 +01:00
Edward Hervey
e5157ca400 urisourcebin: Remove ASYNC behaviour
It is not needed in the new streams-aware world
2018-02-10 12:16:09 +01:00
Edward Hervey
f4035e430a urisourcebin: Remove 'unknown-type' signal
It was never used and makes no sense in the new streams-based world
2018-02-10 12:16:09 +01:00
Edward Hervey
f2f87d220f urisourcebin: Don't leak mutexes 2017-11-25 12:45:03 +01:00
Reynaldo H. Verdejo Pinochet
e81c334ca9 Use proper GtkDoc notation for NULL/FALSE/TRUE 2017-10-03 14:31:18 -07:00
Edward Hervey
ce65017d03 decodebin3/urisourcebin: Switch to actual EOS events internally
Use the intended sequence for re-using elements:
* EOS
* STREAM_START if element is to be re-used

This avoids having elements (such as queue/multiqueue/queue2) not
properly resetting themselves.

When delaying EOS propagation (because we want to wait until all
streams of a group are done for example), we re-trigger them by
first sending the cached STREAM_START and then EOS (which will
cause elements to re-set themselves if needed and accept new
buffers/events).

https://bugzilla.gnome.org/show_bug.cgi?id=785951
2017-08-11 11:23:29 +03:00
Seungha Yang
fc67a689af urisourcebin: Push EOS if slot is still eos state
linked input of slot can be old input, so urisourcebin should check
eos state to figure out whether it's new one or not.
If not, urisourcebin never ever forwards EOS to downstream at the end
of presentation, because the old input is still there without removal

https://bugzilla.gnome.org/show_bug.cgi?id=777735
2017-07-13 07:32:42 +02:00
Thibault Saunier
7e94d2824f urisourcebin: Call do_async_done when source state change returns NO_PREROLL
Otherwise for RTSP streams for example, the pipeline will never go to
PLAYING as it will be missing an ASYNC_DONE message.

https://bugzilla.gnome.org/show_bug.cgi?id=780099
2017-06-15 14:35:06 -04:00
Sebastian Dröge
66929f8970 urisourcebin: Use downloadbuffer element
And only set low-percent/high-percent if not using downloadbuffer, just
like in old uridecodebin. using the watermark based buffering causes
playback to hang never finish buffering with downloadbuffer.
2017-06-12 10:24:43 +03:00
Sebastian Dröge
efbda07cfa urisourcebin: Unref query with gst_query_unref()
Not gst_object_unref().
2017-05-18 11:03:07 +03:00
Jan Schmidt
546a99026b urisourcebin: Set removed flag when removing buffering msg
Forgot to set the flag, resulting in a missed check for
sending 100% in some cases. Spotted by Coverity.

CID: 1403263
2017-03-27 23:00:34 +11:00
Jan Schmidt
a0f870a215 urisourcebin: Mention which queue is being linked in debug output 2017-03-23 00:21:44 +11:00
Seungha Yang
587c417d89 urisourcebin: Fix typefind list leak
https://bugzilla.gnome.org/show_bug.cgi?id=780257
2017-03-20 11:57:11 +02:00
Jan Schmidt
94da76d301 urisourcebin: Fix buffering message aggregation.
Add locking, and handle EOS properly now that urisourcebin
uses custom events in place of real EOS events, so we
need to manually remove buffering messages and potentially
post 100% in that situation
2017-03-18 02:03:47 +11:00
Jan Schmidt
8cb57a4fe8 urisourcebin: Store slot info on the queue object too
The buffering message handling tries to look up the
slot info on the queue itself.
2017-03-18 02:03:47 +11:00
Thibault Saunier
099ac9faf2 docs: Convert gtkdoc comments to markdown
Modernizing the documentation, making it simpler to read an
modify and allowing us to possibly switch to hotdoc in the
future.
2017-03-10 18:19:17 -03:00
Jan Schmidt
4e911760d2 urisourcebin: Shrink queue2 max-size-time buffering
The expanded 4 second buffering was making radio streams that are
being delivered at real-time speeds too slow. We might need
a better plan for matching the queue2 size to incoming bitrate
in the absence of tag information or timestamping.

In uridecodebin, it used tags on the output of decodebin to
adjust the queue2 buffering, but urisourcebin doesn't have that
view - decodebin is downstream from us.
2017-03-09 01:42:14 +11:00
Sebastian Dröge
903a8863ce playbin3/urisourcebin: Enable buffering by default
This only has effect on network streams in these elements, and by
enabling it by default we get the same behaviour as in playbin2.
2017-03-07 14:59:36 +02:00
Sebastian Dröge
bd9fd89d61 urisourcebin: Fix inverted check for an existing slot
CID 1363330
2017-02-28 15:15:31 +02:00
Jan Schmidt
5076520502 urisourcebin: Preserve seqnum on EOS events
When converting EOS to/from our custom fake EOS event,
preserve any seqnum on the original event.
2017-01-12 22:28:50 +11:00
Edward Hervey
90e86b8638 urisourcebin: Avoid races when setting up typefind
The state of urisourcebin (and all elements contained within) can
change at any point in time, including when setting up the typefind
element.

In order to avoid ending up with typefind starting without being fully
connected, lock the state and connect to the 'have-type' signal.
2017-01-12 10:51:34 +01:00
Jan Schmidt
ef8f0cdd9d urisourcebin: Drop fake EOS if the pad got relinked
If our pad got relinked in since the fake-EOS was sent to the
pad, then drop the fake-EOS event.

CID: 1398546
2017-01-11 23:18:47 +11:00
Arun Raghavan
a2c2b22176 urisourcebin: Drop some dead code
The ret == GST_STATE_CHANGE_FAILURE is handled in the previous for loop
already.

CID: 1398544
2017-01-11 17:14:46 +05:30
Seungha Yang
1eedb4ea91 urisourcebin: Clear pad from pending list if it was linked
If not, the other slots might try to link the pad again.
This can happen when the demuxer has multiple src pads
and their caps are identical

https://bugzilla.gnome.org/show_bug.cgi?id=777121
2017-01-11 20:19:45 +11:00
Seungha Yang
7bd7b2209a urisourcebin: Configure typefind element for non-streaming uri
To ensure configuring adaptivedemux if needed,
setup typefind element even if uri is not matched to streaming protocol.

https://bugzilla.gnome.org/show_bug.cgi?id=776458
2017-01-11 00:26:27 +11:00
Seungha Yang
5d0628ff52 urisourcebin: Use GList for typefind elements
We need typefind elements per source element's srcpad

https://bugzilla.gnome.org/show_bug.cgi?id=776458
2017-01-11 00:26:27 +11:00
Seungha Yang
46c6e92abd urisourcebin: Remove unused signal handler variable
Remove never used handler id

https://bugzilla.gnome.org/show_bug.cgi?id=776458
2017-01-11 00:26:27 +11:00
Seungha Yang
87f21a925c urisourcebin: Clear EOS state with stream-start/flush-stop event
The EOS state marker should cleared on stream-start or flush-stop

https://bugzilla.gnome.org/show_bug.cgi?id=777009
2017-01-09 22:38:14 +11:00
Seungha Yang
c10e7c5011 urisourcebin: Never push actual EOS event to slot
Due to the special nature of adaptivedemux, reconfigure happens
frequently with seek/track-change.
In very exceptional cases, the following sequence is possible:
  * EOS event is pushed to queue element and still buffers are queued
  * During draining remaining buffers, reconfiguration downstream
happens due to track switch.
  * The queue gets a not-linked flow return from downstream
  * Because the sinkpad is EOS, the queue registers an
    error on the bus, causing the pipeline to fail.

Avoid the sinkpad getting marked EOS in the first place, by using a
custom event in place of EOS.

https://bugzilla.gnome.org/show_bug.cgi?id=777009
2017-01-09 22:31:46 +11:00
Seungha Yang
cbd4bcd7a4 urisourcebin: Try to link output slot before cleanup
Before cleaning up output slot, check pending pads first, if available.
Then, cleanup it only if linking was failed.

https://bugzilla.gnome.org/show_bug.cgi?id=773341
2016-12-08 16:59:07 +01:00