V4L2 JPEG header related functions and data structures
struct v4l2_jpeg_reference #
reference into the JPEG buffer
Definition
;
Members
start: pointer to the start of the referenced segment or tablelength: size of the referenced segment or table
Description
Wnen referencing marker segments, start points right after the marker code, and length is the size of the segment parameters, excluding the marker code.
struct v4l2_jpeg_frame_component_spec #
frame component-specification
Definition
;
Members
component_identifier: C[i]horizontal_sampling_factor: H[i]vertical_sampling_factor: V[i]quantization_table_selector: quantization table destination selector Tq[i]
struct v4l2_jpeg_frame_header #
JPEG frame header
Definition
;
Members
height: Ywidth: Xprecision: Pnum_components: Nfcomponent: component-specification, see v4l2_jpeg_frame_component_specsubsampling: decoded subsampling from component-specification
struct v4l2_jpeg_scan_component_spec #
scan component-specification
Definition
;
Members
component_selector: Cs[j]dc_entropy_coding_table_selector: Td[j]ac_entropy_coding_table_selector: Ta[j]
struct v4l2_jpeg_scan_header #
JPEG scan header
Definition
;
Members
num_components: Nscomponent: component-specification, see v4l2_jpeg_scan_component_spec
enum v4l2_jpeg_app14_tf #
APP14 transform flag According to Rec. ITU-T T.872 (06/2012) 6.5.3 APP14 segment is for color encoding, it contains a transform flag, which may have values of 0, 1 and 2 and are interpreted as follows:
Constants
V4L2_JPEG_APP14_TF_CMYK_RGB: CMYK for images encoded with four components RGB for images encoded with three componentsV4L2_JPEG_APP14_TF_YCBCR: an image encoded with three components using YCbCrV4L2_JPEG_APP14_TF_YCCK: an image encoded with four components using YCCKV4L2_JPEG_APP14_TF_UNKNOWN: indicate app14 is not present
struct v4l2_jpeg_header #
parsed JPEG header
Definition
;
Members
sof: pointer to frame header and sizesos: pointer to scan header and sizenum_dht: number of entries in dhtdht: pointers to huffman tables and sizesnum_dqt: number of entries in dqtdqt: pointers to quantization tables and sizesframe: parsed frame headerscan: pointer to parsed scan header, optionalquantization_tables: references to four quantization tables, optionalhuffman_tables: references to four Huffman tables in DC0, DC1, AC0, AC1 order, optionalrestart_interval: number of MCU per restart interval, Riecs_offset: buffer offset in bytes to the entropy coded segmentapp14_tf: transform flag from app14 data
Description
When this structure is passed to v4l2_jpeg_parse_header, the optional scan, quantization_tables, and huffman_tables pointers must be initialized to NULL or point at valid memory.
v4l2_jpeg_parse_header() #
int locate marker segments and optionally parse headers
Parameters
void *buf: address of the JPEG buffer, should start with a SOI markersize_t len: length of the JPEG bufferstruct v4l2_jpeg_header *out: returns marker segment positions and optionally parsed headers
Description
The out->scan_header pointer must be initialized to NULL or point to a valid v4l2_jpeg_scan_header structure. The out->huffman_tables and out->quantization_tables pointers must be initialized to NULL or point to a valid array of 4 v4l2_jpeg_reference structures each.
Returns 0 or negative error if parsing failed.