hls: m3u8playlist: more clean-ups

Remove unused functions; move GstM3U8 struct into .c file,
and indent the header so it's nice to read.
This commit is contained in:
Tim-Philipp Müller 2015-08-30 17:11:31 +01:00
parent cae2fa0cef
commit cec0ef105f
2 changed files with 22 additions and 37 deletions

View file

@ -32,6 +32,16 @@ enum
GST_M3U8_PLAYLIST_TYPE_VOD, GST_M3U8_PLAYLIST_TYPE_VOD,
}; };
typedef struct _GstM3U8Entry GstM3U8Entry;
struct _GstM3U8Entry
{
gfloat duration;
gchar *title;
gchar *url;
gboolean discontinuous;
};
static GstM3U8Entry * static GstM3U8Entry *
gst_m3u8_entry_new (const gchar * url, const gchar * title, gst_m3u8_entry_new (const gchar * url, const gchar * title,
gfloat duration, gboolean discontinuous) gfloat duration, gboolean discontinuous)
@ -181,20 +191,3 @@ gst_m3u8_playlist_render (GstM3U8Playlist * playlist)
return g_string_free (playlist_str, FALSE); return g_string_free (playlist_str, FALSE);
} }
void
gst_m3u8_playlist_clear (GstM3U8Playlist * playlist)
{
g_return_if_fail (playlist != NULL);
g_queue_foreach (playlist->entries, (GFunc) gst_m3u8_entry_free, NULL);
g_queue_clear (playlist->entries);
}
guint
gst_m3u8_playlist_n_entries (GstM3U8Playlist * playlist)
{
g_return_val_if_fail (playlist != NULL, 0);
return playlist->entries->length;
}

View file

@ -27,16 +27,6 @@
G_BEGIN_DECLS G_BEGIN_DECLS
typedef struct _GstM3U8Playlist GstM3U8Playlist; typedef struct _GstM3U8Playlist GstM3U8Playlist;
typedef struct _GstM3U8Entry GstM3U8Entry;
struct _GstM3U8Entry
{
gfloat duration;
gchar *title;
gchar *url;
gboolean discontinuous;
};
struct _GstM3U8Playlist struct _GstM3U8Playlist
{ {
@ -55,16 +45,18 @@ struct _GstM3U8Playlist
GstM3U8Playlist * gst_m3u8_playlist_new (guint version, GstM3U8Playlist * gst_m3u8_playlist_new (guint version,
guint window_size, guint window_size,
gboolean allow_cache); gboolean allow_cache);
void gst_m3u8_playlist_free (GstM3U8Playlist * playlist);
gboolean gst_m3u8_playlist_add_entry (GstM3U8Playlist * playlist, void gst_m3u8_playlist_free (GstM3U8Playlist * playlist);
const gchar * url,
const gchar *title, gboolean gst_m3u8_playlist_add_entry (GstM3U8Playlist * playlist,
gfloat duration, const gchar * url,
guint index, const gchar * title,
gboolean discontinuous); gfloat duration,
gchar * gst_m3u8_playlist_render (GstM3U8Playlist * playlist); guint index,
void gst_m3u8_playlist_clear (GstM3U8Playlist * playlist); gboolean discontinuous);
guint gst_m3u8_playlist_n_entries (GstM3U8Playlist * playlist);
gchar * gst_m3u8_playlist_render (GstM3U8Playlist * playlist);
G_END_DECLS G_END_DECLS
#endif /* __M3U8_H__ */ #endif /* __M3U8_H__ */