avutil/internal: Move avpriv-file API to a header of its own

It is not used by the large majority of files that include
lavu/internal.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
pull/388/head
Andreas Rheinhardt 2 years ago
parent 04b7217872
commit 72c601e0f7
  1. 1
      libavcodec/dvdsubdec.c
  2. 2
      libavcodec/libxvid.c
  3. 1
      libavdevice/bktr.c
  4. 1
      libavdevice/fbdev_common.c
  5. 1
      libavdevice/fbdev_dec.c
  6. 1
      libavdevice/fbdev_enc.c
  7. 1
      libavdevice/oss.c
  8. 4
      libavfilter/af_arnndn.c
  9. 1
      libavfilter/af_firequalizer.c
  10. 1
      libavfilter/opencl.c
  11. 2
      libavfilter/vf_curves.c
  12. 2
      libavfilter/vf_deshake.c
  13. 6
      libavfilter/vf_dnn_classify.c
  14. 6
      libavfilter/vf_dnn_detect.c
  15. 1
      libavfilter/vf_fieldhint.c
  16. 4
      libavfilter/vf_lut3d.c
  17. 2
      libavfilter/vf_nnedi.c
  18. 1
      libavfilter/vf_paletteuse.c
  19. 3
      libavfilter/vf_psnr.c
  20. 4
      libavfilter/vf_signature.c
  21. 3
      libavfilter/vf_ssim.c
  22. 3
      libavfilter/vf_vidstabdetect.c
  23. 3
      libavfilter/vf_vidstabtransform.c
  24. 1
      libavfilter/vf_vmafmotion.c
  25. 4
      libavformat/cache.c
  26. 3
      libavformat/file.c
  27. 1
      libavformat/ipfsgateway.c
  28. 1
      libavutil/file.c
  29. 3
      libavutil/file_open.c
  30. 57
      libavutil/file_open.h
  31. 28
      libavutil/internal.h
  32. 1
      libavutil/random_seed.c

@ -27,6 +27,7 @@
#include "libavutil/attributes.h"
#include "libavutil/colorspace.h"
#include "libavutil/file_open.h"
#include "libavutil/opt.h"
#include "libavutil/bswap.h"

@ -30,7 +30,7 @@
#include <xvid.h>
#include "libavutil/avassert.h"
#include "libavutil/file.h"
#include "libavutil/file_open.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"

@ -25,6 +25,7 @@
*/
#include "libavformat/internal.h"
#include "libavutil/file_open.h"
#include "libavutil/internal.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"

