S2253_vidioc_set_user_data – Sensoray 2253 Linux User Manual
Page 24

width=720
argb=0
Text is drawn using overlay image data in the following format:
4 bytes: "text"
4 bytes: argb color
remaining bytes: text
NOTE: The “line” and “text” formats are not supported for Stream 1 and 2.
Recommend using the the monochrome graphic overlay instead.
Monochrome graphic overlay uses the following format:
4 bytes: “RLE “
2 bytes: width
2 bytes: height
2 bytes: rgb565 color (only used on output display)
remaining bytes: run-length encoded image data
bits 7..4: drawing mode
0: transparent
1..6: background shaded to black
7..15: opaque black to white
bits 3..0: run length in pixels
when 0, next byte contains run length + 16
The user application may render text or lines into a RGBA buffer and use the
functions in overlay.c to encode the RLE data.
S2253_VIDIOC_SET_USER_DATA
int ioctl(int fd, int request, struct s2253_user_data *data);
struct s2253_user_data {
char *data;
/* data to be inserted in the stream */
int len;
/* length of the data */
int interval;
/* 0=insert once per ioctl,
otherwise every Nth frame */
};
User data is inserted in the MPEG-4 or H.264 stream, once or at a specified
frame interval. Up to 1024 bytes may be inserted per frame. User data may
NOT contain MPEG start codes, which means there may not be more than 23
consecutive zero bits in the data. This function will not check for start codes.
It is recommended, therefore to separate the data; for instance, if you want
to store a 32 bit (4 byte) latitude position in the stream, you could put the
high order bytes in the first 2 bytes of user data, followed by a “marker byte”
of 0xff, and put the other 2 bytes in the next 2 user data bytes. Eg. For a
24