aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mov.c
Commit message (Collapse)AuthorAgeFilesLines
* mov: Move code shared with CAF to a separate fileDiego Biurrun2017-04-031-36/+0
|
* spherical: Change types of bounding and pad to uint32_tVittorio Giovara2017-03-231-4/+3
| | | | | | | | | These values are defined to be 32bit in the specification, so it makes more sense to store them as fixed width. Based on a patch by Micahel Niedermayer <michael@niedermayer.cc>. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* mov: Export bounds and padding from spherical metadataVittorio Giovara2017-03-071-1/+26
| | | | | | Update the fate test as needed. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* mov: Validate cubemap layoutVittorio Giovara2017-03-071-1/+7
|
* mov: Validate spherical metadata versionVittorio Giovara2017-03-071-4/+22
|
* mov: Ignore old spherical metadata when newer version is presentVittorio Giovara2017-03-071-2/+3
|
* mov: Fix spherical metadata_source parsingAaron Colwell2017-03-071-2/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* mov: Do not try to parse multiple stsd for the same trackLuca Barbato2017-02-151-0/+6
| | | | | | | Bug-Id: 1017 CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* mov: Rework stsc index validationVittorio Giovara2017-02-101-4/+4
| | | | | In order to avoid potential integer overflow change the comparison and make sure to use the same unsigned type for both elements.
* Use bitstream_init8() where appropriateDiego Biurrun2017-02-071-1/+1
|
* mov: Avoid memcmp of uninitialised dataMark Thompson2017-01-301-2/+2
| | | | | | | | | The string codec name need not be as long as the value we are comparing it to, so memcmp may make decisions derived from uninitialised data that valgrind then complains about (though the overall result of the function will always be the same). Use strncmp instead, which will stop at the first zero byte and therefore not encounter this issue.
* mov: Convert to the new bitstream readerAlexandra Hájková2017-01-131-4/+6
|
* Use correct printf conversion specifiers for POSIX integer typesDiego Biurrun2016-12-231-1/+1
|
* mov: fix a possible invalid read in mov_read_mac_string()Anton Khirnov2016-12-191-1/+5
| | | | | | | | | | When the input string is too large, so the second condition in if () fails, the code will erroneously execute the else branch, indexing the mac_to_unicode table with a negative index. CC: libav-stable@libav.org Bug-Id: 1000 Found-By: Kamil Frankowicz
* mov: Export spherical informationVittorio Giovara2016-12-071-0/+262
| | | | | | | This implements Spherical Video V1 and V2, as described in the spatial-media collection by Google. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* mov: Use av_stream_add_side_data() for displaymatrix side dataJames Almer2016-11-231-13/+5
| | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* mov: Fix identity matrix boolean logicVittorio Giovara2016-11-161-2/+2
| | | | | | | | This prevented the code from correctly exporting the rotation matrix which caused a few samples to be displayed wrong. Introduced in ecd2ec69ce10e13f6ede353d2def7c. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* mov: Read multiple stsd from DVVittorio Giovara2016-11-081-0/+2
| | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* hevc: Support extradata changes from multiple stsdVittorio Giovara2016-11-081-7/+5
| | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* mov: Evaluate the movie display matrixVittorio Giovara2016-11-011-14/+35
| | | | | | | | | | | This matrix needs to be applied after all others have (currently only display matrix from trak), but cannot be handled in movie box, since streams are not allocated yet. So store it in main context, and apply it when appropriate, that is after parsing the tkhd one. Fate tests are updated accordingly. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* Use ISO C printf conversion specifiers where appropriateDiego Biurrun2016-10-281-11/+14
|
* Adjust printf conversion specifiers to match variable signednessDiego Biurrun2016-10-281-21/+21
|
* Remove some pointless TRACE level debug codeDiego Biurrun2016-10-271-6/+0
| | | | This also kills some warnings with certain compiler options.
* mov: Update colr valuesVittorio Giovara2016-10-211-7/+11
| | | | | | | | | | For 'nclx', the latest edition of the standard switched from JPEG XR to 23001-8, which matches the current order of our entries. Bounds are preserved as a sanity check. For 'nclc', qtff edition 2016-09-13 introduced a few new entries. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* lavf: fix usage of AVIOContext.seekableAnton Khirnov2016-09-301-6/+6
| | | | | | | | It is supposed to be a flag. The only currently defined value is AVIO_SEEKABLE_NORMAL, but other ones may be added in the future. However all the current lavf code treats this field as a bool (mainly for historical reasons). Change all those cases to properly check for AVIO_SEEKABLE_NORMAL.
* mov: Remove old b-frame/video delay heuristicDerek Buitenhuis2016-08-291-3/+0
| | | | | | | | This was added before edts support existed, and is no longer valid. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* mov: Remove ancient heuristic hackDerek Buitenhuis2016-08-291-7/+1
| | | | | | | | | This breaks files with legitimate single-entry edit lists, and the hack, introduced in f03a081df09f9c4798a17d7e24446ed47924b11b, has no link to any known sample in its commit message. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* mov: Validate the ID numberLuca Barbato2016-07-291-2/+2
| | | | | | IDs in MOV start from 1. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mov: Rework the check for invalid indexes in stscVittorio Giovara2016-07-201-2/+7
| | | | | | | | | | There are samples with invalid stsc that may work fine as is and do not need extradata change. So ignore any out of range index, and error out only when explode is set. Found-by: Matthieu Bouron <matthieu.bouron@stupeflix.com> Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* mov: Wrap stsc index and count compare in a separate functionVittorio Giovara2016-07-201-5/+10
|
* mov: Fix stsc_count comparisonMatthieu Bouron2016-07-201-1/+1
| | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* mov: fix stream extradata_size allocationMatthieu Bouron2016-07-151-1/+1
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* mov: Save number of stsd elements after stream extradata allocationVittorio Giovara2016-06-291-3/+4
| | | | | | | Avoid freeing an unallocated array in mov_read_close() in case of a malloc failure. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* mov: Support prores with multiple stsdVittorio Giovara2016-06-171-0/+2
| | | | | | This function needs to return false, or data in the additional tables will be skipped, and the decoder will not be able to decode frames associated with them.
* mov: Implement support for multiple sample description tablesVittorio Giovara2016-06-171-6/+119
| | | | | | | | | | | | | | | | Store data from each stsd in a separate extradata buffer, keep track of the stsc index for read and seek operations, switch buffers when the index differs. Decoder is notified with an AV_PKT_DATA_NEW_EXTRADATA packet side data. Since H264 supports this notification, and can be reset midstream, enable this feature only for multiple avcC's. All other stsd types (such as hvc1 and hev1) need decoder-side changes, so they are left disabled for now. This is implemented only in non-fragmented MOVs. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* mov: Also export loci altitudeMichael Niedermayer2016-05-191-2/+7
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* mov: Append place name instead of overwriting for lociMichael Niedermayer2016-05-191-3/+3
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* mov: Fix parsing short lociMichael Niedermayer2016-05-191-2/+2
| | | | | | | | | | Previously, we required the minimum number of bytes required for the full box. Don't strictly require the astronomical body and additional notes fields, but do require an altitude field (which currently isn't parsed). This matches the initial length check at the start of the function (which doesn't know about the variable length place field). Signed-off-by: Martin Storsjö <martin@martin.st>
* mov: Print reason of loci parsing failureMichael Niedermayer2016-05-191-3/+10
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* mov: Add a comment referring to the standard that defines the loci boxMartin Storsjö2016-05-191-0/+1
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* cosmetics: Fix spelling mistakesVittorio Giovara2016-05-041-3/+3
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* Drop pointless assert.h #includesDiego Biurrun2016-05-031-3/+0
|
* mov: Check the entries value when parsing dref boxesLuca Barbato2016-03-111-1/+3
| | | | | | | | | And properly reset the entries count when resetting the entries. CC: libav-stable@libav.org Bug-Id: 929 Bug-Id: CVE-2016-3062
* mov: Trim dref absolute pathVittorio Giovara2016-03-051-0/+7
| | | | | | | | | | | | | Samples produced by Omneon (Harmonic) store external references with paths ending with 0s. Such movs cannot be loaded properly since every 0 is converted to '/', to keep the same parsing code for dref type 2 and type 18: this makes the external reference point to a non-existing direactory, rather than to the actual referenced file. Add a brief trimming loop that drops all ending 0s before trying to parse the external reference path. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* lavf: replace AVStream.codec with AVStream.codecparAnton Khirnov2016-02-231-174/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* mov: Force the full parsing of mp3Luca Barbato2016-02-191-0/+3
| | | | | | | | | | | Some muxer might or might not fit incomplete mp3 frames in their packets. Bug-Id: 899 CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* mov: Fix the format specifier type for sizeVittorio Giovara2016-02-161-2/+3
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* mov: Use the correct type for sizeLuca Barbato2016-02-141-5/+5
| | | | | | An AVIO offset is int64_t. Bug-Id: 921
* lavf: allow custom IO for all filesAnton Khirnov2016-01-241-5/+5
| | | | | | | | | | | | | | 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.
* mov: Add an option to toggle dref openingDerek Buitenhuis2016-01-211-4/+16
| | | | | | | | | This feature is mostly only used by NLE software, and is both of dubious value being enabled by default, and a possible security risk. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>