summaryrefslogtreecommitdiff
path: root/libavformat/mpegts.c
Commit message (Collapse)AuthorAge
* cosmetics: Fix spelling mistakesVittorio Giovara2016-05-04
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mpegts: Validate the SL Packet Header ConfigurationLuca Barbato2016-05-03
| | | | | | | timeStampLength, OCRLength and AU_Length have well specified upper boundaries. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* mpegts: Forward the errors on mpeg4 objects parsingLuca Barbato2016-03-20
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* 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.
* 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`.
* mpegts: use avcodec_get_type() to set codec_typewm42015-09-28
| | | | | | | Note that this slightly changes behavior: it sets AVMEDIA_TYPE_UNKNOWN if the codec type is unknown. This should be ok. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* mpegts: Add jpeg2000 stream typeJohn Högberg2015-06-30
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* mpegts: Update the PSI/SI table only if the version changeJohn Högberg2015-04-28
| | | | | | | | | | | | | | | | | | | | | | | | If a PAT is finished while a PMT section filter is opened but not yet finished, the PMT section filter is closed and all the received data is discarded. This is usually not an issue but some multiplexers (With very quick PAT/PMT repetition settings) consistently emit a PMT section start, then a PAT, and then the rest of the PMT, causing the aforementioned behavior to result in no PMT being finished. In the most pathologic situation the stream information are lost and the probe fallback miscategorizes subtitles as mp3 audio. Avoid the issue through eliminating redundant PSI/SI table updates by checking their version field, which is required by the standard to be incremented on every change no matter how minor. CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* Replace av_dlog with normal av_log at trace levelVittorio Giovara2015-04-19
| | | | This applies to every library where performance is not critical.
* avformat: Don't anonymously typedef structsDiego Biurrun2015-02-14
|
* mpegts: relax restrictions on matching the packet start in read_headerAnton Khirnov2015-02-10
| | | | | | | | | | | analyze() is currently called both when probing and from read_header(). It determines the packet start by looking for the sync byte, followed by unset Transport Error Indicator and valid adaptation_field_control. This makes sense to do when probing, but once we already know the format is MPEG-TS, it is counterproductive to be so strict -- e.g. in some files the TEI might be set and analyze() might get called with a smaller buffer than the one used for probing, resulting in a failure.
* lavf: remove unused codewm42015-02-08
| | | | | | | | | | | | | Nothing uses it, and it provides no public API. Archeological finds: Commit 101036adb9 added the API. Commit a8dd8dc6e9 made mpegts.c use it. Commit af8aae3fa3 disabled it by default in mpegts.c. Commit ae2bb52cd2 removed all uses of this from mpegts.c. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* mpegts: add support for OpusKieran Kunhya2014-12-20
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* mpegts: check get16() return valueVittorio Giovara2014-12-18
| | | | | | | And break flow of execution rather than exiting the function. CC: libav-stable@libav.org Bug-Id: CID 732186
* mpegts: Allow custom max resync sizeLuca Barbato2014-09-03
|
* cosmetics: Write NULL pointer equality checks more compactlyGabriel Dume2014-08-15
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mpegts: do not export empty language tagsJan Gerber2014-07-21
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* mpegts: pass MpegTSContext ptr explicitlyAlexander V. Lukyanov2014-07-10
| | | | | | | | | | | | | | AVFormatContext->priv_data is not always a MpegTSContext, it can be RTSPState when decoding a RTP stream. So it is necessary to pass MpegTSContext pointer explicitly. Within libav, the write_section_data function doesn't actually use the MpegTSContext at all, so this doesn't change anything at the moment (no memory was corrupted before), but it reduces the risk of anybody trying to touch the MpegTSContext via AVFormatContext->priv_data in the future. Signed-off-by: Martin Storsjö <martin@martin.st>
* mpegts: Forward error codes in various functionsKeiji Costantini2014-03-18
| | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* mpegts: K&R formatting cosmeticsKeiji Costantini2014-03-18
| | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* mathops: move macro to the only place it is usedVittorio Giovara2014-03-04
| | | | This helps in disentangling lavf and lavc too.
* libavformat/mpegts: expose raw packet sizeLeandro Dorileo2014-02-19
| | | | | | | | We cannot easily determine if an mpeg TS's packet size is DVHS, FEC or so on, for that we need to expose the internal raw_packet_size field. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* mpegts: add HEVC registration descriptorCarl Eugen Hoyos2013-12-12
|
* mpegts: Support HEVC demuxingMickaël Raulet2013-10-31
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avformat: Use av_reallocp_array() where suitableAlexandra Khirnova2013-09-10
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* avio: Add const qualifiers to ffio_read_indirectBen Avison2013-08-08
| | | | | | | This provides at least some protection against potential accidental corruption of AVIO buffer workspace. Signed-off-by: Martin Storsjö <martin@martin.st>
* mpegts: Remove one 64-bit integer modulus operation per packetBen Avison2013-08-05
| | | | | | | | | | | | | The common case of the pointer having increased by one packet (which results in no change to the modulus) can be detected with a 64-bit subtraction, which is far cheaper than a division on many platforms. Before After Mean StdDev Mean StdDev Change Divisions 248.3 8.8 51.5 7.4 +381.7% Overall 2773.2 25.6 2372.5 43.1 +16.9% Signed-off-by: Martin Storsjö <martin@martin.st>
* mpegts: Make discard_pid() faster for single-program streamsBen Avison2013-08-05
| | | | | | | | | | | | | When a stream contains a single program, there's no point in doing a PID -> program lookup. Normally the one and only program isn't disabled, so no packets should be discarded. Before After Mean StdDev Mean StdDev Change discard_pid() 73.8 9.4 20.2 1.5 +264.8% Overall 2300.8 28.0 2253.1 20.6 +2.1% Signed-off-by: Martin Storsjö <martin@martin.st>
* mpegts: Remove one memcpy per packetBen Avison2013-08-05
| | | | | | | | | | | | | | This was being performed to ensure that a complete packet was held in contiguous memory, prior to parsing the packet. However, the source buffer is typically large enough that the packet was already contiguous, so it is beneficial to return the packet by reference in most cases. Before After Mean StdDev Mean StdDev Change memcpy 720.7 32.7 649.8 25.1 +10.9% Overall 2372.7 46.1 2291.7 21.8 +3.5% Signed-off-by: Martin Storsjö <martin@martin.st>
* mpegts: add support for stream_type 0x42, which is CAVSCan Wu2013-03-15
| | | | | | This allows demuxing and muxing of CAVS TS streams. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avformat: av_log_ask_for_sample() ---> avpriv_request_sample()Diego Biurrun2013-03-13
|
* av_log_missing_feature() ---> avpriv_report_missing_feature()Diego Biurrun2013-03-13
|
* avpacket: use AVBuffer to allow refcounting the packets.Anton Khirnov2013-03-08
| | | | | | This will allow us to avoid copying the packets in many cases. This breaks ABI.
* mpegts: Share the cleanup code between the demuxer and lavf-internal parser ↵Martin Storsjö2013-01-20
| | | | | | | | | | | | | functions The lavf-internal parser functions are used when receiving mpegts over RTP. This fixes memory leaks in this setup. The normal mpegts demuxer close function was updated in ec7d0d2e in 2004 to fix leaks, but the parsing function used for RTP wasn't updated and has been leaking ever since. Signed-off-by: Martin Storsjö <martin@martin.st>
* bitstream: add get_bits64() to support reading more than 32 bits at onceMichael Niedermayer2012-12-07
| | | | | | | Also remove a duplicate function in the MPEG-TS demuxer. Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
* mpegts: Drop pointless casting of hex_dump_debug argumentsDiego Biurrun2012-10-01
|
* avformat: Convert some commented-out printf/av_log instances to av_dlogDiego Biurrun2012-10-01
|
* mpegts: check substreams before discardingChristian Schmidt2012-09-12
| | | | | | Allow to extract the AC3 core from TrueHD with the "copy" codec. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union memberMartin Storsjö2012-09-04
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* Replace all CODEC_ID_* with AV_CODEC_ID_*Anton Khirnov2012-08-07
|
* Improve descriptiveness of a number of codec and container long namesDiego Biurrun2012-07-30
|
* mpegts: remove unused/incomplete/broken seeking codeRonald S. Bultje2012-06-19
|
* mpegts: Remove disabled extension matching probe.Alex Converse2012-06-07
|
* mpegts: Some additional HDMV types and reg descriptors for mpegtsJoakim Plate2012-05-03
| | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* mpegts: Make sure we don't return uninitialized packetsMartin Storsjö2012-04-27
| | | | | | | | | This fixes crashes, where the demuxer could return 0 even if the returned AVPacket isn't initialized at all. This could happen if running into EOF or running out of probesize with non-seekable sources. Signed-off-by: Martin Storsjö <martin@martin.st>
* mpegts: Try seeking back even for nonseekable protocolsMartin Storsjö2012-04-23
| | | | | | | | | | | | | | | | | The mpegts demuxer reads 5 KB at startup just for discovering the packet size. Since the default avio buffer size is 32 KB, the seek back to the start will in most cases be within the avio buffer, and will in most cases succeed even if the actual protocol isn't seekable. This makes the demuxer startup faster/with less data when reading data from a non-seekable input, by not skipping the first few KB. If it fails, don't warn if the protocol isn't seekable, making it behave as before in the failure case. Signed-off-by: Martin Storsjö <martin@martin.st>
* cosmetics: Align muxer/demuxer declarationsMartin Storsjö2012-04-06
| | | | | | | Also add missing trailing commas, break long codec_tag lines and add spaces in codec_tag declarations. Signed-off-by: Martin Storsjö <martin@martin.st>
* mpegts: Fix dead error checksAlex Converse2012-03-26
|
* mpegts: Always honor a registration descriptor if present and there is no ↵Alex Converse2012-03-09
| | | | other codec information.