summaryrefslogtreecommitdiff
path: root/libavformat/argo_asf.c
Commit message (Collapse)AuthorAge
* avformat/argo_asf: Use 64bit in offset intermediateMichael Niedermayer2024-06-01
| | | | | | | Fixes: CID1467435 Unintentional integer overflow Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mux: Add flag for "only default codecs allowed"Andreas Rheinhardt2024-03-22
| | | | | | | | AVOutputFormat has default codecs for audio, video and subtitle and often these are the only codecs of this type allowed. So add a flag to AVOutputFormat so that this can be checked generically. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mux: Add flag for "not more than one stream of each type"Andreas Rheinhardt2024-03-22
| | | | | | | | | | | | | | | | More exactly: Not more than one stream of each type for which a default codec (i.e. AVOutputFormat.(audio|video|subtitle)_codec) is set; for those types for which no such codec is set (or for which no designated default codec in AVOutputFormat exists at all) no streams are permitted. Given that with this flag set the default codecs become more important, they are now set explicitly to AV_CODEC_ID_NONE for "unset"; the earlier code relied on AV_CODEC_ID_NONE being equal to zero, so that default static initialization set it accordingly; but this is not how one is supposed to use an enum. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avformat: Add FFInputFormat, hide internals of AVInputFormatAndreas Rheinhardt2024-03-07
| | | | | | | | | | | | | | | | | | | | | This commit does for AVInputFormat what commit 59c9dc82f450638a3068deeb1db5c56f6d155752 did for AVOutputFormat: It adds a new type FFInputFormat, moves all the internals of AVInputFormat to it and adds a now reduced AVInputFormat as first member. This does not affect/improve extensibility of both public or private fields for demuxers (it is still a mess due to lavd). This is possible since 50f34172e0cca2cabc5836308ec66dbf93f5f2a3 (which removed the last usage of an internal field of AVInputFormat in fftools). (Hint: tools/probetest.c accesses the internals of FFInputFormat as well, but given that it is a testing tool this is not considered a problem.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Revert "all: Don't set AVClass.item_name to its default value"Anton Khirnov2024-01-20
| | | | | | | Some callers assume that item_name is always set, so this may be considered an API break. This reverts commit 0c6203c97a99f69dbaa6e4011d48c331e1111f5e.
* all: Don't set AVClass.item_name to its default valueAndreas Rheinhardt2023-12-22
| | | | | | | | Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9; also avoids relocations. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avformat: Move AVOutputFormat internals out of public headerAndreas Rheinhardt2023-02-09
| | | | | | | | | | | | | | This commit does for AVOutputFormat what commit 20f972701806be20a77f808db332d9489343bb78 did for AVCodec: It adds a new type FFOutputFormat, moves all the internals of AVOutputFormat to it and adds a now reduced AVOutputFormat as first member. This does not affect/improve extensibility of both public or private fields for muxers (it is still a mess due to lavd). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* configure: Use a separate config_components.h header for $ALL_COMPONENTSMartin Storsjö2022-03-16
| | | | | | | | This avoids unnecessary rebuilds of most source files if only the list of enabled components has changed, but not the other properties of the build, set in config.h. Signed-off-by: Martin Storsjö <martin@martin.st>
* argo: convert to new channel layout APIAnton Khirnov2022-03-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/argo_asf: Fix order of operations in error check in ↵Michael Niedermayer2022-02-25
| | | | | | argo_asf_write_trailer() Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/argo_asf: use title metadata when muxingZane van Iperen2021-10-15
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_asf: pass name through as metadataZane van Iperen2021-10-15
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_asf: cleanup and NULL-terminate name field in headerZane van Iperen2021-10-15
| | | | | | | Preparation for metadata changes in the following patches. Saves having to create an extra buffer. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_asf: Use memcpy to copy string without its NULAndreas Rheinhardt2021-09-26
| | | | | | | | This avoids a -Wstringop-truncation warning from GCC which takes issue with the fact that the destination might not be NUL-terminated. Reviewed-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/internal: Move ff_read_line_to_bprint_overwrite to avio_internal.hAndreas Rheinhardt2021-07-29
| | | | | | | | | | | | | It only uses an AVIOContext and an AVBPrint. When doing so, it turned out that several non-users of ff_read_line_to_bprint_overwrite() and ff_bprint_to_codecpar_extradata() relied on libavformat/internal.h to include bprint.h or avstring.h for them. In order to avoid a repeat of this and in order to reduce unnecessary dependencies, a forward declaration of struct AVBPrint is used instead of including bprint.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/avcodec: Stop including channel_layout.h in avcodec.hAndreas Rheinhardt2021-07-22
| | | | | | Also include channel_layout.h directly wherever used. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/argo_asf: don't set bits_per_raw_sampleZane van Iperen2021-07-19
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat: Constify all muxer/demuxersAndreas Rheinhardt2021-04-27
| | | | | | | This is possible now that the next-API is gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/argo_{asf,brp}: fix potential segfault in ff_argo_asf_fill_stream()Zane van Iperen2020-09-27
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_asf: implement seekingZane van Iperen2020-09-23
| | | | | | | Causes some error as the ADPCM predictors aren't known, but the difference is negligible and not audible. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_asf: cosmeticsZane van Iperen2020-09-20
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_asf: fix enforcement of chunk countZane van Iperen2020-09-20
| | | | | | | Enforcing num_chunks == 1 only makes sense when demuxing from an ASF file. When embedded in a BRP file, an ASF stream can have multiple chunks. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_{asf,brp}: use variable frame sizes when (de)muxing adpcm_argoZane van Iperen2020-09-19
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_asf: initialise file header inlineZane van Iperen2020-09-16
| | | | | | | Garbage was left-over in the ArgoASFFileHeader::name field if the url was too short. This zero-initialises it. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_asf: add ASF_MIN_BUFFER_SIZE #defineZane van Iperen2020-09-14
| | | | | | For future use by the argo_brp demuxer Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_asf: split functionality into a headerZane van Iperen2020-09-14
| | | | | | | | | | | | For future use by the argo_brp demuxer. Adds: - void ff_argo_asf_parse_file_header(ArgoASFFileHeader *hdr, const uint8_t *buf); - int ff_argo_asf_validate_file_header(AVFormatContext *s, const ArgoASFFileHeader *hdr); - void ff_argo_asf_parse_chunk_header(ArgoASFChunkHeader *hdr, const uint8_t *buf); - int ff_argo_asf_fill_stream(AVStream *st, const ArgoASFChunkHeader *ckhdr); Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_asf: bail if invalid tagZane van Iperen2020-09-14
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_asf: fix handling of v1.1 filesZane van Iperen2020-09-07
| | | | | | | | Version 1.1 (FX Fighter) files all have a sample rate of 44100 in the header, but only play back correctly at 22050. Force the sample rate to 22050 when reading, and restrict it when muxing.
* avformat/argo_asf: strip file extension from nameZane van Iperen2020-08-11
| | | | | | | Only when the user hasn't manually specified one. Matches the original files more closely. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_asf: add name optionZane van Iperen2020-08-11
| | | | | | Reviewed-by: Alexander Strasser <eclipse7@gmx.net> Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_asf: add version_major and version_minor optionsZane van Iperen2020-08-11
| | | | | | Reviewed-by: Alexander Strasser <eclipse7@gmx.net> Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_asf: don't check file versionZane van Iperen2020-08-11
| | | | | | | | | | | | | | | | It has no bearing on structure. Determined by looking at the ASF files from several Argonaut games: - FX Fighter, - Croc, - Croc 2, - The Emperor's New Groove, and - Disney's Aladdin in Nasira's Revenge The only versions that appear are 1.1, 1.2, and 2.1, and their structure is identical. Reviewed-by: Alexander Strasser <eclipse7@gmx.net> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/argo_asf: add games to version listZane van Iperen2020-08-11
| | | | | Reviewed-by: Alexander Strasser <eclipse7@gmx.net> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat: add argo_asf muxerZane van Iperen2020-08-07
| | | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/argo_asf: check sample count in demuxerZane van Iperen2020-08-07
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat: add demuxer for argonaut games' ASF formatZane van Iperen2020-01-26
Adds support for the custom ASF container used by some Argonaut Games' games, such as 'Croc! Legend of the Gobbos', and 'Croc 2'. Can also handle the sample files in: https://samples.ffmpeg.org/game-formats/brender/part2.zip Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>