tizen 2.3 release
[framework/multimedia/gst-plugins-ext0.10.git] / dashdemux / src / gstdashdemux.h
similarity index 76%
rename from wearable/dashdemux/src/gstdashdemux.h
rename to dashdemux/src/gstdashdemux.h
index ec5d8ec..9e3fe6c 100755 (executable)
 #define __GST_DASH_DEMUX_H__
 #define DASHDEMUX_MODIFICATION
 #include <gst/gst.h>
-#include <gst/base/gstadapter.h>
-#include <gst/gst.h>
-#include <gst/base/gstadapter.h>
+#include <gst/base/gstdataqueue.h>
 #include "gstmpdparser.h"
 #include "gstfragmented.h"
 #include "gsturidownloader.h"
+#include "gstdownloadrate.h"
 
 G_BEGIN_DECLS
 #define GST_TYPE_DASH_DEMUX \
@@ -50,6 +49,23 @@ G_BEGIN_DECLS
 //
 typedef struct _GstDashDemux GstDashDemux;
 typedef struct _GstDashDemuxClass GstDashDemuxClass;
+typedef struct _GstDashDemuxStream GstDashDemuxStream;
+
+struct _GstDashDemuxStream {
+  guint idx;
+  GstPad *srcpad;
+  GstCaps *output_caps;
+  GstCaps *input_caps;
+  GstDataQueue *queue;
+  GstClockTime start_time;
+  gboolean download_end_of_period;
+  gboolean stream_end_of_period;
+  gboolean stream_eos;
+  gboolean need_header;
+  gboolean need_segment;
+  GstDownloadRate dnl_rate;
+};
+
 #define MAX_LANGUAGES 20
 /**
  * GstDashDemux:
@@ -60,19 +76,17 @@ struct _GstDashDemux
 {
   GstElement parent;
   GstPad *sinkpad;
-  GstPad *srcpad[MAX_LANGUAGES];        /*Video/Audio/Application src pad */
-  GstCaps *output_caps[MAX_LANGUAGES];  /*Video/Audio/Application output buf caps */
-  GstCaps *input_caps[MAX_LANGUAGES];   /*Video/Audio/Application input caps */
+  GSList *streams;
+  gint max_video_width;
+  gint max_video_height;
 
   GstBuffer *manifest;
   GstUriDownloader *downloader;
   GstMpdClient *client;         /* MPD client */
-  GQueue *queue;                /* Video/Audio/Application List of fragment storing the fetched fragments */
   gboolean end_of_period;
   gboolean end_of_manifest;
 
   /* Properties */
-  GstClockTime min_buffering_time;      /* Minimum buffering time accumulated before playback */
   GstClockTime max_buffering_time;      /* Maximum buffering time accumulated during playback */
   gfloat bandwidth_usage;       /* Percentage of the available bandwidth to use       */
   guint64 max_bitrate;          /* max of bitrate supported by target decoder         */
@@ -81,24 +95,16 @@ struct _GstDashDemux
   GstTask *stream_task;
   GStaticRecMutex stream_lock;
   GMutex *stream_timed_lock;
-  GTimeVal next_push;           /* Time of the next push */
 
   /* Download task */
   GstTask *download_task;
   GStaticRecMutex download_lock;
-  gboolean cancelled;
-  GMutex *download_timed_lock;
-  GTimeVal next_download;       /* Time of the next download */
+  volatile gboolean cancelled;
+  GMutex download_mutex;
+  GCond download_cond;
 
   /* Manifest update */
   GstClockTime last_manifest_update;
-
-  /* Position in the stream */
-  GstClockTime position;
-  GstClockTime position_shift;
-  gboolean need_segment;
-  /* Download rate */
-  guint64 dnl_rate;
 };
 
 struct _GstDashDemuxClass