@ -26,6 +26,7 @@
#include <stdlib.h>
#include "fbdev_common.h"
#include "libavutil/common.h"
#include "libavutil/file_open.h"
#include "avdevice.h"
struct rgb_pixfmt_map_entry {

@ -34,6 +34,7 @@
#include <time.h>
#include <linux/fb.h>
#include "libavutil/file_open.h"
#include "libavutil/internal.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"

@ -23,6 +23,7 @@
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <linux/fb.h>
#include "libavutil/file_open.h"
#include "libavutil/pixdesc.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"

@ -30,6 +30,7 @@
#include <sys/ioctl.h>
#include <sys/soundcard.h>
#include "libavutil/file_open.h"
#include "libavutil/log.h"
#include "avdevice.h"

@ -31,10 +31,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <float.h>
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/file_open.h"
#include "libavutil/float_dsp.h"
#include "libavutil/mem_internal.h"
#include "libavutil/opt.h"

@ -19,6 +19,7 @@
*/
#include "libavutil/channel_layout.h"
#include "libavutil/file_open.h"
#include "libavutil/opt.h"
#include "libavutil/eval.h"
#include "libavutil/avassert.h"

@ -19,6 +19,7 @@
#include <stdio.h>
#include <string.h>
#include "libavutil/file_open.h"
#include "libavutil/mem.h"
#include "libavutil/pixdesc.h"

@ -22,12 +22,12 @@
#include "libavutil/bprint.h"
#include "libavutil/eval.h"
#include "libavutil/file.h"
#include "libavutil/file_open.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/avassert.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "drawutils.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

@ -50,10 +50,10 @@
*/
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
#include "libavutil/common.h"
#include "libavutil/file_open.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"

@ -21,14 +21,10 @@
* implementing an classification filter using deep learning networks.
*/
#include "libavformat/avio.h"
#include "libavutil/file_open.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "filters.h"
#include "dnn_filter_common.h"
#include "formats.h"
#include "internal.h"
#include "libavutil/time.h"
#include "libavutil/avstring.h"

@ -21,14 +21,10 @@
* implementing an object detecting filter using deep learning networks.
*/
#include "libavformat/avio.h"
#include "libavutil/file_open.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "filters.h"
#include "dnn_filter_common.h"
#include "formats.h"
#include "internal.h"
#include "libavutil/time.h"
#include "libavutil/avstring.h"

@ -19,6 +19,7 @@
*/
#include "libavutil/avassert.h"
#include "libavutil/file_open.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"

@ -29,13 +29,11 @@
#include "float.h"
#include "libavutil/opt.h"
#include "libavutil/file.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/file_open.h"
#include "libavutil/intfloat.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "drawutils.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
#include "lut3d.h"

@ -22,13 +22,13 @@
#include <float.h>
#include "libavutil/common.h"
#include "libavutil/file_open.h"
#include "libavutil/float_dsp.h"
#include "libavutil/imgutils.h"
#include "libavutil/mem_internal.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

@ -24,6 +24,7 @@
*/
#include "libavutil/bprint.h"
#include "libavutil/file_open.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/qsort.h"

@ -26,15 +26,14 @@
*/
#include "libavutil/avstring.h"
#include "libavutil/file_open.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "drawutils.h"
#include "formats.h"
#include "framesync.h"
#include "internal.h"
#include "psnr.h"
#include "video.h"
typedef struct PSNRContext {
const AVClass *class;

@ -24,13 +24,11 @@
* @see http://epubs.surrey.ac.uk/531590/1/MPEG-7%20Video%20Signature%20Author%27s%20Copy.pdf
*/
#include <float.h>
#include "libavcodec/put_bits.h"
#include "libavformat/avformat.h"
#include "libavutil/opt.h"
#include "libavutil/avstring.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/timestamp.h"
#include "libavutil/file_open.h"
#include "avfilter.h"
#include "internal.h"
#include "signature.h"

@ -35,15 +35,14 @@
*/
#include "libavutil/avstring.h"
#include "libavutil/file_open.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "drawutils.h"
#include "formats.h"
#include "framesync.h"
#include "internal.h"
#include "ssim.h"
#include "video.h"
typedef struct SSIMContext {
const AVClass *class;

@ -23,8 +23,9 @@
#include <vid.stab/libvidstab.h>
#include "libavutil/common.h"
#include "libavutil/file_open.h"
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "internal.h"

@ -23,8 +23,9 @@
#include <vid.stab/libvidstab.h>
#include "libavutil/common.h"
#include "libavutil/file_open.h"
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "internal.h"

@ -24,6 +24,7 @@
* Calculate VMAF Motion score.
*/
#include "libavutil/file_open.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"

@ -29,10 +29,10 @@
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/internal.h"
#include "libavutil/file_open.h"
#include "libavutil/opt.h"
#include "libavutil/tree.h"
#include "avformat.h"
#include "avio.h"
#include <fcntl.h>
#if HAVE_IO_H
#include <io.h>

@ -22,9 +22,10 @@
#include "config_components.h"
#include "libavutil/avstring.h"
#include "libavutil/file_open.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "avformat.h"
#include "avio.h"
#if HAVE_DIRENT_H
#include <dirent.h>
#endif

@ -20,6 +20,7 @@
*/
#include "libavutil/avstring.h"
#include "libavutil/file_open.h"
#include "libavutil/getenv_utf8.h"
#include "libavutil/opt.h"
#include <sys/stat.h>

@ -18,6 +18,7 @@
#include "config.h"
#include "file.h"
#include "file_open.h"
#include "internal.h"
#include "log.h"
#include "mem.h"

@ -17,7 +17,8 @@
*/
#include "config.h"
#include "internal.h"
#include "avutil.h"
#include "file_open.h"
#include "mem.h"
#include <stdarg.h>
#include <fcntl.h>

@ -0,0 +1,57 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_FILE_OPEN_H
#define AVUTIL_FILE_OPEN_H
#include <stdio.h>
#include "config.h"
#include "attributes.h"
#if HAVE_LIBC_MSVCRT
#define avpriv_fopen_utf8 ff_fopen_utf8
#define avpriv_open ff_open
#define avpriv_tempfile ff_tempfile
#endif
/**
* A wrapper for open() setting O_CLOEXEC.
*/
av_warn_unused_result
int avpriv_open(const char *filename, int flags, ...);
/**
* Open a file using a UTF-8 filename.
*/
FILE *avpriv_fopen_utf8(const char *path, const char *mode);
/**
* Wrapper to work around the lack of mkstemp() on mingw.
* Also, tries to create file in /tmp first, if possible.
* *prefix can be a character constant; *filename will be allocated internally.
* @return file descriptor of opened file (or negative value corresponding to an
* AVERROR code on error)
* and opened file name in **filename.
* @note On very old libcs it is necessary to set a secure umask before
* calling this, av_tempfile() can't call umask itself as it is used in
* libraries and could interfere with the calling application.
*/
int avpriv_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx);
#endif /* AVUTIL_FILE_OPEN_H */

@ -155,10 +155,6 @@ void avpriv_request_sample(void *avc,
#pragma comment(linker, "/include:" EXTERN_PREFIX "avpriv_snprintf")
#endif
#define avpriv_fopen_utf8 ff_fopen_utf8
#define avpriv_open ff_open
#define avpriv_tempfile ff_tempfile
#define PTRDIFF_SPECIFIER "Id"
#define SIZE_SPECIFIER "Iu"
#else
@ -188,30 +184,6 @@ void avpriv_request_sample(void *avc,
#define SUINT32 uint32_t
#endif
/**
* A wrapper for open() setting O_CLOEXEC.
*/
av_warn_unused_result
int avpriv_open(const char *filename, int flags, ...);
/**
* Open a file using a UTF-8 filename.
*/
FILE *avpriv_fopen_utf8(const char *path, const char *mode);
/**
* Wrapper to work around the lack of mkstemp() on mingw.
* Also, tries to create file in /tmp first, if possible.
* *prefix can be a character constant; *filename will be allocated internally.
* @return file descriptor of opened file (or negative value corresponding to an
* AVERROR code on error)
* and opened file name in **filename.
* @note On very old libcs it is necessary to set a secure umask before
* calling this, av_tempfile() can't call umask itself as it is used in
* libraries and could interfere with the calling application.
*/
int avpriv_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx);
int avpriv_set_systematic_pal2(uint32_t pal[256], enum AVPixelFormat pix_fmt);
static av_always_inline av_const int avpriv_mirror(int x, int w)

@ -35,6 +35,7 @@
#include <time.h>
#include <string.h>
#include "avassert.h"
#include "file_open.h"
#include "internal.h"
#include "intreadwrite.h"
#include "timer.h"

Loading…
Cancel
Save