aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mov_chan.c
Commit message (Collapse)AuthorAgeFilesLines
* avformat/mov_chan: make iso_channel_position table more compactMarton Balint2024-06-121-119/+45
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mov_chan: use the newly added channel ids for more exact mappingMarton Balint2024-06-121-14/+8
| | | | | | | | | | Also make the iso_channel_position table consistent with what the AAC decoder uses in avcodec/aac/aacdec_usac.c. Fate changes are caused by the change of how 7.1 layout is mapped, previously it included Side Surround channels, now it includes the Surround channels. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mov_chan: add support for omitted_channel bitmask in chnl atomMarton Balint2024-04-091-20/+23
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mov_chan: respect channel order when parsing and creating chnl atomMarton Balint2024-04-091-63/+82
| | | | | | | | Previously we always assumed that the channels are in native order, even if they were not. The new channel layout API allows us to signal the proper channel order, so let's do so. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mov_chan: factorize some layout map search functionsMarton Balint2024-04-091-27/+35
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mov_chan: check channel count of layout tags at compile timeMarton Balint2024-04-091-109/+108
| | | | | | | | We can do this by using an X-macro for channel map declaration and doing a static_assert() in one pass for the check. Thanks for Andreas Rheinhardt for the suggestion. Signed-off-by: Marton Balint <cus@passwd.hu>
* avutil/common: Don't auto-include mem.hAndreas Rheinhardt2024-03-311-0/+1
| | | | | | | | | | | There are lots of files that don't need it: The number of object files that actually need it went down from 2011 to 884 here. Keep it for external users in order to not cause breakages. Also improve the other headers a bit while just at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mov_chan: Use anonymous enumAndreas Rheinhardt2024-03-251-1/+1
| | | | | | | | | | | Fixes many -Wenum-conversion warnings with Clang caused by e6c2c8703732bc46395c65c530038c8146df0deb. See e.g. https://fate.ffmpeg.org/log.cgi?time=20240325033545&slot=aarch64-linux-clang-10&log=compile Reviewed-by: Henrik Gramner <henrik@gramner.com> Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mov_chan: respect channel order when parsing and creating chan atomMarton Balint2024-03-241-253/+211
| | | | | | | | Previously we always assumed that the channels are in native order, even if they were not. The new channel layout API allows us to signal the proper channel order, so let's do so. Fixes ticket #98.
* avformat/mov_chan: simplify channel layout canonicalizationMarton Balint2024-03-161-8/+4
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mov_chan: rework ff_mov_read_chnlMarton Balint2024-02-181-80/+26
| | | | | | | | | | | A lot of changes and fixes to channel layout parsing, notably - get rid of dynamic allocation of channel positions - signal unimplemented speaker positions as unknown instead of failure, but warn the user about it - native order, and that a single channel only appears once was always assumed for less than 64 channels, obviously this was incorrect Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mov: factorize reading the main part of the chnl atom to mov_chanMarton Balint2024-02-181-0/+59
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mov_chan: add support for reading custom channel layouts when ↵Marton Balint2024-02-121-45/+56
| | | | | | layout_tag == 0 Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mov_chan: never override number of channels based on chan atomMarton Balint2024-02-091-2/+7
| | | | | | | | | | | The channel designation metadata should not override the number of channels. Let's warn the user if it is inconsistent, and keep the channel layout unspecified. Before the conversion to the channel layout API the code only set the mask, but never overridden the channel count, so this restores the old behaviour. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mov_chan: do not assume channels are in native orderMarton Balint2024-02-091-1/+1
| | | | | | | | | | Existing code could have caused wrong channel order signalling or reduced channel count if a channel designation appeared multiple times. This is actually an old bug, but the conversion to the new channel layout API made it visible, because now the code overrides the proper channel count with the one calculated from the mask. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mov: fix 2 compile errorsTong Wu2023-03-161-1/+1
| | | | | | | | | | | Compiler: MSVC 14.35.32215 Error type: error C2059: syntax error: '}' Related commit: 9e1ffed fate/mov: add PCM in mp4 test d7e8643 avformat/mov: parse ISO-14496-12 ChannelLayout Signed-off-by: Tong Wu <tong1.wu@intel.com> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com> Reviewed-by: Haihao Xiang <haihao.xiang@intel.com>
* avformat/mov: parse ISO-14496-12 ChannelLayoutZhao Zhili2023-03-151-0/+296
| | | | | | Only support chnl version 0 now. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/mov_chan: use the cube layoutJames Almer2022-10-301-5/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov_chan: move the definition of MovChannelLayoutTag to the headerJames Almer2022-04-051-104/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: write channel descriptions when a known layout or a bitmap ↵James Almer2022-04-051-17/+58
| | | | | | | | can't be used Fixes part of ticket #2865 Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov_chan: use a higher log level for a debug messageJames Almer2022-04-051-1/+1
| | | | | | | Trace is too noisy and this line is useful enough to get it printed at debug level. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov_chan: add a few missing channel label mappingsJames Almer2022-04-051-4/+10
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov_chan: rename mov_get_channel_label() to better reflect its purposeJames Almer2022-04-051-2/+2
| | | | | | This function turns a mov channel label into a lavf native bitmask. Signed-off-by: James Almer <jamrial@gmail.com>
* mov: convert to new channel layout APIVittorio Giovara2022-03-151-7/+16
| | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov_chan: Make ff_mov_get_channel_layout() staticAndreas Rheinhardt2021-09-081-2/+9
| | | | | | Possible since 3bab7cd12802dc5abf2c5cc6dec49e9e249ce204. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavf/mov_chan: avoid avcodec.h dependencyAnton Khirnov2021-06-101-1/+1
|
* Fix all -Wformat warnings raised by DJGPPClément Bœsch2017-03-291-2/+3
|
* Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-101-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '9200514ad8717c63f82101dc394f4378854325bf': lavf: replace AVStream.codec with AVStream.codecpar This has been a HUGE effort from: - Derek Buitenhuis <derek.buitenhuis@gmail.com> - Hendrik Leppkes <h.leppkes@gmail.com> - wm4 <nfxjfg@googlemail.com> - Clément Bœsch <clement@stupeflix.com> - James Almer <jamrial@gmail.com> - Michael Niedermayer <michael@niedermayer.cc> - Rostislav Pehlivanov <atomnuker@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavf: replace AVStream.codec with AVStream.codecparAnton Khirnov2016-02-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: abort on EOF in ff_mov_read_chanAndreas Cadhalpun2015-05-311-0/+5
| | | | | | | | | | | | | | Otherwise the loop can take a lot of time if num_descr is very large. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | all: fix enum definition for large valuesGanesh Ajjanagadde2015-10-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ISO C restricts enumerator values to the range of int. Thus (for instance) 0x80000000 unfortunately does not work, and throws a warning with -Wpedantic on clang 3.7. This fixes it by using alternative expressions that result in identical values but do not have this issue. Tested with FATE. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | mov: abort on EOF in ff_mov_read_chanAndreas Cadhalpun2015-05-241-0/+5
| | | | | | | | | | | | Otherwise the loop can take a lot of time if num_descr is very large. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | Merge commit '1a3eb042c704dea190c644def5b32c9cee8832b8'Michael Niedermayer2015-04-201-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '1a3eb042c704dea190c644def5b32c9cee8832b8': Replace av_dlog with normal av_log at trace level Conflicts: ffplay.c libavdevice/fbdev_dec.c libavfilter/avfilter.c libavfilter/internal.h libavfilter/setpts.c libavfilter/src_movie.c libavfilter/vf_crop.c libavfilter/vf_drawtext.c libavfilter/vf_fieldorder.c libavformat/assdec.c libavformat/avidec.c libavformat/flvdec.c libavformat/http.c libavformat/ipmovie.c libavformat/isom.c libavformat/mov.c libavformat/mpegenc.c libavformat/mpegts.c libavformat/mpegtsenc.c libavformat/mux.c libavformat/mxfdec.c libavformat/nsvdec.c libavformat/oggdec.c libavformat/r3d.c libavformat/rtspdec.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Replace av_dlog with normal av_log at trace levelVittorio Giovara2015-04-191-1/+1
| | | | | | | | This applies to every library where performance is not critical.
* | Add missing "const" all over the place.Reimar Döffinger2014-08-291-1/+1
| | | | | | | | | | | | Only "./configure --enable-gpl" on x86 was tested. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Reinstate proper FFmpeg license for all files.Thilo Borgmann2013-08-301-4/+4
| |
* | Fix termination of mov_ch_layouts_wav array lookupThierry Foucu2013-03-181-0/+1
| | | | | | | | | | | | | | | | Problem found using ASAN. In some case, the ff_mov_get_channel_layout_tag function will not find 0 as termination for lookup in the array mov_ch_layouts_wav. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '97bf7c03b1338a867da52c159a2afecbdedcfa88'Michael Niedermayer2012-11-121-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '97bf7c03b1338a867da52c159a2afecbdedcfa88': doc: git-howto: Leave reviewers time to react before pushing patches Include libavutil/channel_layout.h instead of libavutil/audioconvert.h lavu: rename audioconvert.* to channel_layout.* and deprecate audioconvert.h Conflicts: doc/APIchanges doc/examples/decoding_encoding.c doc/git-howto.texi ffmpeg_filter.c libavcodec/flacdec.c libavcodec/imc.c libavcodec/mpegaudiodec.c libavcodec/utils.c libavfilter/asrc_anullsrc.c libavfilter/audio.c libavfilter/avfilter.c libavfilter/avfilter.h libavfilter/avfiltergraph.c libavfilter/buffer.c libavutil/Makefile libavutil/audioconvert.h libavutil/channel_layout.c libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Include libavutil/channel_layout.h instead of libavutil/audioconvert.hJustin Ruggles2012-11-111-1/+1
| | | | | | | | Also reorder some other #include when applicable.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-09-081-2/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: mov_chan: Only set the channel_layout if setting it to a nonzero value mov_chan: Reindent an incorrectly indented line mp2 muxer: mark as AVFMT_NOTIMESTAMPS. x86: float_dsp: fix ff_vector_fmac_scalar_avx() on Win64 x86: more specific checks for availability of required assembly capabilities x86: avcodec: Drop silly "_mmx" suffix from dsputil template names fate: Drop redundant setting of FUZZ to 1 cavsdsp: set idct permutation independently of dsputil x86: allow using add_hfyu_median_prediction_cmov on any cpu with cmov Conflicts: libavcodec/x86/dsputil_mmx.c libavformat/mp3enc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mov_chan: Only set the channel_layout if setting it to a nonzero valueMartin Storsjö2012-09-081-3/+4
| | | | | | | | | | | | | | | | If regularly parsing new chan atoms (as in rtpdec_qt), but the chan atoms don't actually contain any channel layout, don't reset the value that the caller has filled in (by guessing). Signed-off-by: Martin Storsjö <martin@martin.st>
| * mov_chan: Reindent an incorrectly indented lineMartin Storsjö2012-09-081-1/+1
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-09-071-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: mov_chan: Pass a separate AVIOContext for reading af_asyncts: check return value from lavr when flushing. mss2: simplify loop in decode_rle() mss12: avoid unnecessary division in arith*_get_bit() mss2: do not try to read too many palette entries mpegvideo: set AVFrame fields to NULL after freeing the base memory configure: Set the right cc_e flags for msvc Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mov_chan: Pass a separate AVIOContext for readingSamuel Pitoiset2012-09-071-2/+2
| | | | | | | | | | | | | | This fixes crashes when called from rtpdec_qt, where AVFormatContext->pb is null, a crash present since 3bab7cd128. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'Michael Niedermayer2012-08-071-20/+20
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '36ef5369ee9b336febc2c270f8718cec4476cb85': Replace all CODEC_ID_* with AV_CODEC_ID_* lavc: add AV prefix to codec ids. Conflicts: doc/APIchanges doc/examples/decoding_encoding.c doc/examples/muxing.c ffmpeg.c ffprobe.c ffserver.c libavcodec/8svx.c libavcodec/avcodec.h libavcodec/dnxhd_parser.c libavcodec/dvdsubdec.c libavcodec/error_resilience.c libavcodec/h263dec.c libavcodec/libvorbisenc.c libavcodec/mjpeg_parser.c libavcodec/mjpegenc.c libavcodec/mpeg12.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/pcm.c libavcodec/r210dec.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/version.h libavdevice/alsa-audio-dec.c libavdevice/bktr.c libavdevice/v4l2.c libavformat/asfdec.c libavformat/asfenc.c libavformat/avformat.h libavformat/avidec.c libavformat/caf.c libavformat/electronicarts.c libavformat/flacdec.c libavformat/flvdec.c libavformat/flvenc.c libavformat/framecrcenc.c libavformat/img2.c libavformat/img2dec.c libavformat/img2enc.c libavformat/ipmovie.c libavformat/isom.c libavformat/matroska.c libavformat/matroskadec.c libavformat/matroskaenc.c libavformat/mov.c libavformat/movenc.c libavformat/mp3dec.c libavformat/mpeg.c libavformat/mpegts.c libavformat/mxf.c libavformat/mxfdec.c libavformat/mxfenc.c libavformat/nsvdec.c libavformat/nut.c libavformat/oggenc.c libavformat/pmpdec.c libavformat/rawdec.c libavformat/rawenc.c libavformat/riff.c libavformat/sdp.c libavformat/utils.c libavformat/vocenc.c libavformat/wtv.c libavformat/xmv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Replace all CODEC_ID_* with AV_CODEC_ID_*Anton Khirnov2012-08-071-20/+20
| |
* | Skip chan tag padding.Carl Eugen Hoyos2012-08-011-0/+2
|/ | | | Fixes ticket #1580
* avformat: move 'chan' tag parsing to mov_chan.c to share with the CAF demuxerJustin Ruggles2012-07-191-1/+45
|
* movenc: Add channel layouts for PCM.Alex Converse2012-06-271-0/+26
|
* mov_chan: Fix operator precedence by adding parenthesesMartin Storsjö2012-06-171-1/+1
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>