gst-plugins-bad: hlsdemux: Add a get_target_duration and get_current_uri api to m3u8_client
Sebastian Dröge
slomo at kemper.freedesktop.org
Sat Sep 3 00:09:12 PDT 2011
Module: gst-plugins-bad
Branch: master
Commit: 613360878936e59232fe1b258f9b7109361610b7
URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=613360878936e59232fe1b258f9b7109361610b7
Author: Youness Alaoui <youness.alaoui at collabora.co.uk>
Date: Fri Sep 2 23:48:22 2011 +0000
hlsdemux: Add a get_target_duration and get_current_uri api to m3u8_client
---
gst/hls/m3u8.c | 26 ++++++++++++++++++++++++++
gst/hls/m3u8.h | 2 ++
2 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/gst/hls/m3u8.c b/gst/hls/m3u8.c
index a17193f..c407d72 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 5223b5c..8c83990 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);
More information about the gstreamer-commits
mailing list