Commit graph

14 commits

Author SHA1 Message Date
Jan Alexander Steffens (heftig)
4eeff95f92 srtsrc: Prevent delay from being negative
`delay` should be a GstClockTimeDiff since SRT time is int64_t.

All values are in local time so we should never see a srctime that's in
the future. If we do, clamp the delay to 0 and warn about it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1674>
2020-10-12 12:58:22 +00:00
Jan Alexander Steffens (heftig)
ec11ad9d55 srtsrc: Don't calculate a delay if the srctime is 0
A zero srctime is a missing srctime. Apparently this can happen when
["the connection is not between SRT peers or if Timestamp-Based Packet
Delivery mode (TSBPDMODE) is not enabled"][1] so it may not apply to us,
but it's best to be defensive.

[1]: https://github.com/Haivision/srt/blob/v1.4.2/docs/API.md#sending-and-receiving

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1674>
2020-10-12 12:58:22 +00:00
Jan Alexander Steffens (heftig)
6b2fcb52e5 srtsrc: Defend against missing clock
If we don't have a clock, stop the source instead of asserting in
gst_clock_get_time. This can happen when the element is removed from the
pipeline while it's playing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1674>
2020-10-12 12:58:22 +00:00
Edward Hervey
dd11e91c3b srtsrc: Fix timestamping
SRT provides the original timestamp of a packet (with drift/skew corrected for
local clock), which is what should be used for timestamping the outgoing
buffers. This ensures that we output the packets with the same timestamp (and by
extension rate) as the original feed.

Also detect if packets were dropped (by checking the sequence number) and
properly set DISCONT flag on the outgoing buffer.

Finally answer the latency queries

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1658>
2020-10-08 21:12:17 +00:00
Jan Alexander Steffens (heftig)
132e3a1af9
srt: Remove use of closures for signal emission
It seems overly complicated.
2020-04-15 10:42:47 +02:00
Jan Alexander Steffens (heftig)
d2d00e07ac
srt: Clean up locking
Use GST_OBJECT_LOCK (srtobject->element) to protect only the fields
involved in property access.

Introduce a new mutex srtobject->sock_lock to go with
srtobject->sock_cond and protect the list of callers from concurrent
access.
2020-04-15 10:42:47 +02:00
Jan Alexander Steffens (heftig)
37ee389913
srt: Remove trailing whitespace 2020-04-15 10:42:47 +02:00
Niels De Graef
d8f61515d8 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-11-06 14:27:46 +00:00
Mathieu Duponchelle
42adb02a10 docstrings: port ulinks to markdown links 2019-08-23 20:14:12 +02:00
Mathieu Duponchelle
da6afdec9c doc: remove xml from comments 2019-05-29 22:58:08 +02:00
Mark Nauwelaerts
dd3a25b473 srt: set cancellation in locked section
... to avoid race with wait which uses it with 'flushing' flag state semantics.
2019-05-11 22:38:46 +00:00
Mark Nauwelaerts
7aba64e19d srt: post error when failing to start
... as appropriate for a subsequent state change failure
2019-04-21 17:17:14 +02:00
Olivier Crête
73c6530d40 srt: Accepts URIs without host to go into listener mode
Just setting a URI without a hostname should directly go into listener mode.
2019-01-23 19:14:30 +00:00
Justin Kim
0a350c610d srt: Integrate server and client element into one
We have srt{client,server}{src,sink} elements in accordance to the
norm of the connection oriented protocols. However, SRT connection
mode can be changed by uri parameters so it requires an integrated
element to handle the parameters.

fix: #740
2019-01-09 19:44:02 +00:00