Skip to content
Permalink
Browse files

Add mmap via libv4l to generic_v4l2_device

Issue #437
  • Loading branch information...
dhobsong authored and msisov committed Mar 21, 2018
1 parent 406be5f commit f5d6ab3f07afb93aed940e9d26b737e06982effb
Showing with 12 additions and 0 deletions.
  1. +10 −0 media/gpu/v4l2/generic_v4l2_device.cc
  2. +2 −0 media/gpu/v4l2/v4l2.sig
@@ -100,10 +100,20 @@ void* GenericV4L2Device::Mmap(void* addr,
int flags,
unsigned int offset) {
DCHECK(device_fd_.is_valid());
#if BUILDFLAG(USE_LIBV4L2)
if (use_libv4l2_)
return v4l2_mmap(addr, len, prot, flags, device_fd_.get(), offset);
#endif
return mmap(addr, len, prot, flags, device_fd_.get(), offset);
}

void GenericV4L2Device::Munmap(void* addr, unsigned int len) {
#if BUILDFLAG(USE_LIBV4L2)
if (use_libv4l2_) {
v4l2_munmap(addr, len);
return;
}
#endif
munmap(addr, len);
}

@@ -8,3 +8,5 @@
LIBV4L_PUBLIC int v4l2_close(int fd);
LIBV4L_PUBLIC int v4l2_ioctl(int fd, unsigned long int request, ...);
LIBV4L_PUBLIC int v4l2_fd_open(int fd, int v4l2_flags);
LIBV4L_PUBLIC void *v4l2_mmap(void *start, size_t length, int prot, int flags, int fd, int64_t offset);
LIBV4L_PUBLIC int v4l2_munmap(void *_start, size_t length);

0 comments on commit f5d6ab3

Please sign in to comment.
You can’t perform that action at this time.