aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/file.c
Commit message (Collapse)AuthorAgeFilesLines
* avformat/file: guard fd_dup by FD_PROTOCOL or PIPE_PROTOCOLZhao Zhili2024-07-161-0/+2
| | | | | | | fd_dup is unused when fd and pipe have been disabled. This also fix build error with wasi since 'dup' isn't available. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* Revert "avformat/file: seek back to initial position for fd protocol"Rémi Denis-Courmont2024-05-301-13/+1
| | | | | | | | | | | | The generally expected behaviour is for software to append from the current position, not to keep resetting. See also how shell works: # (foo && bar) > file ...would normally concatenate the output of both commands to file. If foo seeks like lavf, bar would instead overwrite the output of foo (possibly not completely). This reverts commit 5c3d2177e7be7dde69a83b1b394f57976c164c84.
* avformat/file: fail for non-numerical arguments to pipe:Marton Balint2024-05-071-2/+5
| | | | | | | | | | | | | | | | | | | | | | Before this patch, the implementation of pipe: inputs/outputs would silently fall back to stdin/stdout for any argument not successfully parsed by strtol(). This patch introduces an explicit error for any non-numerical arguments, which should avoid user confusion as in #10977. New behavior: $ cat /tmp/video.mkv | ./ffmpeg -i pipe:aa -acodec copy -vcodec copy -f matroska pipe:1 | cat >/tmp/out.mkv [pipe @ 0x5618c7bcf740] Non-numerical argument "aa" to pipe: [in#0 @ 0x5618c7bced00] Error opening input: Invalid argument Error opening input file pipe:aa. Error opening input files: Invalid argument Based on the patch of Nils Goroll <nils.goroll@uplex.de>. Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec, avformat/ffjni: fix duplicate JNI symbolsLeo Izen2024-04-041-1/+1
| | | | | | | | | Use SHLIBOBJS and STLIBOBJS in the Makefiles for avcodec and avformat, and add a stub ffjni.c to libavformat, which allows the symbols to be duplicated for shared builds but not static builds. Signed-off-by: Leo Izen <leo.izen@gmail.com> Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
* 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/file: Combine all CONFIG_ANDROID_CONTENT_PROTOCOL blocksAndreas Rheinhardt2024-03-261-21/+15
| | | | | | | | | | | | Besides improving readability this also ensures that a developer who has the android content protocol enabled and works on the other parts of the file will not forget to add necessary inclusions just because of (indirect) inclusions from the files included only when said protocol is enabled. Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/file: Constify android content protocolAndreas Rheinhardt2024-03-261-1/+1
| | | | | | | | (The discrepancy between the definition and the declaration in protocols.c is actually UB.) Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: add Android content resolver protocol supportMatthieu Bouron2024-03-231-0/+160
| | | | Handles Android content URIs starting with content://.
* Revert "all: Don't set AVClass.item_name to its default value"Anton Khirnov2024-01-201-0/+3
| | | | | | | 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-221-3/+0
| | | | | | | | Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9; also avoids relocations. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/file: seek back to initial position for fd protocolZhao Zhili2023-12-211-1/+13
| | | | | | | So user's fd can be passed to libavformat multiple times in sequence without changing the position. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/file: add S_IFBLK/S_ISBLK compatability macroZhao Zhili2023-01-121-0/+18
| | | | | | They are not available on Windows. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/file: add fd protocolZhao Zhili2023-01-111-17/+70
| | | | | | | Unlike the pipe protocol, fd protocol has seek support if it corresponding to a regular file. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/file: dup file descriptor for pipeZhao Zhili2023-01-111-10/+34
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/file: reindent after the previous commitZhao Zhili2023-01-111-10/+10
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/file: add fd option for pipeZhao Zhili2023-01-111-2/+7
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avutil/internal: Move avpriv-file API to a header of its ownAndreas Rheinhardt2022-09-031-1/+2
| | | | | | | It is not used by the large majority of files that include lavu/internal.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/file: remove _WIN32 conditionsoftworkz2022-06-091-4/+0
| | | | | | | | stat is now re-mapped with long path support in os_support.h Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* configure: Use a separate config_components.h header for $ALL_COMPONENTSMartin Storsjö2022-03-161-0/+2
| | | | | | | | 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>
* avformat/file: use proper return value in file_closeMarton Balint2021-12-121-1/+2
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* libavformat/file.c: 'file_delete()' and 'file_move()' require ↵Michael Witten2021-08-121-2/+2
| | | | | | | | 'CONFIG_FILE_PROTOCOL' This quashes 2 warnings when the 'file' protocol is not enabled. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/hls: support data protocol in uri for EXT-X-MAPSteven Liu2020-01-181-2/+2
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/file: add seekable option to disallow seekingMarton Balint2019-04-111-0/+5
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/file: Fix file delete for WindowsKarthick Jeyapal2019-01-071-1/+5
| | | | Fixes bug id : 7638
* avformat/file: increase min/max packet size to 256k for written filesMarton Balint2017-06-241-0/+5
| | | | | | | | Buffering more than one packet can be a huge performance improvement for encoding files with small packets (e.g. wav) over SMB/CIFS. Acked-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Marton Balint <cus@passwd.hu>
* libavformat/file: return AVERROR_EOF on EOFDaniel Kucera2017-06-171-0/+2
| | | | | | Signed-off-by: Daniel Kucera <daniel.kucera@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/os_support.h: Fix for unicode filenames on windows.Matt Oliver2016-06-131-0/+4
| | | | | | Fixes #819 #5256 #5281 Signed-off-by: Matt Oliver <protogonoi@gmail.com>
* Merge commit '933dec0e29ec4d2cb83474279a6c52d62fdb7310'Derek Buitenhuis2016-04-191-0/+4
|\ | | | | | | | | | | | | * commit '933dec0e29ec4d2cb83474279a6c52d62fdb7310': file: Add an option for following a file that is being written Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * file: Add an option for following a file that is being writtenMartin Storsjö2016-03-241-0/+4
| | | | | | | | | | | | | | | | Using this requires setting the rw_timeout option to make it terminate, alternatively using the interrupt callback (if used via the API). Signed-off-by: Martin Storsjö <martin@martin.st>
* | avformat/file: Add crypto to default whitelistMichael Niedermayer2016-03-191-2/+2
| | | | | | | | | | | | Fixes Ticket5287 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '2758cdedfb7ac61f8b5e4861f99218b6fd43491d'Derek Buitenhuis2016-02-291-2/+2
|\| | | | | | | | | | | | | | | | | | | | | This commit also disables the async fate test, because it used internal APIs in a non-kosher way, which no longer exists. * commit '2758cdedfb7ac61f8b5e4861f99218b6fd43491d': lavf: reorganize URLProtocols Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavf: reorganize URLProtocolsAnton Khirnov2016-02-221-2/+2
| | | | | | | | | | | | | | | | | | | | Instead of a linked list constructed at av_register_all(), store them in a constant array of pointers. Since no registration is necessary now, this removes some global state from lavf. This will also allow the urlprotocol layer caller to limit the available protocols in a simple and flexible way in the following commits.
* | avformat/file: enable file_move() without unistd.hRaymond Hilseth2016-02-281-4/+0
| | | | | | | | | | | | it only requires the rename function from os_support.h. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Update demuxers and protocols for protocol whitelist supportMichael Niedermayer2016-02-021-0/+2
| | | | | | | | | | Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat: use AV_OPT_TYPE_BOOL in a bunch of placesClément Bœsch2015-12-041-1/+1
| |
* | Merge commit 'e05f7ed5436207f4a55f1978b223c7f8bc82af42'Hendrik Leppkes2015-09-071-6/+6
|\| | | | | | | | | | | | | * commit 'e05f7ed5436207f4a55f1978b223c7f8bc82af42': file: properly forward errors from file_read() and file_write() Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * file: properly forward errors from file_read() and file_write()Sean McGovern2015-09-031-2/+4
| | | | | | | | | | | | | | | | Bug-Id: 881 CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avformat/file: Fix copy and paste errorMichael Niedermayer2015-09-031-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/file: Check for lstat() instead of dirent.hMichael Niedermayer2015-08-251-6/+6
| | | | | | | | | | | | Fixes build on mingw Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/file: check for dirent.h supportMariusz Szczepańczyk2015-08-251-28/+52
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/file: implement directory listing callbacksLukasz Marek2015-08-251-0/+87
| | | | | | | | | | Signed-off-by: Lukasz Marek <lukasz.m.luki2 at gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/file: implement move and delete callbacksMariusz Szczepańczyk2015-06-221-0/+38
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf/file: fix help message first character casing for trunc optionStefano Sabatini2014-01-051-1/+1
| |
* | lavf/file: file_check: Handle file URLs that start with "file:"Alexander Strasser2014-01-041-5/+10
| | | | | | | | | | | | | | | | | | | | Handle the URL analog to file_open, it may contain a "file:" prefix. Skip it. Make access checks to file URLs starting with "file:" work. Fix part of ticket #3249. Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
* | Merge commit '51eb213d00154b8e7856c7667ea62db8b0f663d4'Michael Niedermayer2013-08-081-1/+2
|\| | | | | | | | | | | | | * commit '51eb213d00154b8e7856c7667ea62db8b0f663d4': libavformat: use avpriv_open() Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * libavformat: use avpriv_open()Rémi Denis-Courmont2013-08-071-1/+2
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | file: Add 'blocksize' optionAndrey Utkin2013-07-311-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | Interruptibility of file operations is strongly desirable in case of slow storage access, e.g. mounted network share. This commit introduces possibility to limit data quantity transferred by 'file' protocol at once. By default, old behaviour is preserved and data is still tried to be transferred without block size limitation. Note that file I/O operation still may block (or even freeze) inside of single read(2) or write(2) operation. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | file: fix 10l error in access() checkMichael Niedermayer2012-11-271-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | file: Fallback to stat() based file_check() when access() or its named flags ↵Michael Niedermayer2012-11-271-0/+10
| | | | | | | | | | | | | | | | | | | | are unavailable. Should fix compilation on native windows We could also use _access() and literal numbers as flags but i cant test it and the compilation failure should be fixed ASAP Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | file: fix file_check()Michael Niedermayer2012-11-271-7/+8
| | | | | | | | | | | | | | | | | | | | | | Fixes Ticket1904 This should work on windows, but if not please contact me ASAP i have another idea on how to solve this without access() if that really doesnt work on windows. Strongly based on patch by divVerent Signed-off-by: Michael Niedermayer <michaelni@gmx.at>