【发布时间】:2010-01-25 11:40:32
【问题描述】:
我似乎无法弄清楚为什么以下内容不起作用
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')
我正在尝试使用 v4l2 进行捕获。我无法分配内存。
我尝试通过ctypes.addressof(userpointer)
我试图将用户指针转换为 c_void_p
但还是什么都没有。
【问题讨论】:
-
您为什么不使用
pygst之类的东西? -
很多。一 - 我不想在特定项目中依赖 gstreamer。