mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:16:13 +00:00
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:
parent
5a5f6d1b7a
commit
da329b44a4
2 changed files with 214 additions and 556 deletions
File diff suppressed because it is too large
Load diff
|
@ -68,38 +68,11 @@ struct _GstDashDemuxStream
|
||||||
GstClockTime position;
|
GstClockTime position;
|
||||||
gboolean restart_download;
|
gboolean restart_download;
|
||||||
|
|
||||||
/*
|
GstEvent *pending_segment;
|
||||||
* 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;
|
|
||||||
|
|
||||||
gboolean stream_eos;
|
gboolean stream_eos;
|
||||||
gboolean need_header;
|
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 */
|
/* Download task */
|
||||||
GMutex download_mutex;
|
GMutex download_mutex;
|
||||||
GCond download_cond;
|
GCond download_cond;
|
||||||
|
@ -127,7 +100,6 @@ struct _GstDashDemux
|
||||||
GSList *next_periods;
|
GSList *next_periods;
|
||||||
|
|
||||||
GstSegment segment;
|
GstSegment segment;
|
||||||
gboolean need_segment;
|
|
||||||
GstClockTime timestamp_offset;
|
GstClockTime timestamp_offset;
|
||||||
|
|
||||||
GstBuffer *manifest;
|
GstBuffer *manifest;
|
||||||
|
@ -143,10 +115,6 @@ struct _GstDashDemux
|
||||||
gfloat bandwidth_usage; /* Percentage of the available bandwidth to use */
|
gfloat bandwidth_usage; /* Percentage of the available bandwidth to use */
|
||||||
guint64 max_bitrate; /* max of bitrate supported by target decoder */
|
guint64 max_bitrate; /* max of bitrate supported by target decoder */
|
||||||
|
|
||||||
/* Streaming task */
|
|
||||||
GstTask *stream_task;
|
|
||||||
GRecMutex stream_task_lock;
|
|
||||||
|
|
||||||
gboolean cancelled;
|
gboolean cancelled;
|
||||||
|
|
||||||
/* Manifest update */
|
/* Manifest update */
|
||||||
|
|
Loading…
Reference in a new issue