summaryrefslogtreecommitdiff
path: root/libavformat/mxfdec.c
Commit message (Collapse)AuthorAge
...
* Improve descriptiveness of a number of codec and container long namesDiego Biurrun2012-07-30
|
* mxfdec: fix off by one error.Michael Niedermayer2012-07-10
| | | | | | Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* mxfdec: only parse next partition pack if parsing forwardTomas Härdin2012-07-10
| | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* mxfdec: let pkt->pts = mxf->current_edit_unit if intra-onlyTomas Härdin2012-07-10
| | | | | | | | We cannot do this in general since we could be reading a file with B-frames while lacking an index. Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* mxfdec: fix frame height vs field height confusionJoseph Artsimovich2012-07-10
| | | | | | | Reviewed-by: Tomas Härdin <tomas.hardin@codemill.se> Reveiwed-by: Baptiste Coudurier <baptiste.coudurier@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* mxfdec: Add intra_only flag to MXFTrackTomas Härdin2012-07-10
| | | | | | | This allows future assumptions to be made without affecting non-intra files. Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* mxfdec: fix Avid AirSpeed files being misinterpreted as OP1aTomas Härdin2012-07-10
| | | | | | | | | The "ECs != 1 -> OP1a" assumption was wrong. Luckily, the file that triggered that behavior had two ECs, not zero. Hence distinguishing between them is simple in this case. Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* mxfdec: truncate packets that extend past the next edit unitTomas Härdin2012-07-10
| | | | | | | | This fixes rare cases where OPAtom may be treated as OP1a, causing all essence to be read into RAM. Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* mxfdec: set pixel format for cdci picture formatsPhilip de Nier2012-07-10
| | | | | | | | | | | | | | | | | | The properties of the CDCI Descriptor are insufficient to specify the pixel format for uncompressed picture data. SMPTE 377-1 and RP224v10 have defined a set of picture coding labels to indicate what formatting was used. This patch uses 2 labels to detect UYVY422 or YUYV422 pixel formats. It defaults to UYVY422 for 8-bit 4:2:2 pictures to support files that were created before the coding labels were introduced ~2008 The codec pix_fmt default was changed from 0 (PIX_FMT_YUV420P) to -1 (PIX_FMT_NONE) Reviewed-by: Baptiste Coudurier <baptiste.coudurier@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* mxfdec: detect uncomp pictures using essence container ulPhilip de Nier2012-07-10
| | | | | | | | | | This supports detection of uncompressed picture in files that didn't include a Picture Coding Label. The lables weren't available until SMPTE 377-1 and RP224v10 Reviewed-by: Baptiste Coudurier <baptiste.coudurier@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* mxfdec: set track edit rate num/den in expected orderPhilip de Nier2012-07-10
| | | | | | | | This matches the order used for the index table edit rate. Reviewed-by: Baptiste Coudurier <baptiste.coudurier@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* mxfdec: replace x>>av_log2(sizeof(..)) by x/sizeof(..).Ronald S. Bultje2012-07-07
| | | | | | Also replace x>>av_log2(sizeof(..)) + 1 by x/sizeof(..). The +1 is probably meant to emulate av_log2_ceil(sizeof(..)) in cases where ".." is not a power of two.
* mxfdec: Ignore the last entry in Avid's index table segmentsTomas Härdin2012-02-09
| | | | | | | | The last entry is the total size of the essence container. Previously a TemporalOffset error would be logged, even though segments like these are expected. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Sanity-check SampleRateTomas Härdin2012-02-09
| | | | | | This avoids a SIGFPE if SampleRate is missing or set to naughty values. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Handle small EditUnitByteCountTomas Härdin2012-02-09
| | | | | | | These are common with audio atoms. Without this the demuxer would read two bytes at a time for a mono 16-bit file. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Consider OPAtom files that do not have exactly one EC to be OP1aTomas Härdin2012-02-09
| | | | | | This fixes demuxing of 2011_DCPTEST_24FPS.V.mxf. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Don't crash in mxf_packet_timestamps() if current_edit_unit overflowsTomas Härdin2012-02-09
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Zero nb_ptses in mxf_compute_ptses_fake_index()Tomas Härdin2012-02-09
| | | | | | This fixes SIGSEGV on files with both CBR and VBR index segments (zzuf6.mxf). Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Sanity check PreviousPartitionTomas Härdin2012-02-09
| | | | | | Without this certain files could get the demuxer stuck in a loop. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Never seek back in local sets and KLVsTomas Härdin2012-02-09
| | | | | | | | | Specially crafted files can lead the parsing code to take too long. We fix a lot of these problems by not allowing local tags to extend past the end of the set and not allowing other KLVs to be read past the end of themselves. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Move the current_partition check inside mxf_read_header()Tomas Härdin2012-02-09
| | | | | | This fixes SIGSEGV on files where this is the case, such as zzuf4.mxf. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Fix infinite loop in mxf_packet_timestamps()Tomas Härdin2012-02-09
| | | | | | | This can happen if an index table segment has a very large IndexStartPosition. zzuf3.mxf is an example of such a file. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Check eof_reached in mxf_read_local_tags()Tomas Härdin2012-02-09
| | | | | | This fixes an infinite loop with zzuf2.mxf. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Check for NULL componentTomas Härdin2012-02-09
| | | | | | This fixes a SIGSEGV with zzuf1.mxf. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Make sure mxf->nb_index_tables > 0 in mxf_packet_timestamps()Tomas Härdin2012-02-09
| | | | | | | Only the OPAtom demuxing logic is guaranteed to have index tables, meaning OP1a files that lack an index would cause SIGSEGV. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Make sure x < index_table->nb_ptsesTomas Härdin2012-02-09
| | | | | | Avoids a SIGSEGV on files with IndexEntryCount < IndexDuration. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* lavf: remove AVFormatParameters from AVFormatContext.read_header signatureAnton Khirnov2012-01-27
|
* mxfdec: Fix files with essence containers larger than 2 GiB.Tomas Härdin2012-01-26
| | | | | | For such files, accumulating into an int would cause an overflow. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Employ correct printf conversion specifiers for POSIX int types.Jean First2012-01-26
| | | | | Signed-off-by: Jean First <jeanfirst@gmail.com> Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: fix memleak on mxf_read_close()Janne Grunau2012-01-23
|
* mxfdec: fix memleak on av_realloc failuresJanne Grunau2012-01-22
|
* mxfdec: Do not parse slices or DeltaEntryArrays.Tomas Härdin2012-01-22
| | | | The most recent demuxing/seeking code does not need them.
* mxfdec: hybrid demuxing/seeking solutionJanne Grunau2012-01-22
| | | | | | | | | | | | | | | | | | This uses the old demuxing code for OP1a and separate demuxing code for OPAtom. Timestamp output is added to the old demuxing code. The seeking code is made to seek to the start of the desired EditUnit only, from which the normal demuxing code takes over (if OP1a). This means we do not use delta entries or slices, only StreamOffsets. OPAtom seeking basically works like before. This also makes D-10 seeking behave the same way as OP1a and OPAtom. In other words, we allow seeking before the start or past the end for D-10 too. Based on several patches by Tomas Härdin <tomas.hardin@codemill.se> and Reimar Döffinger <Reimar.Doeffinger@gmx.de>. Changed av_calloc to av_mallocz, added overflow checks.
* mxfdec: Add Avid's essence element key.Tomas Härdin2012-01-22
| | | | Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mfxdec: Separate mxf_essence_container_uls for audio and video.Carl Eugen Hoyos2012-01-22
| | | | | | | | | It is a really bad idea to assign a video codec id when we have set codec_type to audio and vice versa. Prevents detection of mp2 in mxf as mpeg2video. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: Compute packet offsets properly.Tomas Härdin2012-01-22
| | | | | | This replaces the old essence_offset code. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: Use MaterialPackage - Track - TrackID instead of the system_item hack.Tomas Härdin2012-01-22
| | | | Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: use av_dlog() for 'no corresponding source package found'Tomas Härdin2012-01-22
| | | | | | This is not an error and expected behavior for OPAtom files. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: Make mxf->partitions sorted by offset.Tomas Härdin2012-01-22
| | | | | | This also zeroes new entries for good measure (used by future patches). Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: parse ThisPartitionTomas Härdin2012-01-22
| | | | Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: Speed up metadata and index parsing.Tomas Härdin2012-01-22
| | | | | | | | | | | | | Specifically, this means parsing as before until we run into essence. At that point we seek to the footer and parse until EOF. After that we start seeking backward to the previous partition and parse that until we run into essence or the next partition. This procedure is repeated until we encounter the last partition we parsed in the forward direction. The end result of all this is that large essence containers are not needlessly parsed. This speeds up parsing large files a lot. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: Make sure DataDefinition is consistent between material track and ↵Tomas Härdin2012-01-22
| | | | | | | | | source track. This fixes 0001GL.MXF.V1.mxf_opatom.mxf and 0001GL00.MXF.A1.mxf_opatom.mxf getting two streams each due to both using the same SourcePackageID. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: add EssenceContainer UL found in 0001GL00.MXF.A1.mxf_opatom.mxfTomas Härdin2012-01-22
| | | | Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: Add hack that adjusts the n_delta calculation when system items are ↵Tomas Härdin2012-01-22
| | | | | | present. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: Parse IndexTableSegments and convert them into AVIndexEntry arrays.Janne Grunau2012-01-22
| | | | | | | Based on patch from Tomas Härdin <tomas.hardin@codemill.se> and work by Georg Lippitsch <georg.lippitsch@gmx.at> Changed av_calloc to av_mallocz and added overflow checks.
* mxfdec: Move FooterPartition to MXFContext and make sure it is never zero.Tomas Härdin2012-01-22
| | | | Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: check return value of avio_seekJoakim Plate2012-01-22
| | | | | | Avoid modifying state if avio_seek fails. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: skip to end of structural setsPhilip de Nier2012-01-22
| | | | | | | | This fixes reading of partition packs. The code stops reading after the operational pattern and should skip the array of essence container labels that follow. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: parse MXF partitionsTomas Härdin2012-01-22
|
* mov, mxfdec: Employ more meaningful return values.Daniel Huang2012-01-15
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>