34 #elif HAVE_MAPVIEWOFFILE 71 if (fstat(fd, &st) < 0) {
79 off_size = st.st_size;
80 if (off_size > SIZE_MAX) {
82 "File size for file '%s' is too big\n", filename);
89 ptr = mmap(
NULL, *size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
90 if (ptr == MAP_FAILED) {
98 #elif HAVE_MAPVIEWOFFILE 102 mh = CreateFileMapping(fh,
NULL, PAGE_READONLY, 0, 0,
NULL);
109 ptr = MapViewOfFile(mh, FILE_MAP_READ, 0, 0, *size);
126 read(fd, *bufptr, *size);
136 munmap(bufptr, size);
137 #elif HAVE_MAPVIEWOFFILE 138 UnmapViewOfFile(bufptr);
#define LIBAVUTIL_VERSION_INT
Memory handling functions.
const char * av_default_item_name(void *ptr)
Return the context name.
int avpriv_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx)
Wrapper to work around the lack of mkstemp() on mingw.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int avpriv_open(const char *filename, int flags,...)
A wrapper for open() setting O_CLOEXEC.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_file_unmap(uint8_t *bufptr, size_t size)
Unmap or free the buffer bufptr created by av_file_map().
int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, int log_offset, void *log_ctx)
Read the file with name filename, and put its content in a newly allocated buffer or map it with mmap...
common internal API header
int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx)
Wrapper to work around the lack of mkstemp() on mingw.
Describe the class of an AVClass context structure.
int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
Put a description of the AVERROR code errnum in errbuf.
static const AVClass file_log_ctx_class