43static int win32_open(
const char *filename_utf8,
int oflag,
int pmode)
49 if (get_extended_win32_path(filename_utf8, &filename_w))
54 fd = _wsopen(filename_w, oflag, SH_DENYNO, pmode);
57 if (fd != -1 || (oflag & O_CREAT))
62 return _sopen(filename_utf8, oflag, SH_DENYNO, pmode);
64#define open win32_open
70 unsigned int mode = 0;
75 mode = va_arg(ap,
unsigned int);
88 if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
103 .class_name =
"TEMPFILE",
121 ptr= tempnam(
".",
prefix);
142 fd = mkstemp(*filename);
143#if defined(_WIN32) || defined (__ANDROID__) || defined(__DJGPP__)
146 fd = mkstemp(*filename);
153 av_log(&file_log_ctx,
AV_LOG_ERROR,
"ff_tempfile: Cannot open temporary file %s\n", *filename);
164 const char *m =
mode;
167 case 'r': access = O_RDONLY;
break;
168 case 'w': access = O_CREAT|O_WRONLY|O_TRUNC;
break;
169 case 'a': access = O_CREAT|O_WRONLY|O_APPEND;
break;
176 access &= ~(O_RDONLY | O_WRONLY);
178 }
else if (*m ==
'b') {
191 return fdopen(fd,
mode);
Convenience header that includes libavutil's core.
#define flags(name, subs,...)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char * av_default_item_name(void *ptr)
Return the context name.
#define LIBAVUTIL_VERSION_INT
static const AVClass file_log_ctx_class
FILE * avpriv_fopen_utf8(const char *path, const char *mode)
Open a file using a UTF-8 filename.
int avpriv_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx)
Wrapper to work around the lack of mkstemp() on mingw.
int avpriv_open(const char *filename, int flags,...)
A wrapper for open() setting O_CLOEXEC.
Memory handling functions.
Describe the class of an AVClass context structure.