mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
hlsdemux: Add a get_target_duration and get_current_uri api to m3u8_client
This commit is contained in:
parent
a252794a03
commit
6133608789
2 changed files with 28 additions and 0 deletions
|
@ -535,6 +535,19 @@ gst_m3u8_client_get_duration (GstM3U8Client * client)
|
||||||
return duration * GST_SECOND;
|
return duration * GST_SECOND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GstClockTime
|
||||||
|
gst_m3u8_client_get_target_duration (GstM3U8Client * client)
|
||||||
|
{
|
||||||
|
GstClockTime duration = 0;
|
||||||
|
|
||||||
|
g_return_val_if_fail (client != NULL, GST_CLOCK_TIME_NONE);
|
||||||
|
|
||||||
|
GST_M3U8_CLIENT_LOCK (client);
|
||||||
|
duration = client->current->targetduration;
|
||||||
|
GST_M3U8_CLIENT_UNLOCK (client);
|
||||||
|
return duration * GST_SECOND;
|
||||||
|
}
|
||||||
|
|
||||||
const gchar *
|
const gchar *
|
||||||
gst_m3u8_client_get_uri (GstM3U8Client * client)
|
gst_m3u8_client_get_uri (GstM3U8Client * client)
|
||||||
{
|
{
|
||||||
|
@ -548,6 +561,19 @@ gst_m3u8_client_get_uri (GstM3U8Client * client)
|
||||||
return uri;
|
return uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const gchar *
|
||||||
|
gst_m3u8_client_get_current_uri (GstM3U8Client * client)
|
||||||
|
{
|
||||||
|
const gchar *uri;
|
||||||
|
|
||||||
|
g_return_val_if_fail (client != NULL, NULL);
|
||||||
|
|
||||||
|
GST_M3U8_CLIENT_LOCK (client);
|
||||||
|
uri = client->current->uri;
|
||||||
|
GST_M3U8_CLIENT_UNLOCK (client);
|
||||||
|
return uri;
|
||||||
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gst_m3u8_client_has_variant_playlist (GstM3U8Client * client)
|
gst_m3u8_client_has_variant_playlist (GstM3U8Client * client)
|
||||||
{
|
{
|
||||||
|
|
|
@ -85,7 +85,9 @@ gboolean gst_m3u8_client_get_next_fragment (GstM3U8Client * client,
|
||||||
gboolean * discontinuity, const gchar ** uri, GstClockTime * duration,
|
gboolean * discontinuity, const gchar ** uri, GstClockTime * duration,
|
||||||
GstClockTime * timestamp);
|
GstClockTime * timestamp);
|
||||||
GstClockTime gst_m3u8_client_get_duration (GstM3U8Client * client);
|
GstClockTime gst_m3u8_client_get_duration (GstM3U8Client * client);
|
||||||
|
GstClockTime gst_m3u8_client_get_target_duration (GstM3U8Client * client);
|
||||||
const gchar *gst_m3u8_client_get_uri(GstM3U8Client * client);
|
const gchar *gst_m3u8_client_get_uri(GstM3U8Client * client);
|
||||||
|
const gchar *gst_m3u8_client_get_current_uri(GstM3U8Client * client);
|
||||||
gboolean gst_m3u8_client_has_variant_playlist(GstM3U8Client * client);
|
gboolean gst_m3u8_client_has_variant_playlist(GstM3U8Client * client);
|
||||||
gboolean gst_m3u8_client_is_live(GstM3U8Client * client);
|
gboolean gst_m3u8_client_is_live(GstM3U8Client * client);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue