Visual Formatter Configuration
Child elements of VisualFormatter root element
XML elements |
Attributes |
Content |
Number of occurrences |
Description |
Verbose/VB |
Immediate |
EMPTY |
0/1 |
Syntax that the driver uses to generate this XML file. By default, the driver uses the verbose syntax. |
Active/ACT |
Immediate |
EMPTY |
0/1 |
Controls the visual formatter operation. |
Decimation/D |
Immediate |
PCDATA |
0/1 |
Frame rate decimation control. One frame is capture every N frames. N is ranging from 1 to 150. Default value: 1. |
FormatYUV422/YUV422 |
|
EMPTY |
0/1 |
Pixel format of the formatted images. The default pixel format is YUV420PL. |
Scaling4CIF/S4CIF |
|
EMPTY |
0/1 |
Selects the resolution of the formatted image. The default resolution is 4CIF. |
SizeX/SX |
ReadOnly |
PCDATA |
0/1 |
Width of the encoded image, expressed in pixels. |
SizeY/SY |
ReadOnly |
PCDATA |
0/1 |
Height of the encoded image, expressed in pixels. |
MinBufferSize/MBS |
ReadOnly |
PCDATA |
0/1 |
Smallest buffer size required to store the whole image. |
BufferSizeAuto/BSA |
|
EMPTY |
0/1 |
The buffer size is automatically determined by the driver. This is the default setting. |
BufferSize/BS |
|
PCDATA |
0/1 |
Size, expressed in bytes, of one formatted video buffer. |
BufferCount/BC |
|
PCDATA |
0/1 |
Number of formatted video buffers. Default value: 3. |
BufferOffset/BO |
|
PCDATA |
0/1 |
Address offset of the first data. Default value: 0. |
PitchAuto/PA |
|
EMPTY |
0/1 |
The buffer pitch is determined automatically by the driver. |
Pitch/P |
|
PCDATA |
0/1 |
The buffer pitch, expressed in bytes. Applicable to packed pixel formats only. |
PitchY/PY |
|
PCDATA |
|
The buffer pitch, expressed in bytes of Y planes. Applicable to YUV planar pixel formats only. |
PitchU/PU |
|
PCDATA |
|
The buffer pitch, expressed in bytes of U planes. Applicable to YUV planar pixel formats only. |
PitchV/PV |
|
PCDATA |
|
The buffer pitch, expressed in bytes of V planes. Applicable to YUV planar pixel formats only. |
Buffer Pitch Settings
The buffer pitch can be set automatically or manually for all image formats.
The automatic mode is invoked with PitchAuto. This is the default setting.
In that mode, the pitch is calculated automatically as follows:
- For packed formats, the buffer pitch is the smallest number of bytes that contains one row of packed pixel data; actually:
number_of_pixel_columns * number_of_bytes_per_pixel - For planar formats, the buffer pitch of the planes Y, U, V is determined separately:
- PitchY = number_of_pixel_columns * number_of_bytes_per_Y
where number_of_bytes_per_Y = 1; the Y component uses a single byte for all the supported planar formats - PitchU = RoundUp16( (number_of_pixel_columns * number_of_bytes_per_C) / HDF )
- PitchV = RoundUp16( (number_of_pixel_columns * number_of_bytes_per_C) / HDF )
where number_of_bytes_per_C = 1; the U and V color component uses a single byte for all the supported planar formats
and where HDF = 2; the Horizontal Decimation factor of the U and V color components is 2 for all the supported planar formats
- PitchY = number_of_pixel_columns * number_of_bytes_per_Y
The manual mode is invoked with Pitch for packed formats or with PitchY, PitchU, PitchV for planar formats.
Buffer Size Settings
The buffer size can be set automatically or manually for all image formats independently and for both automatic and manual method of the buffer pitch settings.
The automatic mode is invoked with BufferSizeAuto. This is the default setting.
In that mode, the size is calculated automatically as follows
- For packed formats:
number_of_pixel_rows * Pitch - For planar formats, the buffer size is the sum of the minimal storage required for the 3 planes Y, U, and V:
- SizeY = number_of_pixel_rows * PitchY
- SizeU = (number_of_pixel_rows * PitchU) / VDecimFactor
- SizeV = (number_of_pixel_rows * PitchV) / VDecimFactor
where VDecimFactor = 1 for YUV422PL and 2 for YUV420PL formats
The manual mode is invoked with BufferSize.
MinBufferSize reports the minimum size needed to store the image. The calculation of MinBufferSize takes the size, pitches, offset and color format into account.
XML File Example
<root> /visual/source*/formatter/config.xml Read operation Verbose mode
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE VisualFormatter SYSTEM "config.dtd">
<VisualFormatter version="1.0">
<Verbose Immediate="true"/>
<Idle Immediate="true"/>
<Decimation Immediate="true">1</Decimation>
<FormatYUV420PL/>
<Scaling4CIF/>
<SizeX ReadOnly="true">704</SizeX>
<SizeY ReadOnly="true">576</SizeY>
<MinBufferSize ReadOnly="true">608256</MinBufferSize>
<BufferSizeAuto/>
<BufferCount>5</BufferCount>
<BufferOffset>0</BufferOffset>
<PitchAuto/>
</VisualFormatter>