mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
srtobject: obey "wait-for-connection" in caller mode
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>
This commit is contained in:
parent
4625ac92b6
commit
d540012091
1 changed files with 9 additions and 0 deletions
|
@ -1602,8 +1602,10 @@ gst_srt_object_write_one (GstSRTObject * srtobject,
|
||||||
gint poll_timeout;
|
gint poll_timeout;
|
||||||
const guint8 *msg = mapinfo->data;
|
const guint8 *msg = mapinfo->data;
|
||||||
gint payload_size, optlen = 1;
|
gint payload_size, optlen = 1;
|
||||||
|
gboolean wait_for_connection;
|
||||||
|
|
||||||
GST_OBJECT_LOCK (srtobject->element);
|
GST_OBJECT_LOCK (srtobject->element);
|
||||||
|
wait_for_connection = srtobject->wait_for_connection;
|
||||||
if (!gst_structure_get_int (srtobject->parameters, "poll-timeout",
|
if (!gst_structure_get_int (srtobject->parameters, "poll-timeout",
|
||||||
&poll_timeout)) {
|
&poll_timeout)) {
|
||||||
poll_timeout = GST_SRT_DEFAULT_POLL_TIMEOUT;
|
poll_timeout = GST_SRT_DEFAULT_POLL_TIMEOUT;
|
||||||
|
@ -1629,6 +1631,13 @@ gst_srt_object_write_one (GstSRTObject * srtobject,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!wait_for_connection &&
|
||||||
|
srt_getsockstate (srtobject->sock) == SRTS_CONNECTING) {
|
||||||
|
GST_LOG_OBJECT (srtobject->element,
|
||||||
|
"Not connected yet. Dropping the buffer.");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (srt_epoll_wait (srtobject->poll_id, 0, 0, &wsock,
|
if (srt_epoll_wait (srtobject->poll_id, 0, 0, &wsock,
|
||||||
&wsocklen, poll_timeout, NULL, 0, NULL, 0) < 0) {
|
&wsocklen, poll_timeout, NULL, 0, NULL, 0) < 0) {
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue