<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">Le 26 févr. 2018 15:26, "rathaval" <<a href="mailto:rathaval@xilinx.com">rathaval@xilinx.com</a>> a écrit :<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Gst Community,<br>
<br>
I'm trying to write a plugin that is based on the Video Filter as its base<br>
class. It works well for no-resizing,<br>
1:1 pass through pipelines.<br>
<br>
gst-launch-1.0 videotestsrc ! xm2mvscaler device=/dev/xm2mvsc0 batch-size=1<br>
buffer-mode=2 ! video/x-raw,format=RGB,width=<wbr>1280,height=720,framerate=30/1<br>
! videoconvert ! fpsdisplaysink videosink="kmssink driver-name=xilinx_drm<br>
plane-id=26" text-overlay=false<br>
/(Working pipeline)/<br>
<br>
When I try to scale it :<br>
gst-launch-1.0 videotestsrc !<br>
video/x-raw,format=RGB,width=<wbr>1280,height=720,framerate=30/1 ! xm2mvscaler<br>
device=/dev/xm2mvsc0 batch-size=1 buffer-mode=2 !<br>
video/x-raw,format=RGB,width=<wbr>1920,height=1080,framerate=30/<wbr>1 ! videoconvert<br>
! fpsdisplaysink videosink="kmssink driver-name=xilinx_drm plane-id=26"<br>
text-overlay=false<br>
WARNING: erroneous pipeline: could not link xm2mvscaler0 to videoconvert0<br>
<br>
and it *errors out*. After reading a little more of the gstvideofilter.c<br>
source code, it appears basing off the VideoFilter class may not be the<br>
right thing as it maps the frames for you.<br>
<br>
<br>
*<br>
My question is what is the best way to map input buffers and output buffers<br>
for HW Accelerated scalers? And does a VideoFilter not support resizing at<br>
all ? I'd be glad to post more information, but a hint towards what's not<br>
working would be very helpful. *<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Have a look at GstV4l2Transform element in gst-plugins-good. It's doing this already, but using a standard Linux interface instead of custom set of ioctl. On the software size, have a look at videoscale code.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Looking at gst_video_filter_transform_<wbr>size routine, I suspect it does not<br>
allow resizing.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">It does allow resizing if you implement it properly. But it seems a bit pointless to debug this element since I don't see any valid upstream argument for this scaler driver to use a custom ioctl interface, hence not use GstV4l2Transform. I have seen the staging submission on linux-media for this driver.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
===<br>
Logs<br>
0:00:04.053976831  2358     0x30b1c890 DEBUG             capsfilter<br>
gstcapsfilter.c:295:gst_<wbr>capsfilter_transform_caps:<<wbr>capsfilter1> input:<br>
ANY<br>
0:00:04.054003403  2358     0x30b1c890 DEBUG             capsfilter<br>
gstcapsfilter.c:296:gst_<wbr>capsfilter_transform_caps:<<wbr>capsfilter1> filter:<br>
(NULL)<br>
0:00:04.054028636  2358     0x30b1c890 DEBUG             capsfilter<br>
gstcapsfilter.c:298:gst_<wbr>capsfilter_transform_caps:<<wbr>capsfilter1> caps filter:<br>
video/x-raw, format=(string)RGB, width=(int)1920, height=(int)1080,<br>
framerate=(fraction)30/1<br>
0:00:04.054070900  2358     0x30b1c890 DEBUG             capsfilter<br>
gstcapsfilter.c:299:gst_<wbr>capsfilter_transform_caps:<<wbr>capsfilter1> intersect:<br>
video/x-raw, format=(string)RGB, width=(int)1920, height=(int)1080,<br>
framerate=(fraction)30/1<br>
0:00:04.054115894  2358     0x30b1c890 DEBUG               GST_PADS<br>
gstpad.c:3938:gst_pad_query:<<wbr>capsfilter1:sink> sent query 0x30c518a0 (caps),<br>
result 1<br>
0:00:04.054153528  2358     0x30b1c890 INFO                GST_PADS<br>
gstpad.c:2371:gst_pad_link_<wbr>prepare: caps are incompatible<br>
0:00:04.054178351  2358     0x30b1c890 INFO                GST_PADS<br>
gstpad.c:2464:gst_pad_link_<wbr>full: link between xm2mvscaler0:src and<br>
capsfilter1:sink failed: no common format<br>
===<br>
gst-inspect-1.0 output :<br>
root@peta_xm2m_vscaler:~# gst-inspect-1.0 xm2mvscaler<br>
Factory Details:<br>
  Rank                     none (0)<br>
  Long-name                Xilinx M2M Video Scaler<br>
  Klass                    Xilinx M2M Video Scaler<br>
  Description              Xilinx M2M Video Scaler<br>
  Author                   Rohit Athavale <<a href="mailto:rohit.athavale@xilinx.com">rohit.athavale@xilinx.com</a>><br>
