# qtivsplit
Source: [https://docs.qualcomm.com/doc/80-70014-50/topic/qtivsplit.html](https://docs.qualcomm.com/doc/80-70014-50/topic/qtivsplit.html)
The qtivsplit plugin uses the GPU hardware to split a single input video stream into
multiple output streams whose number is a user-defined variable and is equal to the number
of source pads.
The mode property for each source pad determines the method for splitting the incoming
stream.
- In the *none* operational mode, incoming video frames on the sink pad are
duplicated on each of the source pads with additional color conversion and
upscale/downscale applied based on the negotiated [GstCaps](https://gstreamer.freedesktop.org/documentation/gstreamer/gstcaps.html) on that pad.
- When operating in the *single-roi-meta* mode, input video buffers are checked
for [GstVideoRegionOfInterestMeta](https://gstreamer.freedesktop.org/documentation/video/gstvideometa.html#GstVideoRegionOfInterestMeta).
Each such
meta entry in that [GstBuffer](https://gstreamer.freedesktop.org/documentation/gstreamer/gstbuffer.html#GstBuffer) is sent to its corresponding
source pad based on the ID and crop, upscale/downscale, and color conversion is
performed to match the negotiated [GstCaps](https://gstreamer.freedesktop.org/documentation/gstreamer/gstcaps.html).
Source pads with no
corresponding ROI meta produce GAP buffers.
In *single-roi-meta* mode, ensure that when source pads are created, their number is
equal to the maximum expected count of [GstVideoRegionOfInterestMeta](https://gstreamer.freedesktop.org/documentation/video/gstvideometa.html#GstVideoRegionOfInterestMeta) inside a single
[GstBuffer](https://gstreamer.freedesktop.org/documentation/gstreamer/gstbuffer.html#GstBuffer). If their source pads are fewer, the
ROI meta that does not have a corresponding pad is ignored.
The last ROI based mode is called *batch-roi-meta*. It operates the [GstVideoRegionOfInterestMeta](https://gstreamer.freedesktop.org/documentation/video/gstvideometa.html#GstVideoRegionOfInterestMeta) entries attached
to the buffer but instead of sending one such entry, it sends all the meta entries on
the pad(s) in that mode as separate buffers.
The plugin uses QTI IB2C library or Qualcomm Computer Vision SDK for all the
transformation operations. This library is wrapped inside the custom
GstC2dVideoConverter or GstGlesVideoConverter abstraction layer respectively with APIs
to create, configure, and process the incoming and outgoing buffers.
## Buffer management
Figure : Gstreamer pipeline with qtivsplit

Figure : qtivsplit - buffer management

The GstImageBufferPool custom buffer pool class allocates either GBM or ION output
buffers depending on the negotiated capabilities between GstImageBufferPool and
downstream plugins.
- The GBM allocation is done through Qualcomm libgbm.
- The ION allocation is done through IOCTL commands to the kernel.
## Inheritance chain
[GObject](https://docs.gtk.org/gobject/) → [GstObject](https://gstreamer.freedesktop.org/documentation/gstreamer/gstobject.html?gi-language=c) → [GstElement](https://gstreamer.freedesktop.org/documentation/gstreamer/gstelement.html?gi-language=c) → GstVideoSplit
The following tables provide information on pad templates and element properties of
qtivsplit. For use cases, see the following:
- For use case on splitting video into multiple streams, see [Video split use cases](https://docs.qualcomm.com/doc/80-70014-50/topic/video-split-use-cases.html).
- For use case on dynamic cropping, see [Daisy chain detection and classification](https://docs.qualcomm.com/doc/80-70014-50/topic/daisy-chain-detection-and-classification.html).
## Pad configuration
| Pad Name | Capabilities | Capabilities | Capabilities |
| --- | --- | --- | --- |
| SINK template: 'sink'
Enum "GstVideoSplitMode" Default: 0, "none"