Gstreamer v4l2src:无法分配所需的内存

时间:2019-03-21 10:23:33

标签: c linux-device-driver v4l2 gstreamer-1.0

我正在编写v4l2驱动程序,但是在gstreamer管道使用它时遇到一些问题。我已经实现了这些ioctl操作:

  • vidioc_querycap
  • vidioc_s_fmt_vid_cap
  • vidioc_try_fmt_vid_cap
  • vidioc_enum_frameintervals
  • vidioc_enum_framesizes
  • vidioc_enum_input
  • vidioc_enum_fmt_vid_cap

当我运行gstreamer管道(gst-launch-1.0 v4l2src!video / x-raw,format = RGB,width = 4096,height = 2160,framerate = 60/1!fakesink)时,我收到此错误:

ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
Additional debug info:
../../../git/sys/v4l2/gstv4l2src.c(555): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Buffer pool activation failed

这是gstreamer的一些调试输出:

DEBUG                   v4l2 gstv4l2object.c:2858:gst_v4l2_object_setup_pool:<v4l2src0> initializing the capture system
INFO                    v4l2 gstv4l2object.c:2882:gst_v4l2_object_setup_pool:<v4l2src0> accessing buffers via mode 1
LOG                     v4l2 gstv4l2object.c:2891:gst_v4l2_object_setup_pool:<v4l2src0> initiating buffer pool
DEBUG                   v4l2 gstv4l2object.c:4035:gst_v4l2_object_decide_allocation:<v4l2src0> decide allocation
DEBUG                   v4l2 gstv4l2object.c:4061:gst_v4l2_object_decide_allocation:<v4l2src0> allocation: size:0 min:0 max:0 pool:(NULL)
DEBUG                   v4l2 gstv4l2object.c:4088:gst_v4l2_object_decide_allocation:<v4l2src0> read/write mode: no downstream pool, using our own
DEBUG                   v4l2 gstv4l2object.c:4195:gst_v4l2_object_decide_allocation:<v4l2src0> setting own pool config to GstBufferPoolConfig, caps=(GstCaps)"video/x-raw\,\ format\=\(string\)RGB\,\ width\=\(int\)4096\,\ height\=\(int\)2160\,\ framerate\=\(fraction\)60/1\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive", size=(uint)26542080, min-buffers=(uint)4, max-buffers=(uint)0, allocator=(GstAllocator)"NULL", params=(GstAllocationParams)NULL;
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
Additional debug info:
../../../git/sys/v4l2/gstv4l2src.c(555): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Buffer pool activation failed
Execution ended after 0:00:00.410428919
Setting pipeline to PAUSED ...
LOG                     v4l2 gstv4l2object.c:3913:gst_v4l2_object_unlock:<v4l2src0> start flushing
Setting pipeline to READY ...
LOG                     v4l2 gstv4l2object.c:3913:gst_v4l2_object_unlock:<v4l2src0> start flushing
LOG                     v4l2 gstv4l2object.c:3926:gst_v4l2_object_unlock_stop:<v4l2src0> stop flushing
DEBUG                   v4l2 gstv4l2object.c:3937:gst_v4l2_object_stop:<v4l2src0> stopping
DEBUG                   v4l2 gstv4l2object.c:3945:gst_v4l2_object_stop:<v4l2src0> deactivating pool
Setting pipeline to NULL ...
DEBUG                   v4l2 v4l2_calls.c:719:gst_v4l2_close:<v4l2src0> Trying to close /dev/video0
DEBUG                   v4l2 v4l2_calls.c:464:gst_v4l2_empty_lists:<v4l2src0> deleting enumerations
Freeing pipeline ...

我找不到错误的原因,也许我忘记了ioctl操作?

谢谢

0 个答案:

没有答案