Commit graph

3480 commits

Author SHA1 Message Date
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
Gianluca Gennari
e96cc18ab9 dashdemux: send new-segment events to all pads 2013-05-08 18:14:27 -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
dc5d7d258e dashdemux: use effective segment duration to reschedule the streaming task
do not assume segment duration is constant

Conflicts:

	ext/dash/gstdashdemux.c
2013-05-08 18:14:22 -03:00
Gianluca Gennari
cfcd9ffac6 dashdemux: reworked gst_dash_demux_get_buffering_time() to return the effective buffering time
do not assume the Fragment duration is constant
2013-05-08 18:14:16 -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
David Corvoysier
41733d8296 Fixed wrong index in fragments 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
David Corvoysier
cf0ab8e1f3 Removed unused function 2013-05-08 18:14:03 -03:00
David Corvoysier
84c8de8ab6 Seek event handling cleanup 2013-05-08 18:14:02 -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
5ade664680 uridownloader: deleted useless declaration of gst_uri_downloader_free() 2013-05-08 18:14:00 -03:00
Gianluca Gennari
122f10669f uridownloader: when possible, reuse existing element to download a new URI
previously a new element was allocated for each media segment, and it was never freed
2013-05-08 18:14:00 -03:00
Gianluca Gennari
5b830c3c91 dashdemux: unref caps in function need_add_header() 2013-05-08 18:13:58 -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
Gianluca Gennari
cd84aaa9aa dashdemux: fix memory leak in gst_dash_demux_get_next_header() 2013-05-08 18:13:58 -03:00
David Corvoysier
95ee452625 We now only accept actual manifest files, and not any XML file 2013-05-08 18:13:58 -03:00
David Corvoysier
763f4c3fc3 Added a typefind helper for DASH: this commit should be reverted as soon as a proper patch has been submitted to gst-plugins-base 2013-05-08 18:13:57 -03:00
David Corvoysier
29c62f4780 Fixed state machine (again) 2013-05-08 18:13:57 -03:00
David Corvoysier
a7ad12e208 Code refactoring 2013-05-08 18:13:57 -03:00
David Corvoysier
f4756f7cb0 Fixed state machine 2013-05-08 18:13:57 -03:00
David Corvoysier
7f2207732b Improve consistency of the tasks shutdown code 2013-05-08 18:13:57 -03:00
David Corvoysier
28aaff747c Added missing g_list_free 2013-05-08 18:13:57 -03:00
David Corvoysier
30fece810f Do not answer to URI queries 2013-05-08 18:13:56 -03:00
David Corvoysier
0e2c3ffc0b Try queries upstream if we cannot process them 2013-05-08 18:13:56 -03:00
David Corvoysier
089daeba1b Renamed demux->next_stream in demux->next_push 2013-05-08 18:13:56 -03:00
David Corvoysier
943f4fa152 Inlined one-line utility funciton that was called only once 2013-05-08 18:13:56 -03:00
David Corvoysier
3cb7b12cbe Fixed regression after the introduction of the multi-screen support, preventing the pipeline from stopping properly 2013-05-08 18:13:56 -03:00
David Corvoysier
6f5d6f91ff Modified log level of shutdown message 2013-05-08 18:13:56 -03:00
David Corvoysier
90be873ee1 Comments: We don't select a single representation, but a representation for each stream Code: cleanup of gst_get_next_fragment (also renamed in gst_get_next_fragment_set) 2013-05-08 18:13:56 -03:00
David Corvoysier
d3c4c48923 Removed debug trace 2013-05-08 18:13:56 -03:00
David Corvoysier
6be9a30ad8 Added introduction and general design notes 2013-05-08 18:13:56 -03:00
David Corvoysier
35c04708ba Fixed wrong comment 2013-05-08 18:13:56 -03:00
David Corvoysier
6255b2762f Documented gst_dash_demux_download_loop 2013-05-08 18:13:55 -03:00
David Corvoysier
5b6bede189 Commented gst_dash_demux_stream_loop 2013-05-08 18:13:55 -03:00
David Corvoysier
b9d6796cb5 Commented needs_pad_switch 2013-05-08 18:13:55 -03:00
David Corvoysier
54fcbf89f1 Documented the representation switch mechanism 2013-05-08 18:13:55 -03:00
David Corvoysier
7764efb761 Replaced references to playlist (HLS) by references to manifest (DASH) 2013-05-08 18:13:55 -03:00
David Corvoysier
ad22e0da6d Renamed gst_dash_demux_switch_playlist to gst_dash_demux_select_representation and added comments 2013-05-08 18:13:55 -03:00
David Corvoysier
204ea9fc67 Removed obsolete comment 2013-05-08 18:13:55 -03:00
David Corvoysier
ae32818105 Applied gst-indent 2013-05-08 18:13:55 -03:00
David Corvoysier
28215b9e12 Updated README 2013-05-08 18:13:55 -03:00
Gianluca Gennari
b4057976be mpdparser: support MPD files with SegmentBase elements encoded inside a SegmentList element
also properly support MPD files without any Initialization segment
2013-05-08 18:13:55 -03:00
Gianluca Gennari
375634f669 mpdparser/dashdemux: fixed get_width, get_height, get_audio_rate, get_num_audio_channels API functions
the actual values now can be extracted also from the AdaptationSet element;
checking NULL structs for better robustness;
2013-05-08 18:13:55 -03:00
Gianluca Gennari
98a41f2c9e mpdparser: added support for single-segment streams with the URL encoded in the baseURL syntax element 2013-05-08 18:13:54 -03:00
Gianluca Gennari
779bf29879 mpdparser: added lang attribute to ProgramInformation node 2013-05-08 18:13:52 -03:00
Gianluca Gennari
94644fa82e mpdparser: added support for Accessibility, Role, Rating, Viewpoint elements to AdaptationSet node
those are DescriptorType elements, so they are just parsed and dumped for now;
2013-05-08 18:13:50 -03:00
Gianluca Gennari
416ea67979 mpdparser: support multiple ProgramInformation nodes
now we keep a list of ProgramInformation nodes for each Period node
2013-05-08 18:13:48 -03:00
Gianluca Gennari
dd198bc86d mpdparser: fixed parsing of SegmentList syntax element, and eliminated Represention node list from Period node
SegmentList nodes are allowed into Period, AdaptationSet or Representation nodes
and there is at most 1 element, so no need to keep a list;

