From 0fd44bc9d0242c83d769bae6dab8be173cebe729 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Wed, 25 Jan 2023 12:46:23 -0300 Subject: [PATCH] pipewiresrc: Make it live by default In theory, the pipewiresrc element is a live element by default. However, that is not reflected in code, as the element never sets that flag unless explicltly requested through stream properties. Make it live by default, but still respect if consumers of the element mark it as not live. --- src/gst/gstpipewiresrc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gst/gstpipewiresrc.c b/src/gst/gstpipewiresrc.c index f023456e0..7243cc160 100644 --- a/src/gst/gstpipewiresrc.c +++ b/src/gst/gstpipewiresrc.c @@ -428,6 +428,9 @@ gst_pipewire_src_init (GstPipeWireSrc * src) /* we operate in time */ gst_base_src_set_format (GST_BASE_SRC (src), GST_FORMAT_TIME); + /* we're a live source, unless explicitly requested not to be */ + gst_base_src_set_live (GST_BASE_SRC (src), TRUE); + GST_OBJECT_FLAG_SET (src, GST_ELEMENT_FLAG_PROVIDE_CLOCK); src->always_copy = DEFAULT_ALWAYS_COPY; @@ -670,7 +673,7 @@ parse_stream_properties (GstPipeWireSrc *pwsrc, const struct pw_properties *prop GST_OBJECT_LOCK (pwsrc); var = pw_properties_get (props, PW_KEY_STREAM_IS_LIVE); - is_live = pwsrc->is_live = var ? pw_properties_parse_bool(var) : FALSE; + is_live = pwsrc->is_live = var ? pw_properties_parse_bool(var) : TRUE; var = pw_properties_get (props, PW_KEY_STREAM_LATENCY_MIN); pwsrc->min_latency = var ? (GstClockTime) atoi (var) : 0;