<div dir="ltr"><div dir="ltr"><div dir="ltr"><span class="gmail-ui-provider ec gmail-bzn gmail-bob gmail-bzo gmail-bzp gmail-bzq gmail-bzr gmail-bzs gmail-bzt gmail-bzu gmail-bzv gmail-bzw gmail-bzx gmail-bzy gmail-bzz gmail-caa gmail-cab gmail-cac gmail-cae gmail-caf gmail-cag gmail-cah gmail-cai gmail-caj gmail-cak gmail-cal gmail-cam gmail-can gmail-cao gmail-cap gmail-caq gmail-car gmail-cas gmail-cat gmail-cau" dir="ltr"><p class="MsoNormal">Hi All,</p><p class="MsoNormal"><br></p><p class="MsoNormal">I am working on a v4l2 decoder and encoder which works on
dmabuf-import mode on both capture and output interface.<span></span></p><p class="MsoNormal"><span> </span></p><p class="MsoNormal">But it is evident from the log that v4l2encoder throws error
 if downstream plugin does not provide a
pool <span></span></p><p class="MsoNormal"><span> </span></p><p class="MsoNormal">example pipeline : gst-launch-1.0 videotestsrc ! v4l2h264enc
capture-io-mode=5 output-io-mode=5 ! fakesink<span></span></p><p class="MsoNormal"><span> </span></p><p class="MsoNormal"><b>gst_v4l2_object_decide_allocation:<v4l2h264enc0>
error: When importing DMABUF or USERPTR, we need a pool to import from<span></span></b></p><p class="MsoNormal"><span> </span></p><p class="MsoNormal"><span> </span></p><p class="MsoNormal"><span> </span></p><p class="MsoNormal">Similarly in case of decoder also if upstream plugin pushes
non-fd buffer then pipeline throws error dmabuf import failed.<span></span></p><p class="MsoNormal"><span> </span></p><p class="MsoNormal">example pipeline : gst-launch-1.0 filesrc location=/1.mp4 !
qtdemux ! h264parse ! v4l2h264dec capture-io-mode=5 output-io-mode=5 ! fakesink<span></span></p><p class="MsoNormal"><span> </span></p><p class="MsoNormal"><b>gst_v4l2_allocator_import_dmabuf:<v4l2h264dec0:pool0:sink:allocator>
Memory 0 is not of DMABUF<span></span></b></p><p class="MsoNormal"><b>v4l2bufferpool
gstv4l2bufferpool.c:396:gst_v4l2_buffer_pool_import_dmabuf:<v4l2h264dec0:pool0:sink>
failed to import dmabuf<span></span></b></p><p class="MsoNormal"><b><span> </span></b></p><p class="MsoNormal">What is the recommendation to handle such cases?<span></span></p><p class="MsoNormal"><span> </span></p><p class="MsoNormal">1. Implement a two separate gstreamer plugins which generates
dma buffers, for example predmabufgen and postdmabufgen in the following
examples<span></span></p><p class="MsoNormal"><span> </span></p><p class="MsoNormal">Example Pipeline:<span></span></p><p class="MsoNormal"><span> </span></p><p class="MsoNormal">gst-launch-1.0 filesrc location=/1.mp4 ! qtdemux ! h264parse
! <b>predmabufgen</b>  v4l2h264dec
capture-io-mode=5 output-io-mode=5 ! <b>postdmabufgen</b> ! fakesink<span></span></p><p class="MsoNormal">gst-launch-1.0 videotestsrc ! <b>predmabufgen</b> !
v4l2h264enc capture-io-mode=5 output-io-mode=5 ! <b>postdmabufgen</b> !
fakesink<span></span></p><p class="MsoNormal"><span> </span></p><p style="margin-bottom:1em">



















































</p><p class="MsoNormal">2. Allocate dmabuf in the v4l2dec/v4l2enc plugin in case of
dmabuf-import if downstream is not providing a pool or upstream plugin is snot
sending fd buffer?<span></span></p><p class="MsoNormal"><br></p><p class="MsoNormal">Thanks</p><p class="MsoNormal">Arindam</p></span></div></div></div>