Period nodes cannot have any Represention elements, as AdaptationSet nodes are mandatory;
this breaks compatibility with some legacy DASH test sequences.
2013-05-08 18:13:48 -03:00
Gianluca Gennari
8e3092661a mpdparser: fixed return with no value
gstmpdparser.c: In function ‘gst_mpdparser_get_list_and_nb_of_audio_language’:
gstmpdparser.c:2891: warning: ‘return’ with no value, in function returning non-void
2013-05-08 18:13:48 -03:00
Gianluca Gennari
7330bbfa7a mpdparser.c/.h: changed license from dual MIT/LGPL 2.0 to LGPL 2.1
uniformed licencinsing to the other libraries in the dashdemux project
2013-05-08 18:13:48 -03:00
hzakari
ec44485510 Optimize the two functions that return the number and the list of languages in a single function 2013-05-08 18:13:48 -03:00
Hamid ZAKARI
fab388c9fd Add the headers to the adaptationsets segments if any one of these changed representation 2013-05-08 18:13:46 -03:00
Hamid ZAKARI
713d02b81a Support Multi languages (need a decodebin2 patch) 2013-05-08 18:13:45 -03:00
Hamid ZAKARI
a4ac4a3117 Remove the "TODO" comment 2013-05-08 18:13:45 -03:00
David Corvoysier
3c937636ee Renamed LICENSE into COPYING 2013-05-08 18:13:44 -03:00
David Corvoysier
79dc12cc05 Updated authors 2013-05-08 18:13:44 -03:00
David Corvoysier
6fc0db0e0b Initial import of gstdashdemux sources 2013-05-08 18:13:43 -03:00
Tim-Philipp Müller
43fea50c8a smoothstreaming: pass width, height, channels and rate as integer
g_ascii_strtoull() returns a long long integer, but we need to
pass a normal int to gst_structure_set() for fields of G_TYPE_INT,
so cast appropriately.
2013-05-08 15:42:01 +01:00
Tim-Philipp Müller
99c1dce8db smoothstreaming: fix WMV caps
Makes this show at least a picture:
http://playready.directtaps.net/smoothstreaming/TTLSS720VC1/To_The_Limit_720.ism/Manifest
2013-05-08 10:55:16 +01:00
Thiago Santos
4711da22e9 mssdemux: fixing compiler warnings about print formats 2013-05-07 21:09:49 -03:00
Thiago Santos
4545f4bf4e smoothstreaming: port to 1.0 2013-05-07 21:09:49 -03:00
Thiago Santos
001da5a239 mssdemux: remove already fixed TODO comment 2013-05-07 21:09:49 -03:00
Thiago Santos
210f6c510c mssdemux: replace gst_value_deserialize with simpler function
The deserialization was only used to convert hex strings into
GstBuffers. Replace gst_value_deserialize with a simpler, direct
function.
2013-05-07 21:09:49 -03:00
Thiago Santos
1458500850 mssdemux: fix newsegment event leak 2013-05-07 21:09:48 -03:00
Thiago Santos
e541ec7e63 mssdemux: replace unused parameter
The buffer parameter wasn't being used, it was only to signal if
a buffer was downloaded and advance to the next fragment in the
manifest.

