Commit graph

114 commits

Author SHA1 Message Date
Thiago Santos ce7319c62d mssdemux: avoid deadlocking when erroring
It might get stuck when posting the message while
a reconfigure event is being pushed upstream
2014-05-12 18:28:45 -03:00
Thiago Santos a1f87d0b4f mssdemux: fix caps leak 2014-05-12 18:08:12 -03:00
Thiago Santos 6b8448c245 mssdemux: handle error messages from internal source
set up a bin message handler to get notified of error messages from
the internal source element
2014-05-12 18:08:12 -03:00
Thiago Santos b627d7df83 mssdemux: Always accept the latency configure event
Upstream or internal elements are irrelevant and we should
always succeed.
2014-05-12 16:27:37 -03:00
Thiago Santos b54367e211 mssdemux: reenable segment tracking for streams
Store the latest pushed timestamp so that mssdemux streams know
where they are in time
2014-05-12 16:27:37 -03:00
Thiago Santos 45d5859131 mssdemux: deprecate unused max-queue-size-buffers
There is no internal storage of buffers anymore
2014-05-12 16:27:37 -03:00
Thiago Santos 99a2e425de mssdemux: measure bitrate similarly to hlsdemux
new bitrate = (old bitrate + (last fragment bitrate * 3)) / 4
2014-05-12 16:27:37 -03:00
Thiago Santos 90577c3ae7 mssdemux: remove uridownloader in favor of internal source
Refactor mssdemux to remove uridownloader to use an internal
source element which reduces startup latency and provides smaller
buffers for better buffering management downstream
2014-05-12 16:27:37 -03:00
Sebastian Dröge 3c2fe80ab6 mssdemux: Update for uri downloader API changes 2014-05-05 09:41:51 +02:00
Sebastian Dröge 5d34b071d9 mssdemux: Update for URI downloader API changes
And include the manifest file as referer in requests, and make sure
to set refresh=TRUE when updating the manifest.
2014-05-02 10:43:06 +02:00
Vincent Penquerc'h 14f8172d2b smoothstreaming: avoid using an uninitialized manifest
If we did not set the manifest yet, early out in the seeking query.

Coverity 1139737
2014-04-10 09:51:07 +01:00
Vincent Penquerc'h 88879654df smoothstreaming: remove unnecessary check
The function is static, the only call site passes a non NULL
pointer, and the pointer is dereferenced before anyway.

Coverity 1139839
2014-04-09 17:10:06 +01:00
Sebastian Dröge b47a4faf5f ext: Use Codec/Demuxer/Adaptive for the adaptive streaming demuxers 2014-02-23 00:11:04 +01:00
Sebastian Dröge a11c6640bf mssdemux: Download the manifest with compression, the fragments without 2014-02-12 13:11:38 +01:00
Sebastian Dröge 3a5abc233d ext: Update for GstUriDownloader API changes 2014-02-11 14:18:32 +01:00
Thiago Santos 6348113777 mssdemux: updating docs explaining how it works
mssdemux changed a lot and the docs were not correct anymore.

Also adds the 'Adaptive' category to its details
2013-12-20 00:40:42 -03:00
Thiago Santos ff1e88ce93 mssdemux: do not push event holding object lock
Can lead to deadlocks as the push might block downstream in
serialized event cases.
2013-12-20 00:40:42 -03:00
Thiago Santos aa61251371 mssdemux: lock around 'cancelled' flag
Prevents race conditions when pipeline is seeking near eos
2013-12-20 00:40:42 -03:00
Thiago Santos 628461b4d1 mssdemux: fix segfault when trying to access codec_data
Check if codec_data was obtained before trying to use it to
prevent a segfault
2013-12-18 18:52:19 -03:00
Thiago Santos 5948a07324 mssdemux: also generate caps from audiotag attribute
Some audio will have its audio format defined by the AudioTag
instead of the Fourcc. Fallback to using AudioTag if Fourcc
isn't available
2013-12-18 18:52:19 -03:00
Thiago Santos 26acbbcca9 mssdemux: make sure streams stop properly on cancelled
specially when the gst_task_join is waiting for the task
to go stop and the task itself sets its back to paused, causing
a deadlock on exit.
2013-12-18 18:52:19 -03:00
Thiago Santos 99c8fb7330 mssdemux: track segments per stream
As streams now flow independently, the GstSegment needs to be put
on each stream so they can track the position of each one correctly
instead of being mixed in a single segment
2013-12-18 18:52:19 -03:00
Guillaume Desmottes f44c6ed526 mssdemux: push language code tag
https://bugzilla.gnome.org/show_bug.cgi?id=712358
2013-12-18 18:52:19 -03:00
Guillaume Desmottes d6a9f17d8a mssmanifest: store the language of the stream
https://bugzilla.gnome.org/show_bug.cgi?id=712358
2013-12-18 18:52:19 -03:00
Thiago Santos 67f3190301 mssdemux: remove the stream loop task
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
2013-12-18 18:52:19 -03:00
Thiago Santos 4e6e1315da mssdemux: Improve logging
Show the stream's pad on log messages to make easier to debug
issues in the multiple threads
2013-12-18 18:52:18 -03:00
Thiago Santos 056420940e mssdemux: improve flow return handling
Handle different flow returns both from the streaming and the
downloading loops
2013-12-18 18:52:18 -03:00
Thiago Santos e847bea1e1 mssdemux: remove stream locks
Simplify the locking by using a single lock instead of having one
lock per stream. This still works and is simpler to maintain.
2013-12-18 18:52:18 -03:00
Thiago Santos 2ce4f6a8e4 mssdemux: avoid downloading not-linked streams
When a stream gets a not-linked return, it will be marked as so and
won't download any more new fragments until a reconfigure event
is received. This will make mssdemux expose all pads, but only download
fragments for the streams that are actually being used.

