Commit graph

3525 commits

Author SHA1 Message Date
Alex Ashley
ed16c9c560 hls: fix for assert failure when using encrypted HLS streams
When using an HLS encrypted stream, an assertion failure is thrown:
(gst-launch-1.0:31028): GLib-GObject-WARNING **: cannot register
existing type `GstFragment'

(gst-launch-1.0:31028): GLib-CRITICAL **: g_once_init_leave: assertion
`result != 0' failed

Eventually tracked this down to the call gst_fragment_new()
in function gst_hls_demux_decrypt_fragment.

The GstFragment class is defined in ext/hls/gstfragment.c and in
gst-libs/gst/uridownloader/gstfragment.c. Having two class definitions
with the same name causes the assert failure when trying to allocate
GstFragment. Deleting the version from hls and editing the
Makefile.am solves this assert failure.

https://bugzilla.gnome.org/show_bug.cgi?id=704555
2013-07-22 14:55:17 +01:00
Sebastian Dröge
e56efddd4a resindvd: Send stream-start event before anything else on the mpeg demuxer srcpads 2013-07-22 09:19:06 +02:00
Miguel Casas-Sanchez
7c2177b19f grabcut: Add GrabCut segmentation element
https://bugzilla.gnome.org/show_bug.cgi?id=702722
2013-07-17 11:28:28 +02:00
Thiago Santos
ec630db32f dashdemux: fix typo in check_queue_full function
It should return True when the queue IS full

Fixes #704226
2013-07-15 10:05:59 -03:00
Thiago Santos
1472dd3d58 dashdemux: implement queue full check function
Checks if the queue is full according to max buffering time
set by the user

https://bugzilla.gnome.org/show_bug.cgi?id=701404
2013-07-09 01:18:54 -03:00
Thiago Santos
95c2638ba5 dashdemux: minor refactor
Split one very large function into 2 smaller but still large functions.

Also change the if conditions to positive checks to improve readability.
2013-07-09 00:47:07 -03:00
Thiago Santos
5a5e66ec90 dashdemux: handle live playback resync
During a live stream it is possible for dashdemux to lag behind on a
slow connection or to rush ahead of the connection os too fast.

For the first case it is necessary to jump some segments ahead to be able to
continue playback as old segments are usually deleted from the server.

For the later, dashdemux should wait a little before attempting another
download do give time to the server to produce a new segment
2013-07-08 23:40:14 -03:00
Thiago Santos
b316d8a677 dashdemux: fix template based segment generation
When using a template based segment list, do not try to
contruct a finite segment list for the limits of the available periods.

We might not know when the period ends (for live streams) and we can
always create the segment on demand when requested by dashdemux,
avoiding use of some memory and cpu when re-creating this list.
2013-07-08 23:39:49 -03:00
Thiago Santos
a8a355108a dashdemux: use more appropriate data structures for parsing
Replaces the 2 likely larger lists with more appropriate structures
to improve performance.

Replaces S nodes GList for a GQueue, this reduces latency to startup
because of traversing the list just append an element.

Replaces the processed media segments GList for a GPtrArray as it is
constantly acessed by index during playback.
2013-07-08 23:39:49 -03:00
Thiago Santos
b8fc98849a dashdemux: answer to latency queries
Set live if stream is live and also add to the max latency the
max internal buffering
2013-07-08 23:39:49 -03:00
Thiago Santos
9a38127467 dashdemux: prevent assertion when duration is unknown
Duration from segment being unknown is a issue from the MPD and not
a programming issue, so the assert isn't useful here. Instead check
and return an error code so the caller can fallback to alternatives
2013-07-03 19:11:45 -03:00
Thiago Santos
3030c25aed dashdemux: Fix event leak when parsing manifest fails
Always remember to unref the event before proceeding, in both success
and failure cases
2013-07-03 19:11:11 -03:00
Thiago Santos
788757dc1f dashdemux: various cleanups
Removing unused function, replacing // comments with /* */ and
replacing some GST_WARNING with GST_INFO/_DEBUG as they are meant
to be
2013-07-03 15:34:41 -03:00
Alex Ashley
5ad2a2d161 dashdemux: Change first fragment selection for live streams
When dashdemux selects its first fragment, it always selects the
first fragment listed in the manifest. For on-demand content,
this is the correct behaviour. However for live content, this
behaviour is undesirable because the first fragment listed in the
manifest might be some considerable time behind "now".

