Commit graph

62 commits

Author SHA1 Message Date
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
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
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
Olivier Crête 220f075423 dashdemux: Announce correct mpegts caps 2013-05-15 22:24:29 -04: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 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
Andre Moreira Magalhaes (andrunko) b9272dc0e6 dashdemux: Properly parse base uri from mpd. 2013-05-08 18:14:40 -03:00
Thiago Santos 770df6277a dashdemux: refactor to use the uridownloader lib instead of internal copy 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 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 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 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 f46ba44e99 dash: do not try to print a pointer as a string 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 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
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 8f13f246e0 mpdparser: silence warning 2013-05-08 18:14:31 -03:00
Gianluca Gennari 9387365fc9 dashdemux: reworked the API to retrieve fragment timestamp, fragment duration and media presentation duration
This was necessary to support variable-duration Fragments.

in the new API:
- gst_mpd_client_get_current_position returns the timestamp of the NEXT fragment to download;
- gst_mpd_client_get_next_fragment_duration returns the duration of the next fragment to download;
- gst_mpd_client_get_media_presentation_duration returns the mediaPresentationDuration from the MPD file;

also there is a new internal parser function:
- gst_mpd_client_get_segment_duration extracts the constant segment duration from the MPD file
(only used when there is no SegmentTimeline syntax element in the current representation)

In gst_mpd_client_get_next_fragment, we set the timestamp/duration of the fragment just downloaded
copying the values from the corresponding GstMediaSegment.

TODO: rework SEEKING to support seeking across different Periods.
2013-05-08 18:14:25 -03:00
Gianluca Gennari 0abd777257 dashdemux: complete support for Media Presentations with several Periods
- Periods are played in sequence, from PeriodStart to PeriodEnd
- seamless switching from one Period to the next one works fine;
- the 'new-segment' generation is broken, so if we need to switch pads for a new Period there is a crash;
2013-05-08 18:14:10 -03:00
Gianluca Gennari 9d09e99ebe mpdparser: initial support for Media Presentations made of several Periods
- build a list of the available Periods with their start and duration time
- add the list of GstStreamPeriod in the GstMpdClient data struct
- remove cur_period from GstMpdClient and introduce an API to get the current GstStreamPeriod
- several API clean-ups
2013-05-08 18:14:10 -03:00
Olivier Blin ba3bd1c69a mpdparser: support BaseURL for SegmentURL using mediaRange
This is used in big_buck_bunny_CappedVBR_Multirate_4s_0_AudioVideo_MainProfile.mpd
2013-05-08 18:14:10 -03:00
Olivier Blin 767a5ebed0 mpdparser: factorize adding range parameter to URL 2013-05-08 18:14:08 -03:00
Gianluca Gennari 53f383eff0 dashdemux: reworked caps detection
also reworked the API to extract audio/video parameters from the manifest file
(mimeType, width, height, rate, num channels)
2013-05-08 18:14:06 -03:00
Gianluca Gennari fe05060044 dashdemux: do not send bogus duration messages when mediaPresentationDuration is unknown 2013-05-08 18:14:03 -03:00
Gianluca Gennari fba69179e4 mpdparser: support SegmentTimeline syntax also for list-based media segment generation 2013-05-08 18:14:03 -03:00
Gianluca Gennari 362b5e9446 mpdparser: add support for SegmentTimeline syntax elements
build the list of segments to be played using the SegmentTimeline syntax, if present
bugfixes:
- for dynamic MPD files, when mediaPresentationDuration is not present use minimumUpdatePeriod instead
- do not add a spurious '$' when building an URL from a template like "$Bandwidth$/init.mp4v"
- introduce gst_mpd_client_add_media_segment() to avoid code duplication
2013-05-08 18:14:03 -03:00
Gianluca Gennari 8e9ba056d7 mpdparser: fix memory leak in gst_mpd_client_get_next_fragment_set()
we have to free next_fragment_uri
2013-05-08 18:14:03 -03:00
Gianluca Gennari b580ee8cd7 dashdemux: fix playing of single-segment media streams
other fixes:
- fixed a buffering bug: now we stop buffering when we reach the end of manifest
- now gst_mpd_client_get_target_duration() always returns a valid duration
(in case of single-segment streams, we return either Period duration or mediaPresentation duration)
TODO: support SegmentTimeline
2013-05-08 18:14:02 -03:00
Gianluca Gennari 3726ff73ad dashdemux: fix extraction of SegmentTemplate->initialization in gst_mpd_client_get_next_header()
now the following MPD files are properly supported:

http://dash.edgesuite.net/adobe/hdworld_dash/HDWorld-1600.mpd
http://dash.edgesuite.net/adobe/hdworld_dash/HDWorld.mpd
2013-05-08 18:13:58 -03:00