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.

Contributing

License

Acknowledgments