Commit graph

79 commits

Author SHA1 Message Date
Youness Alaoui
4724b9a5b6 hlsdemux: Post duration message when we parse the playlist 2011-08-31 12:09:53 +02:00
Youness Alaoui
f93939b46c hlsdemux: Send a flush-stop when switching pads. Fixes A->A/V sync issue.
This is to ensure that we reset the accumulate segment on the sinks
so if we start with audio only then switch to audio+video, then both
sinks will have the same segments and will be synchronized.
2011-08-31 12:09:38 +02:00
Youness Alaoui
ed5a5cc139 hlsdemux: seems there was a typo, free the adapter if it contains data, not if already empty 2011-08-30 16:18:30 +02:00
Youness Alaoui
4a6d888961 hlsdemux: oups, we need to empty the queue after freeing its content 2011-08-30 16:18:08 +02:00
Youness Alaoui
cb30cd242c hlsdemux: do not broadcast the fetcher_cond on bus error if we're cancelled
If we cancel the fetch and call the stop_fetcher, which holds the lock,
when it sets the fetcher's state to NULL, it might send an error
on the bus. In that case, we must ignore it, otherwise it will try
to take the lock and will block forever.
2011-08-30 16:16:54 +02:00
Jonas Larsson
fc0fe37b10 hlsdemux: Split playslist on \r\n not just \n 2011-08-30 16:16:07 +02:00
Youness Alaoui
6e9eeb7678 hlsdemux: Do not succeed a download if the fetcher had an error 2011-08-30 16:15:41 +02:00
Youness Alaoui
e22c300be2 hlsdemux: Rename functions that need to be called with a locked mutex 2011-08-30 16:15:28 +02:00
Youness Alaoui
50d0468241 hlsdemux: We must signal the fetcher_cond while holding its lock 2011-08-30 16:15:03 +02:00
Youness Alaoui
3054355dc1 hlsdemux: We do not need to set the current playlist to the main one
When caching fragments, if we set the current playlist to main, then
it will always think it's a live stream (no endlist in it) so it will
force the redownload of the main playlist after every seek, which is
unnecessary. Also, it causes a race condition where a seek migh happen
during that redownload, and we'll think we're trying to seek a live pipeline.
2011-08-30 16:14:30 +02:00
Youness Alaoui
108493ee51 hlsdemux: do not make the update_thread joinable 2011-08-26 09:51:46 +02:00
Youness Alaoui
8c04ea47d2 hlsdemux: Ensure the task is paused in case of cache error 2011-08-26 09:51:46 +02:00
Youness Alaoui
46ac6a2589 hlsdemux: stop the threads in the proper order
first pause the task, then stop all fetchers, then stop the update thread
then pause the task again, since it might have been restarted by
another thread in the meantime
2011-08-26 09:51:46 +02:00
Youness Alaoui
015d1e11e2 hlsdemux: do not post an error if we seek/cancel during caching of fragments 2011-08-26 09:51:46 +02:00
Youness Alaoui
d69297a23c hlsdemux: if we're canceling a fetcher, we must stop its thread 2011-08-26 09:51:46 +02:00
Youness Alaoui
42401da686 hlsdemux: lock the update_thread mutex before stopping it 2011-08-26 09:51:46 +02:00
Youness Alaoui
39657fa52f hlsdemux: lock the fetcher mutex before stopping it 2011-08-26 09:51:45 +02:00
Youness Alaoui
e1a0bdcdf5 hlsdemux: do not allow two fetchers to run simultanously 2011-08-26 09:51:45 +02:00
Youness Alaoui
adcfcabb14 hlsdemux: Stop the streaming task on PAUSED_TO_READY state change 2011-08-26 09:51:45 +02:00
Youness Alaoui
a3fc3ec443 hlsdemux: Send buffering messages on the bus 2011-08-24 08:12:19 +02:00
Youness Alaoui
e2de4e5870 hlsdemux: cache the number of fragments we are required to cache 2011-08-24 08:12:14 +02:00
Sebastian Dröge
20f9738c10 hlsdemux: Use FALSE instead of 0 for a bool parameter 2011-08-23 09:23:33 +02:00
Youness Alaoui
3f42050c34 hlsdemux: switch pads when we seek (need_segment) since tsdemux doesn't cope well with a reset 2011-08-23 09:22:40 +02:00
Youness Alaoui
2d90f1c0dc hlsdemux: Add a FIXME comment. loop task should be a pad task 2011-08-23 09:21:03 +02:00
Youness Alaoui
b55f157d6f hlsdemux: Do not seek in a live stream 2011-08-23 09:20:25 +02:00
Youness Alaoui
18f53cf547 hlsdemux: Do not take the pad stream lock, use the task's lock instead 2011-08-23 09:20:14 +02:00
Youness Alaoui
e2f69e1be9 hlsdemux: Implement EVENT_SEEK 2011-08-23 09:19:59 +02:00
Youness Alaoui
475abd15b6 hlsdemux: Implement the GST_QUERY_SEEKING properly 2011-08-23 09:18:16 +02:00
Youness Alaoui
ae4af3910e hlsdemux: Implement correctly the GST_QUERY_DURATION 2011-08-23 09:17:30 +02:00
Youness Alaoui
a916d4dfd2 hlsdemux: Do not use GST_TASK_WAIT in the task function
The task function uses GST_TASK_WAIT which does a g_cond_wait giving it
the GST_OBJECT_GET_LOCK of the task. The mutex gets locked when
g_cond_wait returns, so if we don't lock/unlock it, it will
stay locked forever, preventing the task from ever finishing.
We shouldn't lock the task object lock, so let's remove the GST_TASK_WAIT
and make the task pause instead if there are no buffers in the queue.
2011-08-23 09:16:35 +02:00
Youness Alaoui
690e59e497 hlsdemux: Keep a separate variable for the current variant used
By using a separate variable, first it allows us to sort the lists
of alternates but keep the pointer on the first occurence in the main
playlist (to respect the spec of starting with the bitrate specified
first in the main playlist). It also avoid playing with the lists variable
which should be used to store the list of playlists and not as a pointer
to the current one.
Also fixes a memleak with the g_list_foreach freeing the lists, if it wasn't
pointing to the first element of the list.
2011-08-22 15:46:41 +02:00
Youness Alaoui
5878f71233 hlsdemux: Set buffer timestamp since we send a TIME segment 2011-08-18 14:05:10 +02:00
Youness Alaoui
8b762708cd hlsdemux: Allow bandwidth switching during caching of fragments 2011-08-18 14:00:42 +02:00
Youness Alaoui
a62aa2b774 hlsdemux: set the pad's caps before adding it 2011-08-18 13:53:02 +02:00
Edward Hervey
5572e63858 hlsdemux: Send NEWSEGMENT events
Previously hlsdemux wasn't sending out any newsegment.
Here we push a GST_FORMAT_TIME newsegment, and whenever possible we
try to indicate the proper start time.

