2 * DASH demux plugin for GStreamer
6 * Copyright (C) 2012 Orange
9 * David Corvoysier <david.corvoysier@orange.com>
10 * Hamid Zakari <hamid.zakari@gmail.com>
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either
15 * version 2.1 of the License, or (at your option) any later version.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details.
22 * You should have received a copy of the GNU Library General Public
23 * License along with this library (COPYING); if not, write to the
24 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 * Boston, MA 02111-1307, USA.
28 #ifndef __GST_DASH_DEMUX_H__
29 #define __GST_DASH_DEMUX_H__
30 #define DASHDEMUX_MODIFICATION
32 #include <gst/base/gstdataqueue.h>
33 #include "gstmpdparser.h"
34 #include "gstfragmented.h"
35 #include "gsturidownloader.h"
36 #include "gstdownloadrate.h"
39 #define GST_TYPE_DASH_DEMUX \
40 (gst_dash_demux_get_type())
41 #define GST_DASH_DEMUX(obj) \
42 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DASH_DEMUX,GstDashDemux))
43 #define GST_DASH_DEMUX_CLASS(klass) \
44 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DASH_DEMUX,GstDashDemuxClass))
45 #define GST_IS_DASH_DEMUX(obj) \
46 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DASH_DEMUX))
47 #define GST_IS_DASH_DEMUX_CLASS(klass) \
48 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DASH_DEMUX))
50 typedef struct _GstDashDemux GstDashDemux;
51 typedef struct _GstDashDemuxClass GstDashDemuxClass;
52 typedef struct _GstDashDemuxStream GstDashDemuxStream;
54 struct _GstDashDemuxStream {
60 GstClockTime start_time;
61 gboolean download_end_of_period;
62 gboolean stream_end_of_period;
65 gboolean need_segment;
66 GstDownloadRate dnl_rate;
69 #define MAX_LANGUAGES 20
73 * Opaque #GstDashDemux data structure.
81 gint max_video_height;
84 GstUriDownloader *downloader;
85 GstMpdClient *client; /* MPD client */
86 gboolean end_of_period;
87 gboolean end_of_manifest;
90 GstClockTime max_buffering_time; /* Maximum buffering time accumulated during playback */
91 gfloat bandwidth_usage; /* Percentage of the available bandwidth to use */
92 guint64 max_bitrate; /* max of bitrate supported by target decoder */
96 GStaticRecMutex stream_lock;
97 GMutex *stream_timed_lock;
100 GstTask *download_task;
101 GStaticRecMutex download_lock;
102 volatile gboolean cancelled;
103 GMutex download_mutex;
106 /* Manifest update */
107 GstClockTime last_manifest_update;
110 struct _GstDashDemuxClass
112 GstElementClass parent_class;
115 GType gst_dash_demux_get_type (void);
118 #endif /* __GST_DASH_DEMUX_H__ */