From patchwork Fri Jul 28 12:33:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 9868661 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 82D1360382 for ; Fri, 28 Jul 2017 12:33:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D5F6288DE for ; Fri, 28 Jul 2017 12:33:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 723F8288D9; Fri, 28 Jul 2017 12:33:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08C91288DE for ; Fri, 28 Jul 2017 12:33:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751931AbdG1Mdf (ORCPT ); Fri, 28 Jul 2017 08:33:35 -0400 Received: from mout.gmx.net ([212.227.17.21]:59454 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751737AbdG1Mde (ORCPT ); Fri, 28 Jul 2017 08:33:34 -0400 Received: from axis700.grange ([87.78.105.5]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M6fXs-1dpadF0sb6-00wR1D for ; Fri, 28 Jul 2017 14:33:33 +0200 Received: from 200r.grange (200r.grange [192.168.1.16]) by axis700.grange (Postfix) with ESMTP id 35E0C8B116 for ; Fri, 28 Jul 2017 14:30:58 +0200 (CEST) Received: from lyakh (uid 1000) (envelope-from g.liakhovetski@gmx.de) id 803d60 by 200r.grange (DragonFly Mail Agent v0.9); Fri, 28 Jul 2017 14:33:25 +0200 From: Guennadi Liakhovetski To: linux-media@vger.kernel.org Cc: Laurent Pinchart , Hans Verkuil , Guennadi Liakhovetski Subject: [PATCH 2/6 v5] V4L: Add a UVC Metadata format Date: Fri, 28 Jul 2017 14:33:21 +0200 Message-Id: <1501245205-15802-3-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1501245205-15802-1-git-send-email-g.liakhovetski@gmx.de> References: <1501245205-15802-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V03:K0:rMtfzxaVI6WkTb62obWfKtPcmdDjsBx7VLvdyGWRDYgLmUoZYrO 57We3IiN6V6VCi2omgcSRFwlqc4zQIrrKp/tSSz3cCp70c6C0hueKbpaCw1ywjkSl9T1GcG G+5YBXAGT+eRyTK8+qn8JS8tJn9jPjZyTKsX7+f6U0F5m3Kq1jh6wEkBrPudTfWP3D4TNZ6 4Ps7T5NXuTC4yh+XlpdvQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:w0YJ7uxmV5Y=:tnIk2MGYz7F818BcjQokw/ yulV2+fqea9YGjbGzyiY/scLJ/UyBh2he6lpW2V6wo7fahFTWaEestcxq0kMvRMKMVHYXMb3p 3mkDKmv4cVURc2bY46e7DZ/5iEETVQQ+W/sKvvQZWoigcheBOBvNmXHkIDpigmPzjHaaxGsYs Zr/G90ReMsxrRuuLg6xS+rvExPK8qmS+0BfakCU2/Kq9iNM3abKK2hD744+EFy28bS9dURw6b sXsRBrWrafADhch0RREgwNfuheaDjMI4+7ZOuvykEIVgo3EFQ6WL6Y2ZgMily3bxrbfNSgA9I QpQNE+1liuiRwuHHcqFsyLbc22GY/tuKGl4tBCozzN4H8R165uk8XlHYkrlv1o+K8Esjc4V59 c+KWvPiolrBG5Lzjbre7FHNVMH2FmjrR8ph0YeAuu/cuUOb/0c+kM0Sl6T6xr2Ax+1JSiUTxn Xl7p3Y1vOJN0cI3Lilc1q6SWOIAiHqKRuUseqrDAGK+3Iail2fOF7yo93qQKIdJLTn+ofuXpX AgrGpWGk3oKoHrBjMB1wKc67ityodbtsexP8xie5jcF/HThDy9UYzRLJ/o7uDbGSGsYYvletm QFHRkdvrAZ7bpiNV0g3/PTTOwAQ1ykSiafrY2fMEhDCiownKCIU/CARQ== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a pixel format, used by the UVC driver to stream metadata. Signed-off-by: Guennadi Liakhovetski --- Documentation/media/uapi/v4l/meta-formats.rst | 1 + Documentation/media/uapi/v4l/pixfmt-meta-uvc.rst | 39 ++++++++++++++++++++++++ include/uapi/linux/videodev2.h | 1 + 3 files changed, 41 insertions(+) create mode 100644 Documentation/media/uapi/v4l/pixfmt-meta-uvc.rst diff --git a/Documentation/media/uapi/v4l/meta-formats.rst b/Documentation/media/uapi/v4l/meta-formats.rst index 01e24e3..1bb45a3f 100644 --- a/Documentation/media/uapi/v4l/meta-formats.rst +++ b/Documentation/media/uapi/v4l/meta-formats.rst @@ -14,3 +14,4 @@ These formats are used for the :ref:`metadata` interface only. pixfmt-meta-vsp1-hgo pixfmt-meta-vsp1-hgt + pixfmt-meta-uvc diff --git a/Documentation/media/uapi/v4l/pixfmt-meta-uvc.rst b/Documentation/media/uapi/v4l/pixfmt-meta-uvc.rst new file mode 100644 index 0000000..58f78cb --- /dev/null +++ b/Documentation/media/uapi/v4l/pixfmt-meta-uvc.rst @@ -0,0 +1,39 @@ +.. -*- coding: utf-8; mode: rst -*- + +.. _v4l2-meta-fmt-uvc: + +******************************* +V4L2_META_FMT_UVC ('UVCH') +******************************* + +UVC Payload Header Data + + +Description +=========== + +This format describes data, supplied by the UVC driver from metadata video +nodes. That data includes UVC Payload Header contents and auxiliary timing +information, required for precise interpretation of timestamps, contained in +those headers. Buffers, streamed via UVC metadata nodes, are composed of blocks +of variable length. Those blocks contain are described by struct uvc_meta_buf +and contain the following fields: + +.. flat-table:: UVC Metadata Block + :widths: 1 4 + :header-rows: 1 + :stub-columns: 0 + + * - Field + - Description + * - struct timespec ts; + - system timestamp, measured by the driver upon reception of the payload + * - __u16 sof; + - USB Frame Number, also obtained by the driver + * - :cspan:`1` *The rest is an exact copy of the payload header:* + * - __u8 length; + - length of the rest of the block, including this field + * - __u8 flags; + - Flags, indicating presence of other standard UVC fields + * - __u8 buf[]; + - The rest of the header, possibly including UVC PTS and SCR fields diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 45cf735..0aad91c 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -682,6 +682,7 @@ struct v4l2_pix_format { /* Meta-data formats */ #define V4L2_META_FMT_VSP1_HGO v4l2_fourcc('V', 'S', 'P', 'H') /* R-Car VSP1 1-D Histogram */ #define V4L2_META_FMT_VSP1_HGT v4l2_fourcc('V', 'S', 'P', 'T') /* R-Car VSP1 2-D Histogram */ +#define V4L2_META_FMT_UVC v4l2_fourcc('U', 'V', 'C', 'H') /* UVC Payload Header metadata */ /* priv field value to indicates that subsequent fields are valid. */ #define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe