Plugin/Application/Pipeline Nameο
A brief description of your plugin/application/pipeline goes here.
Table of Contentsο
Introductionο
GStreamer plugins to read/write data from/to PCIe bus. There are two available plugins: simaaipciesrc
and simaaipciesink
.
Featuresο
simaaipciesrc
ο
Multiple source pad / stream supportο
simaaipciesrc
provides a capability to link more than 1 downstream elements by using GST_PAD_REQUEST
in its source pad template. Each source pad must have an associated sink pad on Host side. Once new source pad is created it receives its id which is number representing the order this pad was created: 0, 1, 2β¦ Each buffer that comes from Host has a stream-id
field which has a similar value. This value is being evaluated against source pads ids. Once it is matched - data buffer will pushed to this pad. For example: buffer with stream-id=2
will be pushed to src_2
. Count starts from 0.
CAPs negotiationο
Negotiation happens between PCIe Host sink pad and associated simaaipciesrc
source pad. The flow as follows: - All sink pads of Host element receives GST_EVENT_CAPS - GstCaps values are combined into one single message and passed to SoC - simaaipciesrc
receives message, checks the no:of caps with no:of src pads available. If this check passes - assigns caps from Host to associated src pad - simaaipciesrc
sends GST_EVENT_CAPS to each src pad peer and performs CAPs negotiation
Automatic output buffer size calculationο
simaaipciesrc
can automatically calculate output buffer size from the negotiated CAPs by using next formula: > image_width * image_height * stride That means CAPs shall contain information about frame width and height and format. Format is used to deduce stride
parameter. Currently, simaaipciesrc
plugin can automatically deduce stride
for the following formats: - NV12 - I420 - RGB - BGR
If format differs from the listed above User can specify output buffer size manually, by using
buffer-size
property. Otherwise, the default buffer size value (4MB) will be used
simaaipciesink
ο
Supports one sink pad
Allows any CAPs from upstream element
Getting Startedο
These plugins are part of BSP. That means, User normally donβt need to build them manually, they are available out of box on the board.
To build the plugin use:
source /opt/poky/4.0.10/environment-setup-cortexa65-poky-linux
mkdir build && cd build && cmake -DBSP_PLUGINS=ON .. && make
Also, User shall install PCIe host package on the host x86 machine which contains pciehost
GStreamer, plugin, PCIe driver and host library, see Installation section.
Prerequisitesο
Yocto SDK installed
Installationο
SoC:
scp libgstpciesocsink.so libgstpciesrc.so sima@<IP address of DaVinci board>:/data/my_pipeline/libs
Host:
curl -O soc-images/1.5.0_custom_develop_B3311/artifacts/host_files/sima_pcie_host_pkg.sh
chmod +x sima_pcie_host_pkg.sh
./sima_pcie_host_pkg.sh
Usageο
Example of usage:
SoC:
GST_DEBUG=2 gst-launch-1.0 simaaipciesrc ! simaaipciesink
Host:
GST_DEBUG=0 gst-launch-1.0 rtspsrc location=<RTSP_SRC> ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! video/x-raw,format=I420 ! pciehost queuedepth=8 fps=30 ! videoparse format=i420 width=1280 height=720 ! autovideoconvert ! autovideosink
Configurationο
No configuration needed for these plugins. Please use to gst-inspect-1.0
to get actual list of properties, available for these plugins.