<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 24 févr. 2021 04 h 45, Bing Song <<a href="mailto:bing.song@nxp.com">bing.song@nxp.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="ZH-CN" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div>
<p class="MsoNormal"><span lang="EN-US">Hi,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Gst-transcoding will use v4l2videodec and v4l2videoenc. The default of v4l2videoenc input is MMAP mode. It cause video frame copy in v4l2videoenc input. How to avoid the video frame buffer copy?</span></p></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">This needs to be fixed inside v4l2videoenc class. Currently the import is not using the new try_import calls, so it is unsafe as it does not communicate padding and strides to the driver. I have a partial solution to this that I made last week, I need to cleanup and make an MR.</div><div dir="auto"><br></div><div dir="auto">Now, it's partial as it only validate the very first buffer, it should keep validating in case something changes.</div><div dir="auto"><br></div><div dir="auto">The next Todo before actually making it try to import by default is to figure out how we will handle copy fallback. We could reset the encoder and reallocate, but this method would not be reversible, and would produce a spurious keyframe (meaning the gops might not always be as requested). We need to decide if that would be good enough, in real app, we do hope we will not have to fallback. The alternative would be to have scratch buffers on the side as backup buffers, but the would use a big chunk of memory.</div><div dir="auto"><br></div><div dir="auto">Meanwhile, one can always track the encoder being added to the pipeline (deep-element-added signal, or state transition message) and set the output-io-mode to dmabuf-import mode, and hope that buffers are properly aligned.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="ZH-CN" link="#0563C1" vlink="#954F72" style="word-wrap:break-word"><div><p class="MsoNormal"><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Bing<u></u><u></u></span></p>
</div>
</div>

_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank" rel="noreferrer">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div></div></div>