<br>
Plugin Details:<br>
  Name                     xm2mvscaler<br>
  Description              Xilinx M2M Scaler plugin<br>
  Filename                 /usr/lib/gstreamer-1.0/<wbr>libgstxm2mvscaler.so<br>
  Version                  0.6<br>
  License                  LGPL<br>
  Source module            xm2mvscaler<br>
  Binary package           GStreamer<br>
  Origin URL               <a href="http://gstreamer.net/" rel="noreferrer" target="_blank">http://gstreamer.net/</a><br>
<br>
GObject<br>
 +----GInitiallyUnowned<br>
       +----GstObject<br>
             +----GstElement<br>
                   +----GstBaseTransform<br>
                         +----GstVideoFilter<br>
                               +----GstXm2mVScaler<br>
<br>
Pad Templates:<br>
  SINK template: 'sink'<br>
    Availability: Always<br>
    Capabilities:<br>
      video/x-raw<br>
                 format: { RGB }<br>
                  width: [ 1, 3840 ]<br>
                 height: [ 1, 2160 ]<br>
              framerate: [ 0/1, 2147483647/1 ]<br>
<br>
  SRC template: 'src'<br>
    Availability: Always<br>
    Capabilities:<br>
      video/x-raw<br>
                 format: { RGB }<br>
                  width: [ 1, 3840 ]<br>
                 height: [ 1, 2160 ]<br>
              framerate: [ 0/1, 2147483647/1 ]<br>
<br>
<br>
Element Flags:<br>
  no flags set<br>
<br>
Element Implementation:<br>
  Has change_state() function: gst_element_change_state_func<br>
<br>
Element has no clocking capabilities.<br>
Element has no URI handling capabilities.<br>
<br>
Pads:<br>
  SINK: 'sink'<br>
    Pad Template: 'sink'<br>
  SRC: 'src'<br>
    Pad Template: 'src'<br>
<br>
Element Properties:<br>
  name                : The name of the object<br>
                        flags: readable, writable<br>
                        String. Default: "xm2mvscaler0"<br>
  parent              : The parent of the object<br>
                        flags: readable, writable<br>
                        Object of type "GstObject"<br>
  qos                 : Handle Quality-of-Service events<br>
                        flags: readable, writable<br>
                        Boolean. Default: true<br>
  buffer-mode         : Buffer Mode<br>
                        flags: readable, writable<br>
                        Enum "GstXm2mVScalerBufferMode" Default: 0, ""<br>
                           (1): DMABUF           - GST_XM2MVSC_BUF_DMABUF<br>
                           (2): Driver allocated contiguous memory -<br>
GST_XM2MVSC_BUF_KERNEL_DRV<br>
  batch-size          : Frame Batch Size<br>
                        flags: readable, writable<br>
                        Enum "GstXm2mVScalerBatchSize" Default: 0, ""<br>
                           (1): One              -<br>
GST_XM2MVSCALER_BATCH_SIZE_ONE<br>
                           (2): Two              -<br>
GST_XM2MVSCALER_BATCH_SIZE_TWO<br>
                           (8): Eight            -<br>
GST_XM2MVSCALER_BATCH_SIZE_<wbr>EIGHT<br>
  device              : Location of Device File being used<br>
                        flags: readable, writable<br>
                        String. Default: "/dev/xm2mvsc0"<br>
<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://gstreamer-devel.966125.n4.nabble.com/" rel="noreferrer" target="_blank">http://gstreamer-devel.966125.<wbr>n4.nabble.com/</a><br>
______________________________<wbr>_________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.<wbr>freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/gstreamer-<wbr>devel</a><br>
</blockquote></div><br></div></div></div>