Replace the buffer with a boolean that has the same effect and is
safer
2013-05-07 21:09:48 -03:00
Wim Taymans
6d56eba653 mss: avoid GValue leak 2013-05-07 21:09:48 -03:00
Louis-Francis Ratté-Boulianne
f0b6b79461 mssdemux: fix a small memory leak 2013-05-07 21:09:48 -03:00
Louis-Francis Ratté-Boulianne
00400a838b mssdemux: avoid streaming to fail when download is cancelled
When download was failing repeatedly, it was causing streaming to fail even though it was cancelled on purpose (stopping tasks).
2013-05-07 21:09:48 -03:00
Thiago Santos
b579cb1ddc mssdemux: removing unused functions 2013-05-07 21:09:48 -03:00
Thiago Santos
1d28c574cf mssdemux: switch bitrates without switching pads 2013-05-07 21:09:48 -03:00
Andre Moreira Magalhaes (andrunko)
c8367a346c mssdemux: Check if pads are valid before removing. 2013-05-07 21:09:48 -03:00
Thiago Santos
bf0ea5d561 mssdemux: add a maximum error count for downloads
mssdemux will tolerate a few download errors before emitting an
error message to the bus
2013-05-07 21:09:48 -03:00
Thiago Santos
255eb4b161 mssdemux: use streams bitrate individually
connection setup times seem to matter when measuring the download
rate of different streams. Streams with longer fragments have a
*relatively* lower connection setup time and achieve higher bitrates.

