2 * Copyright (C) 2010 Marc-Andre Lureau <marcandre.lureau@gmail.com>
3 * Copyright (C) 2010 Andoni Morales Alastruey <ylatuya@gmail.com>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 /* This source code is taken from m3u8.c, which is licensed by GNU Library General Public License.
24 * AES-128 bit decryption features are changed from m3u8.c.
25 * - gst_m3u8_update and gst_m3u8_media_file_new are modified.
26 * - gst_m3u8_getIV_from_mediasequence is added.
28 * - gst_m3u8_client_get_next_fragment is modified.
29 * - gst_m3u8_client_check_next_fragment is added.
30 * File name is changed to mm_player_m3u8.c
34 #ifndef __MM_PLAYER_M3U8_H__
35 #define __MM_PLAYER_M3U8_H__
39 G_BEGIN_DECLS typedef struct _GstM3U8 GstM3U8;
40 typedef struct _GstM3U8MediaFile GstM3U8MediaFile;
41 typedef struct _GstM3U8Client GstM3U8Client;
43 #define GST_M3U8_MEDIA_FILE(f) ((GstM3U8MediaFile*)f)
49 gboolean endlist; /* if ENDLIST has been reached */
50 gint version; /* last EXT-X-VERSION */
51 gint targetduration; /* last EXT-X-TARGETDURATION */
52 gchar *allowcache; /* last EXT-X-ALLOWCACHE */
63 GList *lists; /* list of GstM3U8 from the main playlist */
64 GstM3U8 *parent; /* main playlist (if any) */
65 guint mediasequence; /* EXT-X-MEDIA-SEQUENCE & increased with new media file */
68 struct _GstM3U8MediaFile
73 guint sequence; /* the sequence nb of this file */
76 unsigned char key[16];
83 GstM3U8 *main; /* main playlist */
85 guint update_failed_count;
86 gint sequence; /* the next sequence for this client */
90 GstM3U8Client *gst_m3u8_client_new (const gchar * uri);
91 void gst_m3u8_client_free (GstM3U8Client * client);
92 gboolean gst_m3u8_client_update (GstM3U8Client * client, gchar * data);
93 void gst_m3u8_client_set_current (GstM3U8Client * client, GstM3U8 * m3u8);
94 const GstM3U8MediaFile *gst_m3u8_client_get_next_fragment (GstM3U8Client * client, gboolean * discontinuity);
95 #define gst_m3u8_client_get_uri(Client) ((Client)->main->uri)
96 #define gst_m3u8_client_has_variant_playlist(Client) ((Client)->main->lists)
97 #define gst_m3u8_client_is_live(Client) (!(Client)->current->endlist)
98 #define gst_m3u8_client_allow_cache(Client) ((Client)->current->allowcache)
100 const gboolean gst_m3u8_client_check_next_fragment (GstM3U8Client * client);
103 #endif /* __MM_PLAYER_M3U8_H__ */