Initialize Tizen 2.3
[framework/multimedia/gst-plugins-ext0.10.git] / wearable / dashdemux / src / gstdashdemux.h
1 /*
2  * DASH demux plugin for GStreamer
3  *
4  * gstdashdemux.h
5  *
6  * Copyright (C) 2012 Orange
7  *
8  * Authors:
9  *   David Corvoysier <david.corvoysier@orange.com>
10  *   Hamid Zakari <hamid.zakari@gmail.com>
11  *
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.
16  *
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.
21  *
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.
26  */
27
28 #ifndef __GST_DASH_DEMUX_H__
29 #define __GST_DASH_DEMUX_H__
30 #define DASHDEMUX_MODIFICATION
31 #include <gst/gst.h>
32 #include <gst/base/gstadapter.h>
33 #include <gst/gst.h>
34 #include <gst/base/gstadapter.h>
35 #include "gstmpdparser.h"
36 #include "gstfragmented.h"
37 #include "gsturidownloader.h"
38
39 G_BEGIN_DECLS
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))
50 //
51 typedef struct _GstDashDemux GstDashDemux;
52 typedef struct _GstDashDemuxClass GstDashDemuxClass;
53 #define MAX_LANGUAGES 20
54 /**
55  * GstDashDemux:
56  *
57  * Opaque #GstDashDemux data structure.
58  */
59 struct _GstDashDemux
60 {
61   GstElement parent;
62   GstPad *sinkpad;
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 */
66
67   GstBuffer *manifest;
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;
73
74   /* Properties */
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         */
79
80   /* Streaming task */
81   GstTask *stream_task;
82   GStaticRecMutex stream_lock;
83   GMutex *stream_timed_lock;
84   GTimeVal next_push;           /* Time of the next push */
85
86   /* Download task */
87   GstTask *download_task;
88   GStaticRecMutex download_lock;
89   gboolean cancelled;
90   GMutex *download_timed_lock;
91   GTimeVal next_download;       /* Time of the next download */
92
93   /* Manifest update */
94   GstClockTime last_manifest_update;
95
96   /* Position in the stream */
97   GstClockTime position;
98   GstClockTime position_shift;
99   gboolean need_segment;
100   /* Download rate */
101   guint64 dnl_rate;
102 };
103
104 struct _GstDashDemuxClass
105 {
106   GstElementClass parent_class;
107 };
108
109 GType gst_dash_demux_get_type (void);
110
111 G_END_DECLS
112 #endif /* __GST_DASH_DEMUX_H__ */