mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-07 06:52:41 +00:00
fdsrc: Add property is-live
Fixed #4184 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8372>
This commit is contained in:
parent
6376849396
commit
705b142134
2 changed files with 31 additions and 0 deletions
|
@ -839,6 +839,18 @@
|
||||||
"type": "gint",
|
"type": "gint",
|
||||||
"writable": true
|
"writable": true
|
||||||
},
|
},
|
||||||
|
"is-live": {
|
||||||
|
"blurb": "Act like a live source",
|
||||||
|
"conditionally-available": false,
|
||||||
|
"construct": false,
|
||||||
|
"construct-only": false,
|
||||||
|
"controllable": false,
|
||||||
|
"default": "false",
|
||||||
|
"mutable": "null",
|
||||||
|
"readable": true,
|
||||||
|
"type": "gboolean",
|
||||||
|
"writable": true
|
||||||
|
},
|
||||||
"timeout": {
|
"timeout": {
|
||||||
"blurb": "Post a message after timeout microseconds (0 = disabled)",
|
"blurb": "Post a message after timeout microseconds (0 = disabled)",
|
||||||
"conditionally-available": false,
|
"conditionally-available": false,
|
||||||
|
|
|
@ -109,6 +109,7 @@ enum
|
||||||
|
|
||||||
PROP_FD,
|
PROP_FD,
|
||||||
PROP_TIMEOUT,
|
PROP_TIMEOUT,
|
||||||
|
PROP_IS_LIVE,
|
||||||
|
|
||||||
PROP_LAST
|
PROP_LAST
|
||||||
};
|
};
|
||||||
|
@ -172,6 +173,17 @@ gst_fd_src_class_init (GstFdSrcClass * klass)
|
||||||
G_MAXUINT64, DEFAULT_TIMEOUT,
|
G_MAXUINT64, DEFAULT_TIMEOUT,
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GstFdSrc:is-live
|
||||||
|
*
|
||||||
|
* Act like a live source if set to %TRUE.
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
|
g_object_class_install_property (gobject_class, PROP_IS_LIVE,
|
||||||
|
g_param_spec_boolean ("is-live", "is-live", "Act like a live source",
|
||||||
|
FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
gst_element_class_set_static_metadata (gstelement_class,
|
gst_element_class_set_static_metadata (gstelement_class,
|
||||||
"Filedescriptor Source",
|
"Filedescriptor Source",
|
||||||
"Source/File",
|
"Source/File",
|
||||||
|
@ -362,6 +374,10 @@ gst_fd_src_set_property (GObject * object, guint prop_id, const GValue * value,
|
||||||
GST_DEBUG_OBJECT (src, "poll timeout set to %" GST_TIME_FORMAT,
|
GST_DEBUG_OBJECT (src, "poll timeout set to %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (src->timeout));
|
GST_TIME_ARGS (src->timeout));
|
||||||
break;
|
break;
|
||||||
|
case PROP_IS_LIVE:
|
||||||
|
GST_DEBUG_OBJECT (src, "live set to %d", g_value_get_boolean (value));
|
||||||
|
gst_base_src_set_live (GST_BASE_SRC (src), g_value_get_boolean (value));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
@ -381,6 +397,9 @@ gst_fd_src_get_property (GObject * object, guint prop_id, GValue * value,
|
||||||
case PROP_TIMEOUT:
|
case PROP_TIMEOUT:
|
||||||
g_value_set_uint64 (value, src->timeout);
|
g_value_set_uint64 (value, src->timeout);
|
||||||
break;
|
break;
|
||||||
|
case PROP_IS_LIVE:
|
||||||
|
g_value_set_boolean (value, gst_base_src_is_live (GST_BASE_SRC (src)));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue