From: Mathieu Duponchelle Date: Tue, 13 Jun 2017 00:25:31 +0000 (+0200) Subject: API: gst_discoverer_info_get_live X-Git-Tag: 1.19.3~511^2~2118 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=545e0b003bc2b3fe7251e571393cb17ee7621a6e;p=platform%2Fupstream%2Fgstreamer.git API: gst_discoverer_info_get_live https://bugzilla.gnome.org/show_bug.cgi?id=783722 --- diff --git a/docs/libs/gst-plugins-base-libs-sections.txt b/docs/libs/gst-plugins-base-libs-sections.txt index 1e5575d..36c78a9 100644 --- a/docs/libs/gst-plugins-base-libs-sections.txt +++ b/docs/libs/gst-plugins-base-libs-sections.txt @@ -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 diff --git a/gst-libs/gst/pbutils/gstdiscoverer-types.c b/gst-libs/gst/pbutils/gstdiscoverer-types.c index d450241..8bd8c23 100644 --- a/gst-libs/gst/pbutils/gstdiscoverer-types.c +++ b/gst-libs/gst/pbutils/gstdiscoverer-types.c @@ -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); @@ -1028,6 +1029,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 * diff --git a/gst-libs/gst/pbutils/gstdiscoverer.c b/gst-libs/gst/pbutils/gstdiscoverer.c index b7f5c13..cdc26fb 100644 --- a/gst-libs/gst/pbutils/gstdiscoverer.c +++ b/gst-libs/gst/pbutils/gstdiscoverer.c @@ -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 diff --git a/gst-libs/gst/pbutils/gstdiscoverer.h b/gst-libs/gst/pbutils/gstdiscoverer.h index b4505ed..2d3f8ae 100644 --- a/gst-libs/gst/pbutils/gstdiscoverer.h +++ b/gst-libs/gst/pbutils/gstdiscoverer.h @@ -300,6 +300,9 @@ 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); GST_EXPORT diff --git a/gst-libs/gst/pbutils/pbutils-private.h b/gst-libs/gst/pbutils/pbutils-private.h index 08d53ae..9f0c036 100644 --- a/gst-libs/gst/pbutils/pbutils-private.h +++ b/gst-libs/gst/pbutils/pbutils-private.h @@ -102,6 +102,7 @@ struct _GstDiscovererInfo { GstStructure *misc; GstTagList *tags; GstToc *toc; + gboolean live; gboolean seekable; GPtrArray *missing_elements_details; diff --git a/win32/common/libgstpbutils.def b/win32/common/libgstpbutils.def index f1fc203..39d0e78 100644 --- a/win32/common/libgstpbutils.def +++ b/win32/common/libgstpbutils.def @@ -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