The commit uses the host's idea of UTC and tries to find the
oldest fragment that contains samples for this time of day.

https://bugzilla.gnome.org/show_bug.cgi?id=701509
2013-07-03 15:34:30 -03:00
Thiago Santos
5c480dfc13 dashdemux: only generate index segment uri if there is a template
Simple fix to avoid an assertion.
2013-07-03 10:23:45 -03:00
Greg Rutz
5920ee2777 dashdemux: Implement inheritance for certain MPD elements
According to the MPEG-DASH spec, certain elements (i.e.
SegmentBase, SegmentTemplate, and SegmentList) should inherit
attributes from the same elements in the containing AdaptationSet
or Period.

Updated the SegmentBase, SegmentTemplate, and SegmentList parsers
to properly inherit attributes from the corresponding elements in
AdaptationSet and/or Period.

https://bugzilla.gnome.org/show_bug.cgi?id=702677
2013-07-03 10:23:45 -03:00
Greg Rutz
5e0ed52880 dashdemux: Properly detect presence of xml attributes
Convert all xml attribute/content parsing functions to return a
boolean value indicating whether or not the attribute/content was
present.  We need this finer-grained control in order to properly
implement the inheritance policies described in the spec

Also fixed several memory leak conditions when handling errors in
the xml attribute/content parsing functions.

https://bugzilla.gnome.org/show_bug.cgi?id=702677
2013-07-03 10:23:45 -03:00
Thiago Santos
467b22c567 dashdemux: change debug message from warning to info
It isn't a warning/issue.
2013-07-03 10:23:45 -03:00
Thiago Santos
94c6497dfa dashdemux: protect from access to empty list data
Check if the list has elements before trying to access the last one
and causing a segfault
2013-07-03 10:23:45 -03:00
Thiago Santos
0a88daaf8e dashdemux: protect against failed header downloads
Avoids criticals when downloaded fragment is NULL
2013-07-03 10:23:45 -03:00
Olivier Crête
3f26bb9154 dashdemux: Handle case without an initialization segment
If no initialization segment is defined, then don't print a
critical or a warning, just ignore it.

https://bugzilla.gnome.org/show_bug.cgi?id=701961
2013-07-02 01:30:24 -03:00
Thiago Santos
4c89fab390 dash: save 1 or 2 string copies when getting fragment uris
Only create new string if required, saving maybe 1 or 2 str copies per
fragment.
2013-07-01 18:52:08 -03:00
Thiago Santos
aa1fe88a08 dashdemux: each fragment can have its own index
Return index URI/range to dashdemux from the mpdparser to be able
to download and deliver them downstream for playback.
2013-07-01 18:52:08 -03:00
Thiago Santos
d68fffc217 dashdemux: handle top-level index urls
Parse and provide access to top-level index segments if available.
dashdemux should push those whenever a header is pushed.

