#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 \
//
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:
{
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 */
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