Relying on the pads being linked/unlinked isn't enough in this scenario
as there might be an input-selector downstream that is actually discarding
buffers for a given linked pad.

When streams are switching, the old active stream can be blocked because
input-selector will block not-linked streams. In case the mssdemux's
stream loop is blocked pushing a buffer to a full queue downstream it will
never unblock as the queue will not drain (input-selector is blocking).

In this scenario, stream switching will deadlock as input-selector is
waiting for the newly active stream data and the stream_loop that would
push this data is blocked waiting for input-selector.

To solve this issue, whenever an stream is reactivated on a reconfigure
it will enter into the 'catch up mode', in this mode it can push buffers
from its download thread until it reaches the currrent GstSegment's position.
This works because this timestamp will always be behind or equal to the maximum
timestamp pushed for all streams, after pushing data for this timestamp,
the stream will go back to default and be pushed sequentially from the main
streaming thread. By this time, the input-selector should have already
released the thread.

https://bugzilla.gnome.org/show_bug.cgi?id=711849
2013-12-18 18:52:18 -03:00
Antonio Ospite c4fbff50df mssdemux: fix setting codec_data when using WaveFormatEx
When using WaveFormatEx the actual codec private data is at the end of
the wav header structure, after the cbSize field, see for example the
notes at http://wiki.multimedia.cx/index.php?title=WAVEFORMATEX

The previous code was erroneously passing the whole WAVEFORMATEX
structure as codec_data.

The smoothstreaming specifications[1,2,3] always mention WAVEFORMATEX
and never smaller structures like WAVEFORMAT or PCMWAVEFORMAT, so the
buffer can assumed to be at least 18 bytes and always consuming the wav
header gives the (possibly empty) codec private data.

[1] http://web.archive.org/web/20120907004742/http://www.iis.net/community/files/media/smoothspecs/%5BMS-SMTH%5D.pdf
[2] http://download.microsoft.com/download/B/0/B/B0B199DB-41E6-400F-90CD-C350D0C14A53/%5BMS-SSTR%5D.pdf
[3] http://download.microsoft.com/download/9/5/E/95EF66AF-9026-4BB0-A41D-A4F81802D92C/%5BMS-SSTR%5D.pdf

https://bugzilla.gnome.org/show_bug.cgi?id=699924
2013-11-27 09:26:36 -03:00
Antonio Ospite f02e7a2439 mssdemux: use mssdemux_debug debug category for gstmssmanifest.c too 2013-11-27 09:26:36 -03:00
Antonio Ospite 8345c5acfb mssdemux: fix coding style 2013-11-27 09:26:36 -03:00
Thiago Santos 27b0086e4a mssdemux: do not try to deinit the downloadrate while it is used
This can cause an assertion or deadlocks.
2013-11-15 12:01:55 -03:00
Thiago Santos fe77ee47c9 mssdemux: also consider /manifest
The spec says /Manifest, but /manifest is easily found on some
services, so handle that, too.

https://bugzilla.gnome.org/show_bug.cgi?id=710223
2013-11-15 12:01:54 -03:00
Sebastian Dröge fef9ef6a8e dash/smoothstreaming: Remove unused debug category with the same name
It caused static linking to fail.
2013-09-19 20:09:59 +02:00
Thiago Santos 1b1332cb6d mssdemux: use gst_data_queue_push_force for adding events to queue
This prevents locking on startup when a stream only has a single buffer
for one of the streams and mssdemux decides to push an EOS event right
after it.
2013-08-13 12:44:41 -03:00
Edward Hervey 97426a1caa all: Fix for GST_DISABLE_GST_DEBUG
Where applicable, remove methods that don't do anything different than
the default implementation.
2013-07-29 09:42:12 +02:00
Sebastian Dröge 5b702b894e mssdemux: Add support for group-id in the stream-start event 2013-07-23 10:33:31 +02: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 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
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