I cannot seem to figure it out why the following does not work
import ctypes
from ctypes.util import find_library
libc = ctypes.CDLL(find_library('c'))
userpointer = ctypes.c_void_p
sizeimage = 320*240*2
if libc.posix_memalign(userpointer, libc.getpagesize(), sizeimage) != 0:
raise Exception('ENOMEM')
I am trying to capture using v4l2. I cannot allocate memory.
I tried passing ctypes.addressof(userpointer)
I tried to cast userpointer to c_void_p
but still nothing.