Using the average seems unfair here, so use each stream's measured bitrate
to select its best quality option.
2013-05-07 21:09:48 -03:00
Thiago Santos
52c97834df mssdemux: use downloadbitrate utility for measuring bitrate
downloadbitrate keeps a short history of bitrates and helps
tracking the current average download bitrate for mssdemux
2013-05-07 21:09:48 -03:00
Andre Moreira Magalhaes (andrunko)
68308b3e54 mssdemux: Properly compute new bitrate and use bitrate_limit. 2013-05-07 21:09:48 -03:00
Andre Moreira Magalhaes (andrunko)
706b127daa mssdemux: Avoid a possible division by zero 2013-05-07 21:09:48 -03:00
Andre Moreira Magalhaes (andrunko)
28beb2ebd7 mssdemux: Add missing object param to GST_DEBUG|INFO_OBJECT calls 2013-05-07 21:09:48 -03:00
Thiago Santos
2219a3a1cc mssdemux: add bitrate-limit property
It allows the plugin to use its own downloading bitrate measures
as a feedback to select the best streams bitrate for the current
network scenario
2013-05-07 21:09:48 -03:00
Thiago Santos
a0a05b2941 mssdemux: use the shared uridownloader lib instead of an internal copy 2013-05-07 21:09:47 -03:00
Andre Moreira Magalhaes (andrunko)
12e9432847 mssdemux: Do not block on reset.
We need to cancel the downloader for each stream before joining the main download task, otherwise
the download task will block until all the stream tasks finish.
2013-05-07 21:09:47 -03:00
Louis-Francis Ratté-Boulianne
8ab3d09f81 mssdemux: handle FLUSH events by resetting the demuxer state 2013-05-07 21:09:47 -03:00
Louis-Francis Ratté-Boulianne
4a630f86f8 mssdemux: add conditions to prevent some crashes 2013-05-07 21:09:47 -03:00
Louis-Francis Ratté-Boulianne
218f2dee0c mssdemux: use standard glib methods 2013-05-07 21:09:47 -03:00
Louis-Francis Ratté-Boulianne
44d02efee0 mssdemux: fix some memory leaks and use right free function 2013-05-07 21:09:47 -03:00
Louis-Francis Ratté-Boulianne
b064910895 mssdemux: don't stop a task from inside the loop
Only pause the task
2013-05-07 21:09:47 -03:00
Louis-Francis Ratté-Boulianne
0239d77999 mssdemux: log manifest content for debugging 2013-05-07 21:09:47 -03:00
Louis-Francis Ratté-Boulianne
ea5f2718bf mssdemux: make codec private data from manifest attributes with AAC-LC
When the codec is AAC-LC, some server implementation (e.g. Microsoft IIS) doesn't add the CodecPrivateData attribute. The element needs to re-create the codec data from the Quality Level attributes (channels and sampling rate).
2013-05-07 21:09:47 -03:00
Louis-Francis Ratté-Boulianne
3ebb842388 mssdemux: only try to reload the manifest for live streams
There is no way to know if a live stream is really finished, so try to reload the manifest and check if there are more fragments to download. Else just let know it's the EOS.
2013-05-07 21:09:47 -03:00
Thiago Santos
7cb3a367f6 mssdemux: add some documentation
Adds a little bit of docs explaning the internals of mssdemux
2013-05-07 21:09:47 -03:00
Thiago Santos
46efc08809 mssdemux: add max-queue-size-buffers property
Indicates how much buffering should be done internally in
mssdemux
2013-05-07 21:09:47 -03:00
Thiago Santos
23ad760e3a mssdemux: stop tasks faster
Issue a cancel to the downloaders so they stop earlier
2013-05-07 21:09:47 -03:00
Thiago Santos
aa1713068a mssdemux: implement live streams handling
Live streams force the demuxer to keep reloading the Manifest from
time to time, as the new fragments are being added as they are recorded.
The demuxer should also try to keep up and detect when it had to skip
fragments, marking the discont flag when that happens.

Curiously, the spec doesn't seem to mention when/how a live stream is supposed
to end, so keep trying downloads until the demuxer errors out.
2013-05-07 21:05:12 -03:00
Thiago Santos
0704f15103 mssdemux: do not leak fragments 2013-05-07 21:05:12 -03:00
Thiago Santos
21872e78b8 mssdemux: fix issue on fragment timestamping parsing
Use guint64 as the fragments can start at very high numbers,
specially on live streams
2013-05-07 21:05:12 -03:00
Thiago Santos
0a4c077d2e mssdemux: error out when upstream doesn't implement URI query
Error out when upstream doesn't answer to URI query and mssdemux
doesn't know the URI to fetch the fragments from
2013-05-07 21:05:12 -03:00
Thiago Santos
1116eee681 mssdemux: push newsegments with same start time on bitrate switches
This keeps sinks working in sync after a bitrate switch
2013-05-07 21:05:12 -03:00
Thiago Santos
c2ae981e6d mssdemux: rewriting pad tasks so that buffers are pushed by ts order
Use pad tasks to download data and an extra task that gets the earlier
buffer (with the smallest timestamp) and pushes on the corresponding
pad.

This prevents that the audio stream rushes ahead on buffers as its
fragments should be smaller
2013-05-07 21:05:12 -03:00
Thiago Santos
fba63178fe mssdemux: some fixes to bitrate switching
Removes a possible deadlock from bitrate switching when the pad
that requested the switch blocks on its pad-push
2013-05-07 21:05:12 -03:00
Thiago Santos
6ca10e6c1b mssdemux: refactoring fragment download to its own function
Makes code clearer and helps changing the download part of the
code to its own thread
2013-05-07 21:05:11 -03:00
Thiago Santos
da4fad2f6f mssdemux: implement bitrate switching
When connection-speed changes, signal that we might need a bitrate
switch. During the switch, a new pad group is added and the old one
is drained and removed.

