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.
This commit is contained in:
Georges Basile Stavracas Neto 2023-01-25 12:46:23 -03:00 committed by Wim Taymans
parent 8d4f7df9d6
commit 0fd44bc9d0

View file

@ -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;