mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
hlsdemux: m3u8: protect public methods properly
This commit is contained in:
parent
09b2b31422
commit
18cd90e73f
2 changed files with 30 additions and 3 deletions
|
@ -471,3 +471,30 @@ gst_m3u8_client_get_duration (GstM3U8Client * client)
|
|||
g_list_foreach (client->current->files, (GFunc) _sum_duration, &duration);
|
||||
return duration;
|
||||
}
|
||||
|
||||
const gchar *
|
||||
gst_m3u8_client_get_uri (GstM3U8Client * client)
|
||||
{
|
||||
g_return_val_if_fail (client != NULL, NULL);
|
||||
|
||||
return client->main->uri;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gst_m3u8_client_has_variant_playlist (GstM3U8Client * client)
|
||||
{
|
||||
g_return_val_if_fail (client != NULL, FALSE);
|
||||
|
||||
return client->main->lists != NULL;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gst_m3u8_client_is_live (GstM3U8Client * client)
|
||||
{
|
||||
g_return_val_if_fail (client != NULL, FALSE);
|
||||
|
||||
if (!client->current || client->current->endlist)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -78,9 +78,9 @@ void gst_m3u8_client_set_current (GstM3U8Client * client, GstM3U8 * m3u8);
|
|||
const gchar *gst_m3u8_client_get_next_fragment (GstM3U8Client * client,
|
||||
gboolean * discontinuity);
|
||||
GstClockTime gst_m3u8_client_get_duration (GstM3U8Client * client);
|
||||
#define gst_m3u8_client_get_uri(Client) ((Client)->main->uri)
|
||||
#define gst_m3u8_client_has_variant_playlist(Client) ((Client)->main->lists)
|
||||
#define gst_m3u8_client_is_live(Client) (!(Client)->main->lists && !(Client)->current->endlist)
|
||||
const gchar *gst_m3u8_client_get_uri(GstM3U8Client * client);
|
||||
gboolean gst_m3u8_client_has_variant_playlist(GstM3U8Client * client);
|
||||
gboolean gst_m3u8_client_is_live(GstM3U8Client * client);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __M3U8_H__ */
|
||||
|
|
Loading…
Reference in a new issue