summaryrefslogtreecommitdiff
path: root/ext/srt
AgeCommit message (Collapse)AuthorFilesLines
2021-04-08srtobject: fix optlen of srt_getsockflagZhao Zhili1-2/+2
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2149>
2021-03-23srt: allow per feature registrationStéphane Cerveau7-93/+201
Split plugin into features including dynamic types 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-bad/-/merge_requests/2038>
2021-02-03srt: preserve ABI compatibilityJakub Adam3-6/+10
Reintroduce socket descriptor parameter removed in 327ad84e to "caller-added" and "caller-removed" signals, just set it always to zero. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2004>
2021-02-03srt: don't pass SRT socket ID to "caller-added,removed" signalsJakub Adam3-20/+16
The caller's IP and port is enough for unique identification. Don't leak the socket handle since using it in unadvised libsrt calls from the application could break the SRT element. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1772>
2021-02-03srtobject: add caller address to stats structureJakub Adam1-0/+3
In listener mode, gst_stats() returns an independent set of statistics for every connected caller. Having the caller's IP and port present in each structure allows to correlate the statistics with a particular caller that has been announced by "caller-added" signal. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1772>
2021-01-07srt: Define options added in later revisionsEdward Hervey1-0/+9
Allows compiling the plugin against old headers. For SRTO_BINDTODEVICE there's nothing we can do, since the value depends on configuration options of the library. Nice. Fixes build with libsrt < 1.4.2 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1945>
2021-01-06srtobject: distinguish authentication error messagesJakub Adam1-2/+14
Use GST_RESOURCE_ERROR_NOT_AUTHORIZED code in posted error messages related to SRT authentication (e.g. incorrect or missing password) so that the application can recognize them more easily. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1943>
2021-01-06srtobject: detect socket errors from srt_epoll_wait()Jakub Adam1-51/+44
On an error event, epoll wait puts the failed socket in both readfds and writefds. We can take advantage of this and avoid explicitly checking socket state before every read or write attempt. In addition, srt_getrejectreason() will give us more detailed description of the connection failure. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1943>
2021-01-06srtobject: make possible to specify more sockopts in SRT URIJakub Adam1-55/+173
Any socket option that can be passed to libsrt's srt-live-transmit through SRT URI query string is now recognized. Also make the code that applies options to SRT sockets more generic. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1842>
2021-01-06srtsrc: fix typosJakub Adam1-5/+5
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1541>
2021-01-06srtsink: remove unused connection_mode variableJakub Adam1-4/+0
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1541>
2021-01-06srtobject: obey "wait-for-connection" in caller modeJakub Adam1-0/+9
The pipeline now gets stuck in gst_srt_object_write_one() until the receiver comes online, which may or may not be desired based on the use case. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1836>
2021-01-05srtobject: post a message on the bus when broken socket is detectedJakub Adam1-2/+3
So that the application gets notified may react to it. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1935>
2021-01-04srt: Add authentication to srtsink and srtsrc elementsRaghavendra6-4/+219
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1725>
2020-12-07srt: Don't take object lock calling gst_srt_object_get_statsJan Alexander Steffens (heftig)1-10/+25
This function takes the sock lock. This can result in a deadlock when another thread holding the sock lock is trying to take the object lock. Thread A (Holds object lock, wants sock lock): #2 gst_srt_object_get_stats at gst-plugins-bad/ext/srt/gstsrtobject.c:1753 #3 gst_srt_object_get_property_helper at gst-plugins-bad/ext/srt/gstsrtobject.c:409 #4 gst_srt_sink_get_property at gst-plugins-bad/ext/srt/gstsrtsink.c:95 #5 g_object_get_property from libgobject-2.0.so.0 Thread B (Holds sock lock, wants object lock): #2 gst_element_post_message_default at gstreamer/gst/gstelement.c:2069 #3 gst_element_post_message at gstreamer/gst/gstelement.c:2123 #4 gst_element_message_full_with_details at gstreamer/gst/gstelement.c:2259 #5 gst_element_message_full at gstreamer/gst/gstelement.c:2298 #6 gst_srt_object_send_headers at gst-plugins-bad/ext/srt/gstsrtobject.c:1407 #7 gst_srt_object_send_headers at gst-plugins-bad/ext/srt/gstsrtobject.c:1444 #8 gst_srt_object_write_to_callers at gst-plugins-bad/ext/srt/gstsrtobject.c:1444 #9 gst_srt_object_write at gst-plugins-bad/ext/srt/gstsrtobject.c:1598 #10 gst_srt_sink_render at gst-plugins-bad/ext/srt/gstsrtsink.c:179 Fixes d2d00e07acc2b1ab1ae5a728ef5dc33c9dee7869. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1861>
2020-10-12srtsrc: Prevent `delay` from being negativeJan Alexander Steffens (heftig)1-4/+11
`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-12srtsrc: Don't calculate a delay if the srctime is 0Jan Alexander Steffens (heftig)1-2/+9
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-12srtsrc: Defend against missing clockJan Alexander Steffens (heftig)1-0/+5
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-09srt: Consume the error from gst_srt_object_writeJan Alexander Steffens (heftig)1-0/+4
Instead of leaking it. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1668>
2020-10-09srt: Check socket state before retrieving payload sizeJan Alexander Steffens (heftig)1-7/+8
The connection might be broken, which we should detect instead of just aborting the write. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1669>
2020-10-08srtsrc: Fix timestampingEdward Hervey4-5/+80
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-06srt: Remove unused sa_family trackingJan Alexander Steffens (heftig)1-14/+8
Now that SRT no longer needs the family when creating the socket, this code has become useless. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1659>
2020-10-06srt: Move off deprecated `srt_socket()`.Niklas Hambüchen2-3/+3
See https://github.com/Haivision/srt/blob/73ee1e1a3e3adc2702a9a5057d101ef80447b38c/docs/API-functions.md#srt_socket `srt_create_socket()` was added in https://github.com/Haivision/srt/commit/4b897ba92d34f1829a1c6e419eeab17f0763a0fc and srt `v1.3.0` is the first release that has it. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1659>
2020-10-06srt: Register a log handlerJan Alexander Steffens (heftig)1-0/+49
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1659>
2020-10-06srt: Avoid removing invalid sockets from the pollsJan Alexander Steffens (heftig)1-6/+12
This would provoke error messages from SRT. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1659>
2020-10-06srt: Fix use of srt_startupJan Alexander Steffens (heftig)1-4/+2
`srt_startup` can also return 1 if it was successful. Avoid warning in this case. Avoid a race when checking whether we need to call it at all. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1659>
2020-10-06srt: Fix parameter types used for socket optionsJan Alexander Steffens (heftig)1-28/+30
The [SRT documentation][1] specifies exact types for the socket options. Make sure we match these. This reverts the linger workaround in commit 84f8dbd932029220ee86154dd and extends srt_constant_params to support other types than int. [1]: https://github.com/Haivision/srt/blob/master/docs/APISocketOptions.md Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1659>
2020-09-25srtobject: typecast SRTO_LINGER to lingerraghavendra1-1/+9
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1615>
2020-08-19srtobject: set error when canceled waiting for a callerJ. Kim1-4/+8
To propagate error, this commit sets a reason. Otherwise, the function caller should check if `error` is NULL when the return value is not normal. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1522>
2020-08-19srtobject: fix typo, s/errorj/errorJ. Kim1-1/+1
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1522>
2020-08-06srt: Add support for using hostnames instead of IP addressesSebastian Dröge1-11/+69
If an address can't be parsed as IP address, try resolving it via GResolver instead. SRT URIs more often than not contain hostnames and without trying to resolve them we won't be able to handle such URIs. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1493>
2020-08-03srtobject: Add support for IPv6Francisco Javier Velázquez-García1-17/+17
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1477>
2020-08-03srtobject: Reset parameters before setting URIFrancisco Javier Velázquez-García1-12/+26
This makes `gst_srt_object_validate_parameters` work properly since `localaddress` and `localport` will be missing if the URL did not provide them. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1477>
2020-08-03srtobject: Simplify gst_srt_object_set_*_valueFrancisco Javier Velázquez-García1-14/+4
This fixes `gst_srt_object_set_string_value` in particular because the value might not be a static string. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1477>
2020-08-03srtobject: Store passphrase like other parametersFrancisco Javier Velázquez-García2-11/+7
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1477>
2020-06-19srt: add "empty" subclasses for deprecated srt{client,server}{src,sink}Tim-Philipp Müller1-4/+78
The doc system gets confused when we register the exact same class as multiple elements, so make a subclass for each. Also wrap registration of deprecated elements with #ifndef GST_REMOVE_DEPRECATED. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1354>
2020-06-09srt: doc: Add missing gst_type_mark_as_plugin_apiThibault Saunier1-0/+2
2020-06-03srtobject: continue polling or report error on failed receivePeter Workman1-0/+11
fixes #1277 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1260>
2020-06-03srt: Make logging regarding callers more usefulJan Alexander Steffens (heftig)1-12/+23
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1273>
2020-05-24srt: Don't leak the connection_poll_id on close()Jan Schmidt1-0/+1
Attempting to reach an inactive SRT peer in caller mode was leaking an fd every few seconds in the gst_srt_object_close()/open() loop. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1293>
2020-05-13srtobject: add streamid propertyJ. Kim1-0/+20
The stream id starts with '#!::' according to SRT Access Control[1], but GstURI requires URI encoded string.This commit introduces additional property to set the id by normal string. [1] https://github.com/Haivision/srt/blob/master/docs/AccessControl.md
2020-04-30Update gstsrtobject.ckrivoguzovVlad1-1/+1
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/999>
2020-04-15srt: Accumulate total bytes sent/received over all connections/callersJan Alexander Steffens (heftig)2-10/+64
So we don't lose them. Split gst_srt_object_open_internal for internal reconnections that don't reset the accumulated bytes.
2020-04-15srt: Fix type of bytes-received-lostJan Alexander Steffens (heftig)1-1/+1
The field is a uint64_t.
2020-04-15srt: Remove use of closures for signal emissionJan Alexander Steffens (heftig)4-118/+9
It seems overly complicated.
2020-04-15srt: Clean up lockingJan Alexander Steffens (heftig)4-67/+128
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-15srt: Remove trailing whitespaceJan Alexander Steffens (heftig)6-15/+15
2020-04-13srtobject: fix mutex lock targetJ. Kim1-2/+2
GstSRTObject is a structure that has an actual GstElement which is extended to srt{src,sink}.
2019-12-19gstsrtsink: Add `wait-for-connection` property to `srtsink`Francisco Javier Velázquez-García (francisv)2-3/+30
Add `wait-for-connection` property to `srtsink` element. This property allows the element to process packets even when no clients are connected.
2019-11-20srtobject: allow passing SRT Stream ID in stream URIJakub Adam1-0/+14
Based on Stream ID, the application can accept or reject the connection, select the desired data stream, or set an appropriate passphrase for the connection. Example usage: srt://127.0.0.1:1234?streamid=mystream