summaryrefslogtreecommitdiff
path: root/gst/hls
diff options
context:
space:
mode:
authorYouness Alaoui <youness.alaoui@collabora.co.uk>2011-09-02 23:48:22 +0000
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2011-09-03 09:00:50 +0200
commit613360878936e59232fe1b258f9b7109361610b7 (patch)
tree7ae307e92fffd02f89a38eb54766f8464767e306 /gst/hls
parenta252794a039d09a9e2701c900b6211fe9c0054f6 (diff)
downloadgstreamer-plugins-bad-613360878936e59232fe1b258f9b7109361610b7.tar.gz
hlsdemux: Add a get_target_duration and get_current_uri api to m3u8_client
Diffstat (limited to 'gst/hls')
-rw-r--r--gst/hls/m3u8.c26
-rw-r--r--gst/hls/m3u8.h2
2 files changed, 28 insertions, 0 deletions
diff --git a/gst/hls/m3u8.c b/gst/hls/m3u8.c
index a17193fb7..c407d72d8 100644
--- a/gst/hls/m3u8.c
+++ b/gst/hls/m3u8.c
@@ -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)
{
diff --git a/gst/hls/m3u8.h b/gst/hls/m3u8.h
index 5223b5cd9..8c83990f8 100644
--- a/gst/hls/m3u8.h
+++ b/gst/hls/m3u8.h
@@ -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);