New pads also need to push newsegments before starting to stream
2013-05-07 21:05:11 -03:00
Thiago Santos
b9aec0ad0d mssdemux: add connection-speed property
This speed limits the maximum bitrate of streams. Currently it
is only read when starting the pipeline, but it should be used
for switching bitrates during playback to adapt to network
changes.
2013-05-07 21:05:11 -03:00
Thiago Santos
4b6900999a mssdemux: add an 'active' flag to manifest stream
mssdemux should set the streams it has exposed as active so that
the manifest won't use the non-active streams to compute total bitrates
or providing fragments
2013-05-07 21:05:11 -03:00
Thiago Santos
4726115e83 mssdemux: signal no-more-pads when finished exposing pads
This makes decodebin/playbin mechanism know it can start playing
when buffering is finished
2013-05-07 21:05:11 -03:00
Thiago Santos
eec8164d9c mssmanifest: Keep the stream qualities list sorted by bitrate
This will help making adaptive streaming chose the best rate
for a particular connection speed
2013-05-07 21:05:11 -03:00
Thiago Santos
013c11f7dd mssdemux: also consider fourcc AVC1 as H264
H264 can be represented by both fourccs H264 and AVC1, use both.
2013-05-07 21:05:11 -03:00
Thiago Santos
4293cfa763 mssmanifest: add support for VC-1 and WmaPro formats parsing
VC-1 should map to WMV3 and WmaPro to WMA2
2013-05-07 21:05:11 -03:00
Thiago Santos
3f2409f7e2 mssdemux: do not try to expose unknown streams
When the stream can't have its caps detected, better not to expose it.
If no streams are known, signal an error about no playable streams to
the application
2013-05-07 21:05:11 -03:00
Thiago Santos
b2ba96bb85 mssmanifest: do not set codec_data when it is empty
Some manifests contain empty codec datas, better not set them
2013-05-07 21:05:11 -03:00
Thiago Santos
9b3f67c5b0 mssdemux: set timestamp and duration to fragment buffers
We can get those from the manifest and helps downstream to know
the fragment start time after a seeking operation
2013-05-07 21:05:11 -03:00
Thiago Santos
ebd0862ac1 mssmanifest: fix typo
Fix typo that was making the advance fragment function return a wrong
flow return in case it was already EOS
2013-05-07 21:05:11 -03:00
Thiago Santos
cb7e3d1f3b mssdemux: initial implementation of seek event handling
Adds basic handling for seek in time events. Needs to cooperate
with the downstream qtdemux so that it forwards the seeks and
the corresponding newsegments
2013-05-07 21:05:11 -03:00
Thiago Santos
33d872916b mssdemux: handle src pad queries fir duration and latency
Add a src pad query handler to get the duration from the manifest
and report it upstream.

Also adds a simple handler for latency queries
2013-05-07 21:05:11 -03:00
Thiago Santos
0f1ef317f0 mssdemux: add some more error handling
Post error in some more scenarios:
* when the manifest has no streams
* when getting the fragment url fails
2013-05-07 21:05:11 -03:00
Thiago Santos
3f15c9b05a mssdemux: add timescale to the caps
This is important for downstream to properly timestamp the samples

The default value is 10000000, but this can be set in the stream
or at the top-level manifest entry
2013-05-07 21:05:10 -03:00
Thiago Santos
68d2719c9f mssdemux: parse the fps from h264 codec data if possible
Use h264 codec parsing lib to extract the fps from the manifest's
codec data as it doesn't seem to provide it anywhere else
2013-05-07 21:05:10 -03:00
Thiago Santos
af4c690995 mssdemux: correctly add h264 codec data to caps
Need to construct an avcc atom from the codecdata read from MSS
manifests to make h264 decoders/parsers accept it
2013-05-07 21:05:10 -03:00
Thiago Santos
edea61b758 mssdemux: add the correct caps to the outgoing stream
mssdemux outputs a quicktime variant, named mss-fragment
2013-05-07 21:05:10 -03:00
Thiago Santos
32d8a72bfc mssdemux: set caps to buffers before pushing
Also update to the latest gstfragment API that provides
the fragment as a whole buffer.
2013-05-07 21:05:10 -03:00
Thiago Santos
91dd173f3c mssdemux: improve state changing
Keep a ref on pad to prevent it being unreffed while the mssdemux
streams are still using it. Also reset the element when going to
ready instead of when going to null.
2013-05-07 21:05:10 -03:00
Thiago Santos
b4f994d47c mssdemux: adds mininum error handling
This should care for basic scenarios of errors and EOS to allow
the pipeline to stop correctly
2013-05-07 21:05:10 -03:00
Thiago Santos
96522f474c mssdemux: mssmanifest: prevent accessing null stream fragment
Move the access to the stream fragment data after the check
if the fragment exists to prevent a segfault
2013-05-07 21:05:10 -03:00
Thiago Santos
ca4e5c34cb smoothstreaming: refactor structure names and implement url fetching
Use shorter names for the MSS manifest helper structure and functions.

