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/gstadapter.h>
34 #include <gst/base/gstadapter.h>
35 #include "gstmpdparser.h"
36 #include "gstfragmented.h"
37 #include "gsturidownloader.h"
40 #define GST_TYPE_DASH_DEMUX \
41 (gst_dash_demux_get_type())
42 #define GST_DASH_DEMUX(obj) \
43 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DASH_DEMUX,GstDashDemux))
44 #define GST_DASH_DEMUX_CLASS(klass) \
45 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DASH_DEMUX,GstDashDemuxClass))
46 #define GST_IS_DASH_DEMUX(obj) \
47 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DASH_DEMUX))
48 #define GST_IS_DASH_DEMUX_CLASS(klass) \
49 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DASH_DEMUX))
51 typedef struct _GstDashDemux GstDashDemux;
52 typedef struct _GstDashDemuxClass GstDashDemuxClass;
53 #define MAX_LANGUAGES 20
57 * Opaque #GstDashDemux data structure.
63 GstPad *srcpad[MAX_LANGUAGES]; /*Video/Audio/Application src pad */
64 GstCaps *output_caps[MAX_LANGUAGES]; /*Video/Audio/Application output buf caps */
65 GstCaps *input_caps[MAX_LANGUAGES]; /*Video/Audio/Application input caps */
68 GstUriDownloader *downloader;
69 GstMpdClient *client; /* MPD client */
70 GQueue *queue; /* Video/Audio/Application List of fragment storing the fetched fragments */
71 gboolean end_of_period;
72 gboolean end_of_manifest;
75 GstClockTime min_buffering_time; /* Minimum buffering time accumulated before playback */
76 GstClockTime max_buffering_time; /* Maximum buffering time accumulated during playback */
77 gfloat bandwidth_usage; /* Percentage of the available bandwidth to use */
78 guint64 max_bitrate; /* max of bitrate supported by target decoder */
82 GStaticRecMutex stream_lock;
83 GMutex *stream_timed_lock;
84 GTimeVal next_push; /* Time of the next push */
87 GstTask *download_task;
88 GStaticRecMutex download_lock;
90 GMutex *download_timed_lock;
91 GTimeVal next_download; /* Time of the next download */
94 GstClockTime last_manifest_update;
96 /* Position in the stream */
97 GstClockTime position;
98 GstClockTime position_shift;
99 gboolean need_segment;
104 struct _GstDashDemuxClass
106 GstElementClass parent_class;
109 GType gst_dash_demux_get_type (void);
112 #endif /* __GST_DASH_DEMUX_H__ */