1*4882a593Smuzhiyun.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later 2*4882a593Smuzhiyun 3*4882a593Smuzhiyun.. _v4l2-meta-fmt-uvc: 4*4882a593Smuzhiyun 5*4882a593Smuzhiyun******************************* 6*4882a593SmuzhiyunV4L2_META_FMT_UVC ('UVCH') 7*4882a593Smuzhiyun******************************* 8*4882a593Smuzhiyun 9*4882a593SmuzhiyunUVC Payload Header Data 10*4882a593Smuzhiyun 11*4882a593Smuzhiyun 12*4882a593SmuzhiyunDescription 13*4882a593Smuzhiyun=========== 14*4882a593Smuzhiyun 15*4882a593SmuzhiyunThis format describes standard UVC metadata, extracted from UVC packet headers 16*4882a593Smuzhiyunand provided by the UVC driver through metadata video nodes. That data includes 17*4882a593Smuzhiyunexact copies of the standard part of UVC Payload Header contents and auxiliary 18*4882a593Smuzhiyuntiming information, required for precise interpretation of timestamps, contained 19*4882a593Smuzhiyunin those headers. See section "2.4.3.3 Video and Still Image Payload Headers" of 20*4882a593Smuzhiyunthe "UVC 1.5 Class specification" for details. 21*4882a593Smuzhiyun 22*4882a593SmuzhiyunEach UVC payload header can be between 2 and 12 bytes large. Buffers can 23*4882a593Smuzhiyuncontain multiple headers, if multiple such headers have been transmitted by the 24*4882a593Smuzhiyuncamera for the respective frame. However, the driver may drop headers when the 25*4882a593Smuzhiyunbuffer is full, when they contain no useful information (e.g. those without the 26*4882a593SmuzhiyunSCR field or with that field identical to the previous header), or generally to 27*4882a593Smuzhiyunperform rate limiting when the device sends a large number of headers. 28*4882a593Smuzhiyun 29*4882a593SmuzhiyunEach individual block contains the following fields: 30*4882a593Smuzhiyun 31*4882a593Smuzhiyun.. flat-table:: UVC Metadata Block 32*4882a593Smuzhiyun :widths: 1 4 33*4882a593Smuzhiyun :header-rows: 1 34*4882a593Smuzhiyun :stub-columns: 0 35*4882a593Smuzhiyun 36*4882a593Smuzhiyun * - Field 37*4882a593Smuzhiyun - Description 38*4882a593Smuzhiyun * - __u64 ts; 39*4882a593Smuzhiyun - system timestamp in host byte order, measured by the driver upon 40*4882a593Smuzhiyun reception of the payload 41*4882a593Smuzhiyun * - __u16 sof; 42*4882a593Smuzhiyun - USB Frame Number in host byte order, also obtained by the driver as 43*4882a593Smuzhiyun close as possible to the above timestamp to enable correlation between 44*4882a593Smuzhiyun them 45*4882a593Smuzhiyun * - :cspan:`1` *The rest is an exact copy of the UVC payload header:* 46*4882a593Smuzhiyun * - __u8 length; 47*4882a593Smuzhiyun - length of the rest of the block, including this field 48*4882a593Smuzhiyun * - __u8 flags; 49*4882a593Smuzhiyun - Flags, indicating presence of other standard UVC fields 50*4882a593Smuzhiyun * - __u8 buf[]; 51*4882a593Smuzhiyun - The rest of the header, possibly including UVC PTS and SCR fields 52