diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-03-09 14:33:25 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-03-12 02:08:34 +0100 |
commit | b4f59beeb4c2171879d0d7607a4a7d6165f07791 (patch) | |
tree | c0e7423f6ce12ff9773d1a999fd7feabd462e43b /libavutil/internal.h | |
parent | 5d64ba9d18294a305f4f46c9a64e592dc5d34aa9 (diff) | |
download | ffmpeg-b4f59beeb4c2171879d0d7607a4a7d6165f07791.tar.gz |
avutil/file: Move av_tempfile() to avutil/file_open ff_tempfile()
document the issue with av_tempfile()
Tested-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavutil/internal.h')
-rw-r--r-- | libavutil/internal.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libavutil/internal.h b/libavutil/internal.h index c4bcf37ab8..da76ca26d3 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -244,6 +244,7 @@ void avpriv_request_sample(void *avc, #endif #define avpriv_open ff_open +#define avpriv_tempfile ff_tempfile #define PTRDIFF_SPECIFIER "Id" #define SIZE_SPECIFIER "Iu" #else @@ -319,6 +320,19 @@ static av_always_inline float ff_exp10f(float x) av_warn_unused_result int avpriv_open(const char *filename, int flags, ...); +/** + * 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) |