dashdemux: remove stream loop thread

Download and push from the same task, makes code a lot simpler
to maintain. Also pushing from separate threads avoids deadlocking
when gst_pad_push blocks due to downstream queues being full.
This commit is contained in:
Thiago Santos 2013-12-20 10:05:22 -03:00
parent 5a5f6d1b7a
commit da329b44a4
2 changed files with 214 additions and 556 deletions

File diff suppressed because it is too large Load diff

View file

@ -68,38 +68,11 @@ struct _GstDashDemuxStream
GstClockTime position;
gboolean restart_download;
/*
* Need to store the status for the download and
* stream tasks separately as they are working at
* different points of the stream timeline.
* The download task is ahead of the stream.
*
* The download_end_of_period is set when a stream
* has already downloaded all fragments for the current
* period.
*
* The stream_end_of_period is set when a stream
* has pushed all fragments for the current period
*/
gboolean download_end_of_period;
gboolean stream_end_of_period;
GstEvent *pending_segment;
gboolean stream_eos;
gboolean need_header;
/* tracks if a stream has enqueued data
* after a pad switch.
* This is required to prevent pads being
* added to the demuxer and having no data
* pushed to it before another pad switch
* as this might make downstream elements
* unhappy and error out if they get
* an EOS without receiving any input
*/
gboolean has_data_queued;
GstDataQueue *queue;
/* Download task */
GMutex download_mutex;
GCond download_cond;
@ -127,7 +100,6 @@ struct _GstDashDemux
GSList *next_periods;
GstSegment segment;
gboolean need_segment;
GstClockTime timestamp_offset;
GstBuffer *manifest;
@ -143,10 +115,6 @@ struct _GstDashDemux
gfloat bandwidth_usage; /* Percentage of the available bandwidth to use */
guint64 max_bitrate; /* max of bitrate supported by target decoder */
/* Streaming task */
GstTask *stream_task;
GRecMutex stream_task_lock;
gboolean cancelled;
/* Manifest update */