#define GST_CAT_DEFAULT hls2_debug
-static void gst_m3u8_init_file_unref (GstM3U8InitFile * self);
static gchar *uri_join (const gchar * uri, const gchar * path);
GstHLSMediaPlaylist *
return file;
}
-static GstM3U8InitFile *
+GstM3U8InitFile *
gst_m3u8_init_file_ref (GstM3U8InitFile * ifile)
{
g_assert (ifile != NULL && ifile->ref_count > 0);
return ifile;
}
-static void
+void
gst_m3u8_init_file_unref (GstM3U8InitFile * self)
{
g_return_if_fail (self != NULL && self->ref_count > 0);
}
}
+gboolean
+gst_m3u8_init_file_equal (const GstM3U8InitFile * ifile1,
+ const GstM3U8InitFile * ifile2)
+{
+ if (ifile1 == ifile2)
+ return TRUE;
+
+ if (ifile1 == NULL && ifile2 != NULL)
+ return FALSE;
+ if (ifile1 != NULL && ifile2 == NULL)
+ return FALSE;
+
+ if (!g_str_equal (ifile1->uri, ifile2->uri))
+ return FALSE;
+ if (ifile1->offset != ifile2->offset)
+ return FALSE;
+ if (ifile1->size != ifile2->size)
+ return FALSE;
+
+ return TRUE;
+}
+
static gboolean
int_from_string (gchar * ptr, gchar ** endptr, gint * val)
{
guint ref_count; /* ATOMIC */
};
+GstM3U8InitFile *gst_m3u8_init_file_ref (GstM3U8InitFile * ifile);
+void gst_m3u8_init_file_unref (GstM3U8InitFile * ifile);
+gboolean gst_m3u8_init_file_equal (const GstM3U8InitFile * ifile1, const GstM3U8InitFile *ifile2);
+
GstM3U8MediaSegment *
gst_m3u8_media_segment_ref (GstM3U8MediaSegment * mfile);