Also continues the implementation of the stream fetching and pushing loop.
Now it uses the base url correctly and already fetches and pushes the fragments
downstream
2013-05-07 21:05:10 -03:00
Thiago Santos
7ceb023682 mssdemux: initial implementation of the pad loop
The loop will fetch a new fragment and push on its srcpad. Each
stream has its own loop
2013-05-07 21:05:10 -03:00
Thiago Santos
6b63a7dc81 mssdemux: more manifest parsing and helper functions
Now the mss manifest is able to generate the files urls
2013-05-07 21:05:10 -03:00
Thiago Santos
5291985efe mssdemux: pad exposing initial implementation
Does some basic parsing of the stream caps and adds a pad for
each stream detected in the manifest
2013-05-07 21:05:10 -03:00
Thiago Santos
72b05c0051 mssdemux: add manifest parsing
Continued implementing:
1) parse the manifest with libxml2
2) detect stream types
2013-05-07 21:05:10 -03:00
Thiago Santos
95e87fbee9 smoothstreaming: stubs for mssdemux
Just the stubs for mssdemux element.
Also add some useful code from hlsdemux that we intend to reuse
2013-05-07 21:05:10 -03:00
Thiago Santos
ef25e05b7c smoothstreaming: build directory stubs for new plugin
Initial build structure for MS' Smooth Streaming plugin

Conflicts:
	ext/Makefile.am
2013-05-07 20:02:41 -03:00
Stefan Sauer
7aeed2d79d ladspa: sync controlled parames in filters and sinks 2013-05-03 21:46:53 +02:00
Sebastian Dröge
a845d6d0db ladspa: Add $(GMODULE_NO_EXPORT_LIBS) for gmodule 2013-05-03 16:55:00 +02:00
Juan Manuel Borges Caño
70e208d08e ladspa: improved port to gstreamer 1.0
Fixes: #698927
2013-05-03 12:36:44 +02:00
Tim-Philipp Müller
9056e775a9 kate: fix buffer leak in katetag
Makes unit test valgrind clean.

https://bugzilla.gnome.org/show_bug.cgi?id=697071
2013-04-27 12:28:58 +01:00
Tim-Philipp Müller
de3bd76051 kate: minor cleanup 2013-04-27 12:06:28 +01:00
Sebastian Dröge
9f25db0981 eglglessink: Use gst_egl_display_get() instead of passing a GstEGLDisplay to EGL functions 2013-04-24 09:40:24 +02:00
Tim-Philipp Müller
4b256e729e tests: fix remaining kate tests
https://bugzilla.gnome.org/show_bug.cgi?id=697071
2013-04-23 01:17:56 +01:00
Thiago Santos
b40c9ff39a eglglessink: eagl: fix eagl reuse by not releasing the context
It seems EAGL expects the application to simply ignore unused
EAGL contexts as the resources for it would be released when a new
context is set as the current one. Also move the egl extensions
querying to after a context is set to prevent crashes.

This makes the EAGL version of eglglessink reusable.
2013-04-19 08:45:02 +02:00
Sebastian Dröge
baa9754f6f eglglessink: Give only SECONDARY rank
If available we still prefer xvimagesink.
2013-04-18 15:27:11 +02:00
Josep Torra
87f2bae822 eglglessink: fixes 'makes integer from pointer without a cast' warning 2013-04-18 12:54:31 +02:00