summaryrefslogtreecommitdiffstats
path: root/demux/codec_tags.h
Commit message (Collapse)AuthorAgeFilesLines
* Revert "demux: put type2format into codec_tags with helper functions"Guido Cella2024-02-061-1/+0
| | | | | | | | | | This reverts commit be0a979a0b17b49f8535ee2542cca7df4c35b04d. The list of images codecs is no longer used by demux_mkv.c because 26a51464b6 made it check the number of blocks instead to not misdetect animations in image codecs, so move it back to demux_mf.c since it is its only user, so it is easier to understand how it is used, keeping the jxl addition from e9d0a31dfe.
* Revert "demux_mkv: check if the video codec is an image"Dudemanguy2024-02-011-1/+0
| | | | This reverts commit 4709a94aec5b16534b1d6b0d6738caeaf692e9c9.
* demux_mkv: check if the video codec is an imageDudemanguy2023-10-231-0/+1
| | | | | | Add a simple helper to codec_tags to check if the codec name matches one of the images. If so, then we set still_image and image in the stream as true (slightly different semanatics).
* demux: put type2format into codec_tags with helper functionsDudemanguy2023-10-231-0/+1
| | | | | | | | | demux_mf has a big const struct which is essentially a nice list handy list of codecs that are considered images. This is generally useful for all demuxers (demux_mkv could use this), so instead of making yet another list, lift it out and put it in a common place. Some things slightly changed so it matches the very similiar mimetype mapping struct below it. demux_mf calls a helper mapping function instead.
* Relicense some non-MPlayer source files to LGPL 2.1 or laterwm42016-01-191-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This covers source files which were added in mplayer2 and mpv times only, and where all code is covered by LGPL relicensing agreements. There are probably more files to which this applies, but I'm being conservative here. A file named ao_sdl.c exists in MPlayer too, but the mpv one is a complete rewrite, and was added some time after the original ao_sdl.c was removed. The same applies to vo_sdl.c, for which the SDL2 API is radically different in addition (MPlayer supports SDL 1.2 only). common.c contains only code written by me. But common.h is a strange case: although it originally was named mp_common.h and exists in MPlayer too, by now it contains only definitions written by uau and me. The exceptions are the CONTROL_ defines - thus not changing the license of common.h yet. codec_tags.c contained once large tables generated from MPlayer's codecs.conf, but all of these tables were removed. From demux_playlist.c I'm removing a code fragment from someone who was not asked; this probably could be done later (see commit 15dccc37). misc.c is a bit complicated to reason about (it was split off mplayer.c and thus contains random functions out of this file), but actually all functions have been added post-MPlayer. Except get_relative_time(), which was written by uau, but looks similar to 3 different versions of something similar in each of the Unix/win32/OSX timer source files. I'm not sure what that means in regards to copyright, so I've just moved it into another still-GPL source file for now. screenshot.c once had some minor parts of MPlayer's vf_screenshot.c, but they're all gone.
* demux: merge sh_video/sh_audio/sh_subwm42016-01-121-4/+4
| | | | | | | | | | This is mainly a refactor. I'm hoping it will make some things easier in the future due to cleanly separating codec metadata and stream metadata. Also, declare that the "codec" field can not be NULL anymore. demux.c will set it to "" if it's NULL when added. This gets rid of a corner case everything had to handle, but which rarely happened.
* demux_mkv: support embedded coverartwm42014-12-221-0/+2
| | | | | | | | | | | The code could as well be in demux.c, but it's better to avoid accidental clashes with demux_lavf.c. FFmpeg provides no way yet to map a mime type to a codec, so do it manually. (It _can_ map a mime type to an "input format", but not a codec.) Fixes #1374.
* demux_mkv: remove ancient codec mapping leftoverswm42014-11-281-2/+0
| | | | | | | | | | | | | | | | | | | All of this is basically due to how MPlayer's codecs.conf worked. It had a demuxer-interface based an AVI, using FourCCs and data structures found in AVI. FourCCs were used to map streams to decoders. For codecs not supported by AVI, "MPlayer internal" FourCCs were made up. codec_tags.c is there to bridge demuxers written against the old API to the mpv one. By now, only demux_mkv.c needs this (because demux_mkv is the only serious demuxer left - preferably, we should use libavformat for mkv too, but I can't see this happening any time soon, because libavformat _still_ doesn't support segment linking). But the codec tables are full of weird stuff automatically extracted from the old codecs.conf tables. Most of it isn't needed for mkv. Remove all custom tags, readd those used by demux_mkv.c internally (see vinfo and mkv_audio_tag tables). The rest is handled by the tables provided by libavformat, which includes AVI and QT tags.
* audio: decouple demux and audio decoder/filter sample formatswm42014-09-241-0/+4
| | | | | | | | | | | | | | | | | | | | For a while, we used this to transfer PCM from demuxer to the filter chain. We had a special "codec" that mapped what MPlayer used to do (MPlayer passes the AF sample format over an extra field to ad_pcm, which specially interprets it). Do this by providing a mp_set_pcm_codec() function, which describes a sample format in a generic way, and sets the appropriate demuxer header fields so that libavcodec interprets it correctly. We use the fact that libavcodec has separate PCM decoders for each format. These are systematically named, so we can easily map them. This has the advantage that we can change the audio filter chain as we like, without losing features from the "rawaudio" demuxer. In fact, this commit also gets rid of the audio filter chain formats completely. Instead have an explicit list of PCM formats. (We could even just have the user pass libavcodec PCM decoder names directly, but that would be annoying in other ways.)
* demux: remove gsh field from sh_audio/sh_video/sh_subwm42013-11-231-4/+2
| | | | | | | | | This used to be needed to access the generic stream header from the specific headers, which in turn was needed because the decoders had access only to the specific headers. This is not the case anymore, so this can finally be removed again. Also move the "format" field from the specific headers to sh_stream.
* core: redo how codecs are mapped, remove codecs.confwm42013-02-101-0/+31
Use codec names instead of FourCCs to identify codecs. Rewrite how codecs are selected and initialized. Now each decoder exports a list of decoders (and the codec it supports) via add_decoders(). The order matters, and the first decoder for a given decoder is preferred over the other decoders. E.g. all ad_mpg123 decoders are preferred over ad_lavc, because it comes first in the mpcodecs_ad_drivers array. Likewise, decoders within ad_lavc that are enumerated first by libavcodec (using av_codec_next()) are preferred. (This is actually critical to select h264 software decoding by default instead of vdpau. libavcodec and ffmpeg/avconv use the same method to select decoders by default, so we hope this is sane.) The codec names follow libavcodec's codec names as defined by AVCodecDescriptor.name (see libavcodec/codec_desc.c). Some decoders have names different from the canonical codec name. The AVCodecDescriptor API is relatively new, so we need a compatibility layer for older libavcodec versions for codec names that are referenced internally, and which are different from the decoder name. (Add a configure check for that, because checking versions is getting way too messy.) demux/codec_tags.c is generated from the former codecs.conf (minus "special" decoders like vdpau, and excluding the mappings that are the same as the mappings libavformat's exported RIFF tables). It contains all the mappings from FourCCs to codec name. This is needed for demux_mkv, demux_mpg, demux_avi and demux_asf. demux_lavf will set the codec as determined by libavformat, while the other demuxers have to do this on their own, using the mp_set_audio/video_codec_from_tag() functions. Note that the sh_audio/video->format members don't uniquely identify the codec anymore, and sh->codec takes over this role. Replace the --ac/--vc/--afm/--vfm with new --vd/--ad options, which provide cover the functionality of the removed switched. Note: there's no CODECS_FLAG_FLIP flag anymore. This means some obscure container/video combinations (e.g. the sample Film_200_zygo_pro.mov) are played flipped. ffplay/avplay doesn't handle this properly either, so we don't care and blame ffmeg/libav instead.