hlsdemux: Add a get_target_duration and get_current_uri api to m3u8_client

This commit is contained in:
Youness Alaoui 2011-09-02 23:48:22 +00:00 committed by Sebastian Dröge
parent a252794a03
commit 6133608789
2 changed files with 28 additions and 0 deletions

View file

@ -535,6 +535,19 @@ gst_m3u8_client_get_duration (GstM3U8Client * client)
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 *
gst_m3u8_client_get_uri (GstM3U8Client * client)
{
@ -548,6 +561,19 @@ gst_m3u8_client_get_uri (GstM3U8Client * client)
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
gst_m3u8_client_has_variant_playlist (GstM3U8Client * client)
{

View file

@ -85,7 +85,9 @@ gboolean gst_m3u8_client_get_next_fragment (GstM3U8Client * client,
gboolean * discontinuity, const gchar ** uri, GstClockTime * duration,
GstClockTime * timestamp);
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_current_uri(GstM3U8Client * client);
gboolean gst_m3u8_client_has_variant_playlist(GstM3U8Client * client);
gboolean gst_m3u8_client_is_live(GstM3U8Client * client);