HW Accelerated Resizing/Scaler plugin not accepting caps
Nicolas Dufresne
nicolas at ndufresne.ca
Tue Feb 27 00:21:06 UTC 2018
Le 26 févr. 2018 15:26, "rathaval" <rathaval at xilinx.com> a écrit :
Hello Gst Community,
I'm trying to write a plugin that is based on the Video Filter as its base
class. It works well for no-resizing,
1:1 pass through pipelines.
gst-launch-1.0 videotestsrc ! xm2mvscaler device=/dev/xm2mvsc0 batch-size=1
buffer-mode=2 ! video/x-raw,format=RGB,width=1280,height=720,framerate=30/1
! videoconvert ! fpsdisplaysink videosink="kmssink driver-name=xilinx_drm
plane-id=26" text-overlay=false
/(Working pipeline)/
When I try to scale it :
gst-launch-1.0 videotestsrc !
video/x-raw,format=RGB,width=1280,height=720,framerate=30/1 ! xm2mvscaler
device=/dev/xm2mvsc0 batch-size=1 buffer-mode=2 !
video/x-raw,format=RGB,width=1920,height=1080,framerate=30/1 ! videoconvert
! fpsdisplaysink videosink="kmssink driver-name=xilinx_drm plane-id=26"
text-overlay=false
WARNING: erroneous pipeline: could not link xm2mvscaler0 to videoconvert0
and it *errors out*. After reading a little more of the gstvideofilter.c
source code, it appears basing off the VideoFilter class may not be the
right thing as it maps the frames for you.
*
My question is what is the best way to map input buffers and output buffers
for HW Accelerated scalers? And does a VideoFilter not support resizing at
all ? I'd be glad to post more information, but a hint towards what's not
working would be very helpful. *
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.
Looking at gst_video_filter_transform_size routine, I suspect it does not
allow resizing.
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.
===
Logs
0:00:04.053976831 2358 0x30b1c890 DEBUG capsfilter
gstcapsfilter.c:295:gst_capsfilter_transform_caps:<capsfilter1> input:
ANY
0:00:04.054003403 2358 0x30b1c890 DEBUG capsfilter
gstcapsfilter.c:296:gst_capsfilter_transform_caps:<capsfilter1> filter:
(NULL)
0:00:04.054028636 2358 0x30b1c890 DEBUG capsfilter
gstcapsfilter.c:298:gst_capsfilter_transform_caps:<capsfilter1> caps filter:
video/x-raw, format=(string)RGB, width=(int)1920, height=(int)1080,
framerate=(fraction)30/1
0:00:04.054070900 2358 0x30b1c890 DEBUG capsfilter
gstcapsfilter.c:299:gst_capsfilter_transform_caps:<capsfilter1> intersect:
video/x-raw, format=(string)RGB, width=(int)1920, height=(int)1080,
framerate=(fraction)30/1
0:00:04.054115894 2358 0x30b1c890 DEBUG GST_PADS
gstpad.c:3938:gst_pad_query:<capsfilter1:sink> sent query 0x30c518a0 (caps),
result 1
0:00:04.054153528 2358 0x30b1c890 INFO GST_PADS
gstpad.c:2371:gst_pad_link_prepare: caps are incompatible
0:00:04.054178351 2358 0x30b1c890 INFO GST_PADS
gstpad.c:2464:gst_pad_link_full: link between xm2mvscaler0:src and
capsfilter1:sink failed: no common format
===
gst-inspect-1.0 output :
root at peta_xm2m_vscaler:~# gst-inspect-1.0 xm2mvscaler
Factory Details:
Rank none (0)
Long-name Xilinx M2M Video Scaler
Klass Xilinx M2M Video Scaler
Description Xilinx M2M Video Scaler
Author Rohit Athavale <rohit.athavale at xilinx.com>
Plugin Details:
Name xm2mvscaler
Description Xilinx M2M Scaler plugin
Filename /usr/lib/gstreamer-1.0/libgstxm2mvscaler.so
Version 0.6
License LGPL
Source module xm2mvscaler
Binary package GStreamer
Origin URL http://gstreamer.net/
GObject
+----GInitiallyUnowned
+----GstObject
+----GstElement
+----GstBaseTransform
+----GstVideoFilter
+----GstXm2mVScaler
Pad Templates:
SINK template: 'sink'
Availability: Always
Capabilities:
video/x-raw
format: { RGB }
width: [ 1, 3840 ]
height: [ 1, 2160 ]
framerate: [ 0/1, 2147483647/1 ]
SRC template: 'src'
Availability: Always
Capabilities:
video/x-raw
format: { RGB }
width: [ 1, 3840 ]
height: [ 1, 2160 ]
framerate: [ 0/1, 2147483647/1 ]
Element Flags:
no flags set
Element Implementation:
Has change_state() function: gst_element_change_state_func
Element has no clocking capabilities.
Element has no URI handling capabilities.
Pads:
SINK: 'sink'
Pad Template: 'sink'
SRC: 'src'
Pad Template: 'src'
Element Properties:
name : The name of the object
flags: readable, writable
String. Default: "xm2mvscaler0"
parent : The parent of the object
flags: readable, writable
Object of type "GstObject"
qos : Handle Quality-of-Service events
flags: readable, writable
Boolean. Default: true
buffer-mode : Buffer Mode
flags: readable, writable
Enum "GstXm2mVScalerBufferMode" Default: 0, ""
(1): DMABUF - GST_XM2MVSC_BUF_DMABUF
(2): Driver allocated contiguous memory -
GST_XM2MVSC_BUF_KERNEL_DRV
batch-size : Frame Batch Size
flags: readable, writable
Enum "GstXm2mVScalerBatchSize" Default: 0, ""
(1): One -
GST_XM2MVSCALER_BATCH_SIZE_ONE
(2): Two -
GST_XM2MVSCALER_BATCH_SIZE_TWO
(8): Eight -
GST_XM2MVSCALER_BATCH_SIZE_EIGHT
device : Location of Device File being used
flags: readable, writable
String. Default: "/dev/xm2mvsc0"
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180226/95bf77a4/attachment-0001.html>
More information about the gstreamer-devel
mailing list