machine_ioctl_bt848_h
machine_ioctl_meteor_h
malloc_h
+ MapViewOfFile
memalign
mkstemp
mmap
check_func_headers lzo/lzo1x.h lzo1x_999_compress
check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
check_func_headers windows.h GetProcessTimes
+check_func_headers windows.h MapViewOfFile
check_func_headers windows.h VirtualAlloc
check_header conio.h
#include <unistd.h>
#if HAVE_MMAP
#include <sys/mman.h>
+#elif HAVE_MAPVIEWOFFILE
+#include <io.h>
+#include <windows.h>
#endif
typedef struct {
return err;
}
*bufptr = ptr;
+#elif HAVE_MAPVIEWOFFILE
+ {
+ HANDLE mh, fh = (HANDLE)_get_osfhandle(fd);
+
+ mh = CreateFileMapping(fh, NULL, PAGE_READONLY, 0, 0, NULL);
+ if (!mh) {
+ av_log(&file_log_ctx, AV_LOG_ERROR, "Error occurred in CreateFileMapping()\n");
+ close(fd);
+ return -1;
+ }
+
+ ptr = MapViewOfFile(mh, FILE_MAP_READ, 0, 0, *size);
+ CloseHandle(mh);
+ if (!ptr) {
+ av_log(&file_log_ctx, AV_LOG_ERROR, "Error occurred in MapViewOfFile()\n");
+ close(fd);
+ return -1;
+ }
+
+ *bufptr = ptr;
+ }
#else
*bufptr = av_malloc(*size);
if (!*bufptr) {
{
#if HAVE_MMAP
munmap(bufptr, size);
+#elif HAVE_MAPVIEWOFFILE
+ UnmapViewOfFile(bufptr);
#else
av_free(bufptr);
#endif