mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
API: gst_discoverer_info_get_live
https://bugzilla.gnome.org/show_bug.cgi?id=783722
This commit is contained in:
parent
2a26baf4be
commit
545e0b003b
6 changed files with 27 additions and 2 deletions
|
@ -3250,6 +3250,7 @@ gst_discoverer_info_get_tags
|
|||
gst_discoverer_info_get_toc
|
||||
gst_discoverer_info_get_uri
|
||||
gst_discoverer_info_get_seekable
|
||||
gst_discoverer_info_get_live
|
||||
gst_discoverer_info_ref
|
||||
gst_discoverer_info_unref
|
||||
gst_discoverer_info_to_variant
|
||||
|
|
|
@ -413,6 +413,7 @@ gst_discoverer_info_copy (GstDiscovererInfo * ptr)
|
|||
ret->duration = ptr->duration;
|
||||
ret->result = ptr->result;
|
||||
ret->seekable = ptr->seekable;
|
||||
ret->live = ptr->live;
|
||||
if (ptr->misc)
|
||||
ret->misc = gst_structure_copy (ptr->misc);
|
||||
|
||||
|
@ -1027,6 +1028,17 @@ DISCOVERER_INFO_ACCESSOR_CODE (duration, GstClockTime, GST_CLOCK_TIME_NONE);
|
|||
|
||||
DISCOVERER_INFO_ACCESSOR_CODE (seekable, gboolean, FALSE);
|
||||
|
||||
/**
|
||||
* gst_discoverer_info_get_live:
|
||||
* @info: a #GstDiscovererInfo
|
||||
*
|
||||
* Returns: whether the URI is live.
|
||||
*
|
||||
* Since: 1.14
|
||||
*/
|
||||
|
||||
DISCOVERER_INFO_ACCESSOR_CODE (live, gboolean, FALSE);
|
||||
|
||||
/**
|
||||
* gst_discoverer_info_get_misc:
|
||||
* @info: a #GstDiscovererInfo
|
||||
|
|
|
@ -1344,6 +1344,11 @@ discoverer_collect (GstDiscoverer * dc)
|
|||
}
|
||||
}
|
||||
|
||||
if (dc->priv->target_state == GST_STATE_PAUSED)
|
||||
dc->priv->current_info->live = FALSE;
|
||||
else
|
||||
dc->priv->current_info->live = TRUE;
|
||||
|
||||
if (dc->priv->current_topology)
|
||||
dc->priv->current_info->stream_info = parse_stream_topology (dc,
|
||||
dc->priv->current_topology, NULL);
|
||||
|
@ -1833,8 +1838,8 @@ _serialize_info (GstDiscovererInfo * info, GstDiscovererSerializeFlags flags)
|
|||
tags_str = gst_tag_list_to_string (info->tags);
|
||||
|
||||
ret =
|
||||
g_variant_new ("(mstbms)", info->uri, info->duration, info->seekable,
|
||||
tags_str);
|
||||
g_variant_new ("(mstbmsb)", info->uri, info->duration, info->seekable,
|
||||
tags_str, info->live);
|
||||
|
||||
g_free (tags_str);
|
||||
|
||||
|
@ -1961,6 +1966,8 @@ _parse_info (GstDiscovererInfo * info, GVariant * info_variant)
|
|||
str = _maybe_get_string_from_tuple (info_variant, 3);
|
||||
if (str)
|
||||
info->tags = gst_tag_list_new_from_string (str);
|
||||
|
||||
GET_FROM_TUPLE (info_variant, boolean, 4, &info->live);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -299,6 +299,9 @@ GstClockTime gst_discoverer_info_get_duration(const GstDiscovererIn
|
|||
GST_EXPORT
|
||||
gboolean gst_discoverer_info_get_seekable(const GstDiscovererInfo* info);
|
||||
|
||||
GST_EXPORT
|
||||
gboolean gst_discoverer_info_get_live(const GstDiscovererInfo* info);
|
||||
|
||||
GST_EXPORT
|
||||
const GstStructure* gst_discoverer_info_get_misc(const GstDiscovererInfo* info);
|
||||
|
||||
|
|
|
@ -102,6 +102,7 @@ struct _GstDiscovererInfo {
|
|||
GstStructure *misc;
|
||||
GstTagList *tags;
|
||||
GstToc *toc;
|
||||
gboolean live;
|
||||
gboolean seekable;
|
||||
GPtrArray *missing_elements_details;
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ EXPORTS
|
|||
gst_discoverer_info_get_missing_elements_installer_details
|
||||
gst_discoverer_info_get_result
|
||||
gst_discoverer_info_get_seekable
|
||||
gst_discoverer_info_get_live
|
||||
gst_discoverer_info_get_stream_info
|
||||
gst_discoverer_info_get_stream_list
|
||||
gst_discoverer_info_get_streams
|
||||
|
|
Loading…
Reference in a new issue