# qtivcomposer
Source: [https://docs.qualcomm.com/doc/80-70023-50/topic/qtivcomposer.html](https://docs.qualcomm.com/doc/80-70023-50/topic/qtivcomposer.html)
The qtivcomposer plugin uses the GPU hardware to merge/mix several input video
streams into a single output stream.
Note: In a live source setup using a qtivcomposer, long-duration
testing indicated that if input buffers don't arrive at the expected intervals, the
composer may produce duplicate output frames. When this duplication persists across
consecutive frames, it can create a visual impression that the video has frozen, even
though the buffers are continuously generated and processed. This behavior suggests that
the irregular buffer timing can disrupt normal frame generation which result in
misleading playback artifacts.
The pad properties determine the composition of the input buffers (for each stream) in
the output buffer.
The following table lists a few common pad properties of qtivcomposer. For
more information, see [Table : Pad properties of qtivcomposer](https://docs.qualcomm.com/doc/80-70023-50/topic/qtivcomposer.html#qtivcomposer__table_hzl_mcn_myb).
| Property | Usage |
| --- | --- |
| Position | Sets the X and Y axes placement of each input frame within the output. |
| Crop | Sets the optional crop for the source. |
| Dimensions | Upscales/downscales the frames. |
| Rotate | Rotates the frames at right angles |
|
Flip-horizontal
Flip-vertical
| Flips the frames horizontally and vertically. |
| Alpha | Adds the alpha blending value to the frames. |
| Z order | Changes the order of the frames. By default, the frames are organized in the order in which the sink pads are created. For example, sink\_0, and sink\_1. |
The figure shows the GStreamer pipeline using qtivcomposer that's working with several
video sources.
Figure : Pipeline with qtivcomposer
The video compositions include, but aren't limited to the following:
- Picture-in-picture
- Side-by-side
- Alpha blending
If no composition parameters and dimensions are specified in the [GstCaps](https://gstreamer.freedesktop.org/documentation/gstreamer/gstcaps.html) source pad, the output video frames
will have the same dimensions as the biggest incoming video stream.
Similarly, if the frame rate isn't set in GstCaps, it's taken from the stream with the
highest frame rate. And if output GstCaps doesn't have an explicitly set format, the
plugin negotiates the most common format based on the input streams.
The plugin uses the Qualcomm IB2C library or Qualcomm Computer Vision SDK for all the
transformation operations.
- The Qualcomm IB2C library is wrapped in the custom GstC2dVideoConverter or
GstGlesVideoConverter abstraction layer.
- It contains APIs to create, configure, and process the incoming and outgoing
buffers.
- The recommended plugin is GstGLESVideoConverter.
A custom buffer pool class called GstImageBufferPool allocates the output buffers.
GstImageBufferPool allocates either GBM or ION buffers:
- The GBM allocation is done through the 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) → [GstAggregator](https://gstreamer.freedesktop.org/documentation/base/gstaggregator.html?gi-language=c) → GstVideoComposer
The following tables provide information on pad templates and element properties of
qtivcomposer. For use cases, see [Video composition use cases](https://docs.qualcomm.com/doc/80-70023-50/topic/video-composition.html).
## Pad configuration
| Pad Name | Capabilities | Capabilities | Capabilities |
| --- | --- | --- | --- |
| SINK template: 'sink\_%u'