Commit graph

76 commits

Author SHA1 Message Date
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
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 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
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 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 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 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 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 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 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 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