Using the video overlay, Gpio device, Low-latency preview – Sensoray 2253 Linux User Manual
Page 13

Using the Video Overlay
The device can render graphic images overlaid the video output display. The
hardware overlay features 16-bits per-pixel color information and 3-bits
per-pixel transparency information. The device supports overlay images in
the PNG format and 24 or 32-bit BMP format. The device can draw multiple
lines of text and also supports line-drawing functions.
The device can render monochrome graphic images overlaid the video
capture or preview streams. Up to 8 graphic regions may be used at the same
time. Large regions should be avoided, as significant processing may caused
video frames to be dropped. The graphic is applied only to the luminance
channel of the image, and chrominance channel may tint the overlay graphic.
PNG or BMP images will be converted to monochrome.
The SDK overlay directory contains an overlay program to load overlay
images and a shell script overlay-demo.sh to load the sample images
provided. The shell script overlay-lines.sh will draw lines on the display.
The shell script overlay-text.sh will draw text on the display. The shell
script overlay-font.sh will use a font on the system to draw antialiased text
with outline/shadow and shaded background. The sample code overlay.c
shows how to format the drawing commands for the device.
See also S2253_VIDIOC_OVERLAY ioctl below describing data formats for line
drawing and text.
GPIO Device
The GPIO device is exposed as a Linux sysfs GPIO class. The directories
containing the device are under /sys/class/gpio/. Each board appears as a
gpiochipNNN subdirectory, containing a label file describing the board and
serial no: “S2253 SN123456”, and the base and ngpio files describing the
GPIO range used by the board. The base describes the first gpioNNN
subdirectory and the ngpio should be 2. The gpioNNN subdirectory contains
a direction file (indicating “in” or “out”) and the value file. An “in” GPIO can
be monitored by reading the value file, and an “out” GPIO can be modified by
writing a “1” or “0” to the value file.
A simpler method is also provided as a v4l2 control for the GPI and another
for GPO. See the API reference for S2253_CID_GPI and S2253_CID_GPO.
Low-Latency Preview
To activate lowest-latency preview, the stream format must be UYVY, width
704, height 480 for NTSC or 576 for PAL, interpolate mode disabled, image
flip disabled, and AAC encoder must not be in use. The low-latency mode is
used automatically when those criteria are met; there is no single switch that
selects low-latency mode. This mode bypasses the resizer and transfers
video data over USB as soon as it becomes available from the video port.
13