Fixes #700489
2013-07-01 18:52:08 -03:00
Arthur Shipkowski
54d87f071c dashdemux: Fix critical error output when Initialization has no URL
Issue evinced by
http://yt-dash-mse-test.commondatastorage.googleapis.com/car-20120827-manifest.mpd
which produces output like ** (gst-launch-1.0:8060): CRITICAL **:
gst_mpdparser_get_initializationURL: assertion `InitializationURL->sourceURL
!= NULL' failed

https://bugzilla.gnome.org/show_bug.cgi?id=700489
2013-07-01 18:51:30 -03:00
Thiago Santos
d9c324c6c7 dashdemux: prevent crash by checking if the segment node is present
Do not try to access range data if there is no segment node
2013-07-01 14:35:02 -03:00
Thiago Santos
d0befd39f0 dash: use same debug category for dashdemux and the mpd parser
Makes debugging easier
2013-07-01 14:22:02 -03:00
Thiago Santos
4f17112392 dashdemux: add support for range based segments
Use the mediaRange information and pass it to the uridownloader
to correctly download only the segment ranges indicated in the
MPD

https://bugzilla.gnome.org/show_bug.cgi?id=702206
2013-07-01 14:22:01 -03:00
Olivier Crête
ad7ffe64a6 srtp: Don't require a key if both auth and cipher are null 2013-06-28 20:35:16 -04:00
Olivier Crête
47a6118fbc srtp: Move the enums to the common header
The types are used in both the encoder and decoder
2013-06-28 20:35:15 -04:00
Olivier Crête
4d7a186513 srtp: Remove unused code 2013-06-28 20:13:38 -04:00
Greg Rutz
45111f2efe dashdemux: Cleanup memory allocation/deallocation
Ensure that g_free/xmlFree is used correctly based on how the
memory was allocated.

When deallocating GLists, there were many places that were using
g_list_foreach and g_list_free.  Converted these occurrences to
call g_list_free_full.

Add NULL checks to all xmlFree calls since the documentation does
not guarantee that passing NULL is safe

In places where we are strdup'ing memory allocated by libxml2,
changed those calls to use xmlMemStrdup().

There were several places where we were missing g_slice_free when
deallocating a top-level node structure.

https://bugzilla.gnome.org/show_bug.cgi?id=702837
2013-06-25 20:53:17 -03:00
Sebastian Dröge
21ccbbffe5 daaladec: Add decoder element 2013-06-23 11:32:42 +02:00
Sebastian Dröge
da47131cd6 daalaenc: Add encoder element 2013-06-23 11:32:42 +02:00
Sebastian Dröge
07053e5c53 daala: Initial version of a Daala plugin 2013-06-23 11:32:42 +02:00
Edward Hervey
f88f1d0a35 srtp: Fix dist
The enums should not be dist-ed and instead be re-generated when
compiling.
2013-06-23 09:06:29 +02:00
Benjamin Gaignard
3fc6f1d9b7 wayland: Add support for RGBx and RGBA formats
Wayland interface could offer two buffers pixels formats: WL_SHM_FORMAT_XRGB8888 and WL_SHM_FORMAT_ARGB8888.
Update waylandsink to support them and check if the format is really available.

https://bugzilla.gnome.org/show_bug.cgi?id=702112
2013-06-18 14:03:13 +02:00
Tim-Philipp Müller
67e71d7931 opencv: fix CFLAGS order and add plugins base libs includes to CXXFLAGS
https://bugzilla.gnome.org/show_bug.cgi?id=702297
2013-06-18 12:47:34 +01:00
Alban Browaeys
90b51562ab opencv: fixes build by moving the c++ header to gstsegmentation.cpp
Fixes:
In file included from gstsegmentation.h:51:0,
                 from gstopencv.c:42:
/usr/include/opencv2/video/background_segm.hpp:47:16: fatal error: list:
No such file or directory
 #include <list>
                ^
compilation terminated.

https://bugzilla.gnome.org/show_bug.cgi?id=702297
2013-06-18 13:37:26 +02:00
Patricia Muscalu
0d6fc0215c curlsmtpsink: removed an incorrect assert
https://bugzilla.gnome.org/show_bug.cgi?id=702036
2013-06-11 21:08:28 +02:00
Miguel Casas-Sanchez
c313e1d3b8 opencv: add foreground/background segmentation element
Add an element to the opencv plugin for foregroung/background image
sequence segmentation, using one out of 3 algorithms.

https://bugzilla.gnome.org/show_bug.cgi?id=701421
2013-06-11 14:32:43 +02:00
Olivier Crête
5732c53c81 dashdemux: Make gst-indent happy 2013-06-10 18:01:09 -04:00
Sebastian Dröge
aad0992ae6 eglglessink: Remove workaround for a bug in the RPi EGL implementation
It's fixed in the latest firmware since a few weeks.
2013-06-08 14:49:34 +02:00
Arthur Shipkowski
3d50af3e4b dashdemux: Fix issue with get returning a value for max-buffering-time
It was not properly divided by GST_SECONDS. Also fix issue with
max-buffering-time being multiplied by GST_SECONDS every time the
property is retrieved.

https://bugzilla.gnome.org/show_bug.cgi?id=700487
2013-06-07 22:58:33 -03:00
Sebastian Dröge
a7889b05b3 dash: Add to Makefile.am for make dist 2013-06-05 18:01:10 +02:00
Stefan Sauer
3d72bc2bd9 ladspa: fix typos in launch examples 2013-05-28 10:27:17 +02:00
Stefan Sauer
f65bdac49b ladspa: use the registry cache for plugin details
Split the introspection and registration part. This way we only need to open all
plugins when updating the registry. When reading the registry we can register
the elements entierly from the cache.
2013-05-28 10:27:17 +02:00
Miguel Casas-Sanchez
407f3e1856 opencv: Add colour image enhancement element based on Retinex algorithm
Add colour image enhancement element based on Retinex algorithm. Two types
exist, namely basic and multiscale; both are described in this article:

Rahman, Zia-ur, Daniel J. Jobson, and Glenn A. Woodell. "Multi-scale retinex
for color image enhancement." Image Processing, 1996. Proceedings.,
International Conference on. Vol. 3. IEEE, 1996

Visually speaking the result looks a bit funny, but is pretty invariable to
lightning changes, which is good for some applications, like image
segmentation.

https://bugzilla.gnome.org/show_bug.cgi?id=700977
2013-05-27 11:27:20 +02:00
Patricia Muscalu
8303561bd9 curlsmtpsink: terminate transfer thread properly
If no EOS has been sent, the curl readfunc callback will
return ABORT. The media file in that case will not be properly
finalized.

https://bugzilla.gnome.org/show_bug.cgi?id=700886
2013-05-24 23:47:50 +01:00
Miguel Casas-Sanchez
ac4efd2914 opencv: Add skin color detection element
https://bugzilla.gnome.org/show_bug.cgi?id=700654
2013-05-23 11:05:28 +02:00
David Schleef
127fcf05a7 flitetestsrc: audio format is "S16" not "s16" 2013-05-18 14:02:18 -07:00
Thiago Santos
d434f36245 dashdemux: send stream start event
Removes warnings about strict sticky events ordering
2013-05-17 21:23:55 -03:00
Thiago Santos
750137c4be mssdemux: fix wma pro caps creation
WmaPro is actually wmaversion 3, and can also be found by the
WMAP fourcc.

Some manifests also contain the block_align field as "PacketSize"
in the audio track description, the libav decoders require it
to be present in caps.

Fixes #699921
2013-05-17 12:08:10 -03:00
Thiago Santos
504142ea93 mssdemux: fix assertions when a stream caps can't be created
Fixes two assertions related to cleanup for a pad that couldn't
be exposed because the caps couldn't be identified from the
Manifest

Fixes #699921
2013-05-17 11:37:30 -03:00
Thiago Santos
ef66e39d03 eagl: fix handling of surface dimension changes
Detect when the eagl surface changed its dimension (when the user rotates
the device for example) and adapt the egl internals to draw to that,
preventing that ios resizes the image again when drawing.

This is particularly harmful when eagl would scale down a image
to draw and the ios screen would scale it back up because the
surface is now bigger than when the element was configured.
2013-05-16 15:16:30 -03:00
Thiago Santos
27d726fbfa mssdemux: parse block_align, channels and rate from waveformatex if possible
wma v2 expects block_align, channels and rate fields set to its caps.
This isn't present direclty on the manifests, so mssdemux should parse
it from the waveformatex structure

https://bugzilla.gnome.org/show_bug.cgi?id=699924
2013-05-16 15:00:39 -03:00
Thiago Santos
f74f9cd3ab mssdemux: add bitrate info to audio streams
bitrate info is always present on the QualityLevel xml node as part
of the adaptive selection processing, put it into caps as some
decoders require it (avdec_wmav2 for example)

https://bugzilla.gnome.org/show_bug.cgi?id=699924
2013-05-16 15:00:39 -03:00
Thiago Santos
62860f4fa9 mssdemux: send stream id and newsegment before pushing data
Fixes sticky events ordering warnings when data is pushed

https://bugzilla.gnome.org/show_bug.cgi?id=699924
2013-05-16 15:00:39 -03:00
Olivier Crête
220f075423 dashdemux: Announce correct mpegts caps 2013-05-15 22:24:29 -04:00
Nicolas Dufresne
4c4fc14afc mimic: Ensure segment is sent before caps and buffer
https://bugzilla.gnome.org/show_bug.cgi?id=700420
2013-05-15 19:30:40 -04:00
Sebastian Dröge
9e2aee01a8 kateenc: Delay segment event until we have caps 2013-05-15 10:12:09 +02:00
Sebastian Dröge
d997c5db0e katedec/tiger: Don't queue sticky events that would come before CAPS 2013-05-15 10:02:29 +02:00
Sebastian Dröge
c4fe52e33e kateparse: Fix event handling
Internal state should only be reset on FLUSH_STOP, not FLUSH_START.

Also forward pre-caps events immediately and don't queue them.
2013-05-15 09:47:21 +02:00
Sebastian Dröge
1c16489af7 hls: Use GstURIDownloader from the library for now to keep everything in a usable state 2013-05-15 09:21:21 +02:00
Nicolas Dufresne
d45623f532 ladspa: Fix compilation issue when lrdf is enabled
https://bugzilla.gnome.org/show_bug.cgi?id=700328
2013-05-14 19:52:47 +01:00
Juan Manuel Borges Caño
30d7908df2 openal: improved port to 1.0
https://bugzilla.gnome.org/show_bug.cgi?id=698013
2013-05-13 23:48:01 +01:00
Tim-Philipp Müller
0c1f059245 dirac: remove old dirac-research library based codec
It's not developed any more and replaced by the
libschroedinger-based elements in gst-plugins-good.
(The libschroedinger 1.0.9 release notes state "This
is an exciting release: most of the encoding tools in
dirac-research have been ported over to Schrödinger, so
now schro has the same or better compression efficiency
as dirac-research.")
2013-05-12 23:51:32 +01:00
Tim-Philipp Müller
020c93b973 ofa: port to 1.0 2013-05-12 23:42:06 +01:00
Tim-Philipp Müller
0c23ac0565 musicbrainz: remove trm element which is not useful any more
TRM IDs are MusicBrainz' old audio fingerprinting system from
Relatable, they were phased out in favour of MusicIPs PUIDs.

https://wiki.musicbrainz.org/History:TRM
2013-05-12 20:57:25 +01:00
Tim-Philipp Müller
b3e70d30cf neonhttpsrc: add support for SCHEDULING query 2013-05-12 18:52:56 +01:00
Tim-Philipp Müller
e1f4f5ccaa neonhttpsrc: add iradio-mode property and post icy metadata as tags 2013-05-12 18:52:56 +01:00
Tim-Philipp Müller
ca3a83a60d neonhttpsrc: port to 1.0 2013-05-12 18:52:55 +01:00
Sebastian Dröge
275e104be6 egl: Add destroy notify instead of always calling eglTerminate() on the display
In some scenarios, for example in QtWebKit, might be difficult to obtain full
control on the egl display and it might be only accessible indirectly via
eglGetCurrentDisplay().

https://bugzilla.gnome.org/show_bug.cgi?id=700058
2013-05-10 12:50:05 +02:00
Tim-Philipp Müller
0d7967e25e dashdemux: rename src template from src%d to src_%u 2013-05-08 23:17:08 +01:00
Thiago Santos
573a4d440c dash: remove superfluous files
Authors and license are at the top of the source files
2013-05-08 18:59:31 -03:00
Thiago Santos
919cb34fee dash: do not use deprecated glib mutex API 2013-05-08 18:14:46 -03:00
Thiago Santos
34e1b59eca dashdemux: fixing compiler warnings about print formats 2013-05-08 18:14:46 -03:00
Thiago Santos
5855511ba4 dash: enable in configure/makefiles
It was intentionally disabled up to this point to prevent
compile failures as dashdemux development commits were all for
0.10 up to here
2013-05-08 18:14:46 -03:00
Thiago Santos
9f190cdff7 dashdemux: port to 1.0 2013-05-08 18:14:46 -03:00
Thiago Santos
b338cc0d34 dashdemux: Fix another wrong assertion
Also adds a couple log messages for easier debugging
2013-05-08 18:14:46 -03:00
Thiago Santos
3472efda75 dashdemux: remove wrong asserts
Those asserts should be the contrary that they are. And also
the surround functions should already check that. Removing them.
2013-05-08 18:14:46 -03:00
Wim Taymans
665d59edba dashdemux: only start timestamp from 0 for live stream
We only want to adjust the timestamps so that they start from 0 for live
streams. Non-live streams already start from 0 and after a seek we actually want
to timestamp to be the position we seek to.
2013-05-08 18:14:45 -03:00
Wim Taymans
4f9f0b84cf dashdemux: make timestamps start from 0
Non-live streams should timestamp buffers with a running-time starting from
0. Since we already push a 0 -> -1 segment, bring the timestamps to 0
by subtracting the initial timestamp.
2013-05-08 18:14:45 -03:00
Wim Taymans
4ab58e0fb1 dashdemux: also send newsegment on startup 2013-05-08 18:14:45 -03:00
Wim Taymans
cfcaa23959 dashdemux: small cleanup 2013-05-08 18:14:43 -03:00
Thiago Santos
afccf149af dashdemux: live stream playback crashfix 2013-05-08 18:14:42 -03:00
Thiago Santos
d9baed8302 dash: mpdparser: do not cleanup xml lib too early
The xmlCleanupParser function seems to cleanup all statically
allocated libxml variables, making it unusable. We can't guarantee
that dashdemux won't need it anymore, so better not call it.
2013-05-08 18:14:42 -03:00
Thiago Santos
14feeb3ccb dashdemux: reimplementing live streams manifest updates
Manifest updates should be done periodically for live streams,
this patch makes the demuxer create a new manifest client for
the new version and transfers the stream position to the new
one, discarding the old one afterwards.
2013-05-08 18:14:42 -03:00
Thiago Santos
b01a3729c0 dash: mpdparser: allow periods without start time for live streams
Live streams can have undefined start times for the periods and
mpdparser can let that pass instead of erroring out
2013-05-08 18:14:41 -03:00
Thiago Santos
cff4498f7c dash: mpdparser: use guint64 for timestamps
The timestamps can be pretty big, so use guint64 for them
2013-05-08 18:14:41 -03:00
Thiago Santos
a53fd87508 dashdemux: mpd parsing: fix query parameter parsing
Try harder to detect URL parameters and split them to accomodate
the fragment url in the concat:

base-url + fragment-url + url-parameters
2013-05-08 18:14:41 -03:00
Thiago Santos
4ca530f2fe dashdemux: plug some leaks
Add some missing free/unrefs spotted by valgrind
2013-05-08 18:14:41 -03:00
Thiago Santos
c82606a600 dashdemux: remove unused mutexes 2013-05-08 18:14:41 -03:00
Thiago Santos
737d328bb5 dashdemux: properly reset stream status after a flush
The stream eos/end of period status must also be reset after a flushing
seek. This makes seeking after EOS work.
2013-05-08 18:14:41 -03:00
Andre Moreira Magalhaes (andrunko)
fbbf713e45 dashdemux: keep a list of streams periods
Keep a list of streams per period so that the download loop can keep
downloading while the stream loop is still pushing old period's data.
2013-05-08 18:14:41 -03:00
Andre Moreira Magalhaes (andrunko)
b9272dc0e6 dashdemux: Properly parse base uri from mpd. 2013-05-08 18:14:40 -03:00
Andre Moreira Magalhaes (andrunko)
6ecb58c4f8 dashdemux: Remove unused members. 2013-05-08 18:14:40 -03:00
Andre Moreira Magalhaes (andrunko)
497500dbfe dashdemux: Only send newsegment on seek. 2013-05-08 18:14:40 -03:00
Thiago Santos
3bc62ccc51 dashdemux: send segments that overwrite previous ones
This is only done for seeks, so it is fine
2013-05-08 18:14:40 -03:00
Andre Moreira Magalhaes (andrunko)
2b83b4410c dashdemux: switch bitrates without switching pads 2013-05-08 18:14:40 -03:00
Andre Moreira Magalhaes (andrunko)
11697b9968 dashdemux: Remove unusued method. 2013-05-08 18:14:40 -03:00
Andre Moreira Magalhaes (andrunko)
daea47d3f4 dashdemux: Set stream need_header after seek and has_data_queued to FALSE when flushing stream. 2013-05-08 18:14:40 -03:00
Thiago Santos
4a9d7f0a9f dashdemux: do not pause/start the stream loop on playing/paused changes
The demuxer shouldn't care about paused/playing, it should act the
same in both states
2013-05-08 18:14:39 -03:00
Thiago Santos
2fe509d50a dashdemux: remove property that isn't used anymore
Remove some pieces of code that are from an old property
that isn't used anymore
2013-05-08 18:14:39 -03:00
Thiago Santos
460542daaf dashdemux: add a downloadrate utility
A small struct that keeps a short history of fragment download bitrates
to have an average measure of N last fragments instead of using only
the last downloaded bitrate
2013-05-08 18:14:39 -03:00
Thiago Santos
28449ce7d1 dashdemux: sprinkling some more log 2013-05-08 18:14:39 -03:00
Thiago Santos
94dcb60127 dashdemux: change bitrates based on the stream bitrate
Do not use a global bitrate as the sizes of the fragments matter
when calculating the download rate as the connection setup time is
also being taken into the download duration, a smaller fragment
will have a lower bitrate than a larger one.

This avoids switching the bitrates for streams frequently because
of bitrate mismatches
2013-05-08 18:14:39 -03:00
Thiago Santos
770df6277a dashdemux: refactor to use the uridownloader lib instead of internal copy 2013-05-08 18:14:39 -03:00
Andre Moreira Magalhaes (andrunko)
5efedbff0a dashdemux: Make sure switch_pads won't leak any pad. 2013-05-08 18:14:39 -03:00
Andre Moreira Magalhaes (andrunko)
e92531c8f6 dashdemux: Properly stop download and stream tasks where appropriate. 2013-05-08 18:14:39 -03:00
Thiago Santos
288903a203 dashdemux: avoid an assertion when stopping the pipeline
Avoids asserting when dataqueues are setting to flushing due
to a pipeline stop during a pad switch.
2013-05-08 18:14:39 -03:00
Thiago Santos
83c0e1e25d dashdemux: download the next fragment with smaller timestamp
Instead of downloading 1 fragment per stream per download loop,
select the stream with the earlier timestamp and get a fragment
only for that one.

The old algorithm would lead to problems when the fragment durations
were too different for streams.
2013-05-08 18:14:39 -03:00
Thiago Santos
dbd6bde9d1 dashdemux: track segments in the demuxer
Use a GstSegment to track the current segment information in the
demuxer.
2013-05-08 18:14:38 -03:00
Thiago Santos
39924c60a1 dashdemux: remove buffering message emission from dashdemux
dashdemux shouldn't emit the buffering message as that can pause
the pipeline. It has no proper knowledge of the downstream buffering
status so it can pause the pipeline when it isn't necessary. It should
have an internal buffer for downloading the streams ahead of playback,
but that shouldn't make it able to stop the pipeline for buffering.

A particular case in which this is bad is when a pad switch happens
(changing bitrates for example), the new pads dashdemux creates
will get linked to demuxers and new queues will be created,
these queues are initially empty and dashdemux will quickly
drain its buffers by pushing them to those queues. So it
would have no more buffers internally and would emit a
buffering message with a low ratio, causing the pipeline
to pause when it wouldn't be necessary.
2013-05-08 18:14:35 -03:00
Thiago Santos
10b5d4d1cc dashdemux: removing unused code
Cleaning up by removing unused code and variables
2013-05-08 18:14:35 -03:00
Thiago Santos
0d9b5923af dashdemux: re-enable and fix adaptive switching
It is still unstable, but at least it works when the switches aren't
happening after every fragment
2013-05-08 18:14:34 -03:00
Thiago Santos
2d85107299 dashdemux: correctly signal EOS on manifest end
Put EOS on the streams queues after the last fragment from the
last period for each stream. This way we keep it serialized
with the buffers and it will work when streams have different
ending times
2013-05-08 18:14:34 -03:00
Thiago Santos
a19c689dfa dashdemux: detect end-of-period correctly
Detect end of period when there are no more buffers on any of the
streams
2013-05-08 18:14:34 -03:00
Thiago Santos
3a055ac2d1 dashdemux: Use the smallest queue value to define buffering state
The smallest queue should be used to prevent blocking the download
thread when a stream has too much data buffered, leaving the other
streams starving from fragments
2013-05-08 18:14:34 -03:00
Thiago Santos
9777fc5cb5 dash: fix parsing of streams to get correct fragment durations
Use the current stream base time instead of the 0th stream base time
to get default duration for fragments.
2013-05-08 18:14:34 -03:00
Thiago Santos
54542a6000 dashdemux: block waiting for buffers instead of busy wait
Make the streaming loop block waiting for buffers on the queues instead
of busy waiting eating cpu continuously on a queue length check
2013-05-08 18:14:34 -03:00
Thiago Santos
80c6973319 dashdemux: fix seeking on multiple streams
Each stream has its own durations and timestamps, the fragment number
is different for each stream when seeking, so the seek has to be done
for all streams, rather than on a single stream and propagated to
others
2013-05-08 18:14:34 -03:00
Thiago Santos
7330225ac8 dashdemux: Replace GQueue by GstDataQueue
GstDataQueue has proper locking and provides functions to limit the
size of the queue. Also has blocking calls that are useful to
our multithread scenario in Dash.
2013-05-08 18:14:34 -03:00
Thiago Santos
27b1abbda3 dashdemux: move the buffers queues to the streams
Store the buffers separately for each stream, this is clearer than
having a queue with a list of buffers. It also allows easier selection
of buffers to push in later refactors
2013-05-08 18:14:34 -03:00
Thiago Santos
1556d8cb03 dashdemux: refactor streams data to its own struct
Keeps code more organized and similar to what other demuxers
usually do
2013-05-08 18:14:33 -03:00
Thiago Santos
f46ba44e99 dash: do not try to print a pointer as a string 2013-05-08 18:14:33 -03:00
Thiago Santos
f27bb684f7 dashdemux: Remove timing code that delays pushing of fragments
Fragments should be pushed ASAP as downstream should be responsible for
doing the syncrhonization and proper buffering.

This has the great side effect of fixing most of the seeking A/V sync issues.
2013-05-08 18:14:33 -03:00
Thiago Santos
a1447a8ede dash: fixing build warnings
Also running through gst-indent
2013-05-08 18:14:33 -03:00
Louis-Francis Ratté-Boulianne
6acf2fba8f gstdashdemux: add need_header member to know whether the initialization fragment should be pushed 2013-05-08 18:14:33 -03:00
Louis-Francis Ratté-Boulianne
0bed9a6646 dashdemux: don't wait for the whole duration of a fragment when seeking 2013-05-08 18:14:33 -03:00
Louis-Francis Ratté-Boulianne
489d7a174c dashdemux: switch pads and send header file when a newsegment event is sent 2013-05-08 18:14:33 -03:00
Louis-Francis Ratté-Boulianne
04004cdf65 dashdemux: various fixes 2013-05-08 18:14:33 -03:00
David Corvoysier
c901f610c2 Applied gst-indent 2013-05-08 18:14:33 -03:00
David Corvoysier
582aa51fd6 Replaced URL pointing to obsolete Klagenfurt MPD by a new one 2013-05-08 18:14:33 -03:00
Gianluca Gennari
c988ee3a4b mpdparser: fix escape sequence in URL template resolving 2013-05-08 18:14:33 -03:00
Gianluca Gennari
470c860ffa mpdparser: do not switch pads when bitstreamSwitching = true 2013-05-08 18:14:32 -03:00
Gianluca Gennari
e0c55050e1 dashdemux: complete support for manifest file updates 2013-05-08 18:14:32 -03:00
Gianluca Gennari
7092a9c1ac dashdemux: add support for manifest file updates
- the MPD file is updated in the download loop (only if we have a "dynamic" MPD and minimumUpdatePeriod is valid);
- properly LOCK/UNLOCK the GstMpdClient;
2013-05-08 18:14:32 -03:00
Gianluca Gennari
7371b7997b dashdemux: new API to set/get segment index and period index
TODO: rework segment selection to support Representations or Adaptation Sets with segments not aligned
2013-05-08 18:14:32 -03:00
Gianluca Gennari
e7fad847bb dashdemux: new API to load the stream Period with a given index
this avoids to fiddle with stream internals in the code
2013-05-08 18:14:32 -03:00
Gianluca Gennari
9d43e33319 dashdemux: implement seeking across Periods 2013-05-08 18:14:32 -03:00
David Corvoysier
f7c6403432 Applied gst-indent 2013-05-08 18:14:32 -03:00
David Corvoysier
e323c099a0 By default, do not forward pad queries upstream, because it may have unforessen side-effects (forwarding the new 1.0 GST_CAPS query would prevent pad linking for instance) 2013-05-08 18:14:32 -03:00
Olivier Blin
d058a7f2b2 plugin: register as dashdemux instead of fragmented
This fixes conflicts with the HLS plugin, which is also named
fragmented.
When building its registry, gstreamer was picking one or the other
between hls and dashdemux.
2013-05-08 18:14:31 -03:00
Gianluca Gennari
895e804a86 dashdemux: check if we have received the MPD file in the proper way 2013-05-08 18:14:31 -03:00
Gianluca Gennari
8f13f246e0 mpdparser: silence warning 2013-05-08 18:14:31 -03:00
Olivier Blin
0b5eb519e7 dashdemux: fix printing buffering time and download rate/size
This was broken on armv7.
2013-05-08 18:14:31 -03:00
Olivier Blin
bd2784ffbb dashdemux: fix unused-but-set variable 2013-05-08 18:14:30 -03:00
Olivier Blin
cbebb01f23 dashdemux: use new gst_mpd_client_get_next_fragment_duration API
This fixes build that has been broken by commit
fb9aeac6552021b176a4c4bd07265e02a0b70e0f.

gst_mpd_client_get_target_duration has been removed, and
gst_mpd_client_get_next_fragment_duration should be used instead.
2013-05-08 18:14:29 -03:00
Gianluca Gennari
f728e424b2 dashdemux: remove FIXME comment
pad switching across multiple periods works perfectly fine now
and it is done only when there is a change in the CAPS
2013-05-08 18:14:29 -03:00