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.
24 #ifndef __GST_HLS_DEMUX_H__
25 #define __GST_HLS_DEMUX_H__
28 #include <gst/base/gstadapter.h>
30 #include "gstfragmented.h"
31 #include "gsturidownloader.h"
34 #define GST_TYPE_HLS_DEMUX \
35 (gst_hls_demux_get_type())
36 #define GST_HLS_DEMUX(obj) \
37 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_HLS_DEMUX,GstHLSDemux))
38 #define GST_HLS_DEMUX_CLASS(klass) \
39 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_HLS_DEMUX,GstHLSDemuxClass))
40 #define GST_IS_HLS_DEMUX(obj) \
41 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_HLS_DEMUX))
42 #define GST_IS_HLS_DEMUX_CLASS(klass) \
43 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_HLS_DEMUX))
44 typedef struct _GstHLSDemux GstHLSDemux;
45 typedef struct _GstHLSDemuxClass GstHLSDemuxClass;
47 #define GST_HLS_DEMUX_AES_BLOCK_SIZE 16
52 * Opaque #GstHLSDemux data structure.
63 GstUriDownloader *downloader;
64 GstM3U8Client *client; /* M3U8 client */
65 GQueue *queue; /* Queue storing the fetched fragments */
66 gboolean need_cache; /* Wheter we need to cache some fragments before starting to push data */
67 gboolean end_of_playlist;
68 gboolean do_typefind; /* Whether we need to typefind the next buffer */
71 guint fragments_cache; /* number of fragments needed to be cached to start playing */
72 gfloat bitrate_limit; /* limit of the available bitrate to use */
73 guint connection_speed; /* Network connection speed in kbps (0 = unknown) */
77 GStaticRecMutex stream_lock;
78 gboolean stop_stream_task;
81 GstTask *updates_task;
82 GStaticRecMutex updates_lock;
83 GMutex *updates_timed_lock;
84 GTimeVal next_update; /* Time of the next update */
87 /* Position in the stream */
88 GstClockTime position_shift;
89 gboolean need_segment;
92 struct _GstHLSDemuxClass
94 GstElementClass parent_class;
97 GType gst_hls_demux_get_type (void);
100 #endif /* __GST_HLS_DEMUX_H__ */