summaryrefslogtreecommitdiff
path: root/libavformat/hls.c
Commit message (Collapse)AuthorAge
* Mark read-only tables as staticDiego Biurrun2016-05-05
|
* lavf: replace AVStream.codec with AVStream.codecparAnton Khirnov2016-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, AVStream contains an embedded AVCodecContext instance, which is used by demuxers to export stream parameters to the caller and by muxers to receive stream parameters from the caller. It is also used internally as the codec context that is passed to parsers. In addition, it is also widely used by the callers as the decoding (when demuxer) or encoding (when muxing) context, though this has been officially discouraged since Libav 11. There are multiple important problems with this approach: - the fields in AVCodecContext are in general one of * stream parameters * codec options * codec state However, it's not clear which ones are which. It is consequently unclear which fields are a demuxer allowed to set or a muxer allowed to read. This leads to erratic behaviour depending on whether decoding or encoding is being performed or not (and whether it uses the AVStream embedded codec context). - various synchronization issues arising from the fact that the same context is used by several different APIs (muxers/demuxers, parsers, bitstream filters and encoders/decoders) simultaneously, with there being no clear rules for who can modify what and the different processes being typically delayed with respect to each other. - avformat_find_stream_info() making it necessary to support opening and closing a single codec context multiple times, thus complicating the semantics of freeing various allocated objects in the codec context. Those problems are resolved by replacing the AVStream embedded codec context with a newly added AVCodecParameters instance, which stores only the stream parameters exported by the demuxers or read by the muxers.
* hls: disallow opening nested files in child demuxersAnton Khirnov2016-02-22
|
* hls: eliminate ffurl_* usageAnton Khirnov2016-01-24
| | | | | Now all IO should go through the IO callbacks and be interceptable by the caller.
* lavf: allow custom IO for all filesAnton Khirnov2016-01-24
| | | | | | | | | | | | | | Some (de)muxers open additional files beyond the main IO context. Currently, they call avio_open() directly, which prevents the caller from using custom IO for such streams. This commit adds callbacks to AVFormatContext that default to avio_open2()/avio_close(), but can be overridden by the caller. All muxers and demuxers using AVIO are switched to using those callbacks instead of calling avio_open()/avio_close() directly. (de)muxers that use the URLProtocol layer directly instead of AVIO remain unconverted for now. This should be fixed in later commits.
* avpacket: Replace av_free_packet with av_packet_unrefLuca Barbato2015-10-26
| | | | | | | `av_packet_unref` matches the AVFrame ref-counted API and can be used as a drop in replacement. Deprecate `av_free_packet`.
* hls: Check av_opt_set_dict return value as wellLuca Barbato2015-10-01
| | | | Bug-Id: CID 1320426
* hls: Save and forward avio optionsLuca Barbato2015-07-30
| | | | | | Make possible to send the custom headers and override the user agent. Reported-by: BenWonder
* lavf: Use av_gettime_relativeMartin Storsjö2014-10-24
| | | | | | | | | The ones left using av_gettime are NTP timestamps (for RTCP, which is specified to send the actual current realtime clock in RTCP SR packets), and the NUT muxer timestamper, which is documented as using wallclock time. Signed-off-by: Martin Storsjö <martin@martin.st>
* hls: Avoid reading outside of the allocated arrayMartin Storsjö2013-11-22
| | | | | CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* hls: Check whether the AVIOContext contains a new redirected URLMartin Storsjö2013-11-22
| | | | | | | This allows both the main playlist itself as well as the variant playlists to handle redirects combined with relative URLs. Signed-off-by: Martin Storsjö <martin@martin.st>
* hls: Call avformat_find_stream_info() on the chained demuxersMichael Niedermayer2013-07-30
| | | | | | | | | This allows the chained demuxer (or more precisely, the lavf utility code) to better fill in timestamps on packets from these, especially for cases where one stream is a raw ADTS stream. Signed-off-by: Martin Storsjö <martin@martin.st>
* hls: Free packets when skipping packets when seekingMartin Storsjö2013-07-29
| | | | | | This fixes memory leaks present since 2b3d041cdc. Signed-off-by: Martin Storsjö <martin@martin.st>
* hls: Store all durations in AV_TIME_BASEMartin Storsjö2013-07-29
| | | | | | | | | Also parse segment durations as floating point, which is allowed since HLS version 3. This is based on a patch by Zhang Rui. Signed-off-by: Martin Storsjö <martin@martin.st>
* hls: Store first_timestamp in units of AV_TIME_BASEMartin Storsjö2013-07-29
| | | | | | | | | | | | | | | | | | | | | When first_timestamp was stored as-is, its actual time base wasn't known later in the seek function. Additionally, the logic (from 795d9594cfa) for scaling it based on stream_index is flawed - stream_index in the seek function only specifies which stream the seek timestamp refers to, but obviously doesn't say anything about which stream first_timestamp belongs to. In the cases where stream_index was >= 0 and all streams had the same time base, this didn't matter in practice. Seeking taking first_timestamp into account is problematic when one variant is mpegts (with real timestamps) and one variant is raw ADTS (with timestamps only being accumulated packet duration), where the variants start at totally different timestamps. Signed-off-by: Martin Storsjö <martin@martin.st>
* hls: Create an AVProgram for each variantLYF2013-07-29
| | | | | | | | | Without the information, an application may choose audio from one variant and video from another variant, which leads to fetching two variants from the network. This enables av_find_best_stream() to find matching audio and video streams, so that only one variant is fetched. Signed-off-by: Martin Storsjö <martin@martin.st>
* hls: Respect the different stream time bases when comparing dtsMichael Niedermayer2013-07-29
| | | | | | | | | | | | | | | | | | Also adjust the streams timestamps according to their start timestamp when comparing. This helps getting correctly interleaved packets if one stream lacks timestamps (such as a plain ADTS stream when the other variants are full mpegts) when the others have timestamps that don't start from zero. This probably doesn't work properly if such a stream is temporarily disabled (via the discard flags) and then reenabled, and such streams are hard to correctly sync against the other streams as well - but this works better than before at least. The segment number restriction makes sure all variants advance roughly at the same pace as well. Signed-off-by: Martin Storsjö <martin@martin.st>
* hls: Set stream offset before opening a chained demuxerMartin Storsjö2013-07-29
| | | | | | | This makes sure we don't accidentally check discard flags for the wrong stream. Signed-off-by: Martin Storsjö <martin@martin.st>
* hls: Don't check discard flags until the parent demuxer's streams actually existMichael Niedermayer2013-07-29
| | | | | | | | If passing the end of one segment while initializing the chained demuxer, the parent demuxer's streams aren't set up yet, so we can't recheck the discard flags. Signed-off-by: Martin Storsjö <martin@martin.st>
* hls: Copy the time base from the chained demuxerMichael Niedermayer2013-07-29
| | | | | | | When a variant stream isn't mpegts but e.g. raw adts, the default time base (90k) isn't correct. Signed-off-by: Martin Storsjö <martin@martin.st>
* hls: Return all packets from a previous variant before moving on to the next oneMartin Storsjö2013-07-29
| | | | | | | | | | This serves as a safeguard; normally we want to use the dts comparison to interleave packets from all active variants. If that dts comparison for some reason doesn't work as intended, make sure that all packets in all variants for a certain sequence number have been returned before moving on to the next one. Signed-off-by: Martin Storsjö <martin@martin.st>
* Use the avstring.h locale-independent character type functionsReimar Döffinger2013-03-07
| | | | | | Make sure the behavior does not change with the locale. Signed-off-by: Martin Storsjö <martin@martin.st>
* miscellaneous typo fixesDiego Biurrun2012-12-21
|
* avformat: Drop pointless "format" from container long namesDiego Biurrun2012-07-30
|
* hls: Proceed to the next segment at any error codeMartin Storsjö2012-07-28
| | | | | | | | | | | | | Previously, we returned any error code except AVERROR_EOF to the caller - only if AVERROR_EOF or 0 was returned, we proceeded to the next segment. With some setups of web servers, using Connection: close in https and GnuTLS, we don't get a clean error code at the end of segments. In those cases, just proceed to the next segment. Tested-by: Antti Seppälä <a.seppala@gmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* Replace usleep() calls with av_usleep()Mans Rullgard2012-06-22
| | | | | | | This reduces the dependency on unistd.h which is not available on all systems. Signed-off-by: Mans Rullgard <mans@mansr.com>
* hls: Reset the AVIOContext when seekingMartin Storsjö2012-02-20
| | | | | | | | This avoids reading any old data in the AVIOContext buffer after the seek, and indicates to the mpegts demuxer that we've seeked, avoiding continuity check errors. Signed-off-by: Martin Storsjö <martin@martin.st>
* applehttp: Do seeking within segments, tooPanagiotis H.M. Issaris2012-02-19
| | | | | | | | | | | Enhance seeking by demuxing until the requested timestamp is reached within the segment selected by the seek code using the playlist info. Some mpegts streams don't have dts set for all packets though, this seeking method doesn't work well for that case. Signed-off-by: Martin Storsjö <martin@martin.st>
* hls: Re-add legacy applehttp name to preserve interface compatibility.Alex Converse2012-02-14
|
* hls: Rename the functions and contextMartin Storsjö2012-02-14
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* libavformat: Rename the applehttp demuxer to hlsMartin Storsjö2012-02-14
When this demuxer was created, there didn't seem to be any consensus of a common short name for this protocol. Now the consensus seems to be to call it hls. Signed-off-by: Martin Storsjö <martin@martin.st>