This allows downstream elements to relay the start/time values properly
to the sinks, allowing better stream switching.
2011-08-01 18:48:03 +02:00
Edward Hervey
976f4b0bbf hsldemux: Handle change of media types
When switching bitrates, we might end up switching to a different
media-type (like from aac to/from mpeg-ts).

For this switch to behave properly in decodebin2, this patch adds:
* dynamic source pads (which will be added/removed whenever a stream
  media type changes
* re-checking the fragment media type whenever we switch to a different
  playlist
2011-07-27 16:56:37 +02:00
Olaf Seibert
7583080023 hlsdemux: fix wrong usage of GST_ELEMENT_ERROR macros and compilation on NetBSD
https://bugzilla.gnome.org/show_bug.cgi?id=655319
2011-07-27 11:02:41 +01:00
Alessandro Decina
adc0817b2a hls: fix handling of strol() overflows 2011-05-15 10:02:20 +02:00
Andoni Morales Alastruey
851e9b1f8d hlsdemux: set duration in outgoing buffers
Currently we push each fragment as a single buffer.
2011-05-03 14:39:15 +01:00
Tim-Philipp Müller
7ec71fb446 hlsdemux: fix DURATION query handling
Only answer duration queries in TIME format with a duration
in seconds. Make sure we don't return GST_CLOCK_TIME_NONE as
duration (which is non-0, but still invalid/useless).
2011-05-03 12:01:25 +01:00
Tim-Philipp Müller
0d9dbd4c0f hlsdemux: implement SEEKING query 2011-05-03 11:51:44 +01:00
Tim-Philipp Müller
5d6bdf6052 Fix some unused-but-set-variable warnings with gcc 4.6 2011-04-15 00:24:47 +01:00
Andoni Morales Alastruey
9334e819e5 hlsdemux: m3u8: return duration in nanoseconds 2011-04-14 15:36:06 +01:00
Andoni Morales Alastruey
9454003249 hlsdemux: fix handling of end of playlist
Don't send the EOS event until we reached the end of the playlist
and the queue is really empty.
2011-04-14 15:36:06 +01:00
Andoni Morales Alastruey
c890a212b6 hlsdemux: fix example pipeline 2011-04-14 15:36:01 +01:00
Andoni Morales Alastruey
3b19ade905 hlsdemux: ignore seek events until it's implemented 2011-04-14 11:47:50 +01:00
Andoni Morales Alastruey
b49461df48 hlsdemux: dispose the fetcher from the same thread it's created 2011-04-14 11:41:56 +01:00
Thibault Saunier
17fd7ebcb4 android: make it ready for androgenizer
Remove the android/ top dir
Fixe the Makefile.am to be androgenized

To build gstreamer for android we are now using androgenizer which generates the needed Android.mk files.
Androgenizer can be found here: http://git.collabora.co.uk/?p=user/derek/androgenizer.git
2011-04-11 07:27:11 +02:00
Andoni Morales Alastruey
650418b9d8 hlsdemux: validate properly utf-8 playlist 2011-04-04 09:14:05 +02:00
Andoni Morales Alastruey
650142f054 hlsdemux: m3u8: clear the list of media files before updating the playlist 2011-04-04 09:13:41 +02:00