Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp293305imw; Mon, 4 Jul 2022 09:16:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s5cOsLjXMACAwvKVog4NblBl7bC+oxAEzrALwo0Bdnsa7PTyM0aCq0uzm+ZTkK/eneeMS4 X-Received: by 2002:a17:902:f804:b0:16a:da1:1ef7 with SMTP id ix4-20020a170902f80400b0016a0da11ef7mr36221246plb.17.1656951415681; Mon, 04 Jul 2022 09:16:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656951415; cv=none; d=google.com; s=arc-20160816; b=WjxbEHYCSXu6BZmi7P6viyJg6ez+LrRclFA/sNR+bcPhjmQRpQd17ka3faYdZAuDqP 7oya33SC3mYkwPK2tt++eNNN99yUICdaNhGb0OegBJ8SpZPHtTQzbh8zA1/P6c82zkhB pJoCX0qoW+BszXi5VmfGT2x5t2ZsiCJWLzyGTqrCIzgBT1DtjWbds1MyuT7qLfwTyj7R 8HdmbCFftw+KD16QlBzyoEjpwjGJ2tLIFfj7K4qbzAqubq4jrwmt/FzhpANZYwqLK23j OA7eGRe474qqvPe7iKGsllXCg0HQmnPivCOVnRg/r7EDiOtQP1SDlsIIcmVEL8YfxnYJ V3Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=kkQHz0ww2YIQVgHTYO/Cd9qN+mZ6MqLTHtoC/Ua9CeY=; b=kZkcnQ/3RZtFJDNjUn+IKRMIuxbwoWVAVBShGSyehElC8saMIhBMjSta0rkLkkYgT7 aghB1AarJ4Km34mNFPsdrALvbxDLvCgcCQ2cdKwMeptu/beZnCI76bvZah3tdWaNinsM ddyqzB3tF/zStbItnaH/EH6kX55yc96nfqakSiCLy0JWWw8rIgE3pSqdA38DlU7zPviu TesQshwAInBpqZJtp/XU3DRfXTWNVJGkj1LEtoN+eRGLf6V0E2M4RfttL9v18bQUIGsA i6Z1UNd5Tal8qq6vsg5thc4bv0h4WcSocy+6BD+inH7eh1L0pHp8uAXAfJ4WC98AtYJd QZfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ndufresne-ca.20210112.gappssmtp.com header.s=20210112 header.b=ehC1GyWq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p14-20020a170902780e00b0016a22069bd2si14546497pll.104.2022.07.04.09.16.43; Mon, 04 Jul 2022 09:16:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ndufresne-ca.20210112.gappssmtp.com header.s=20210112 header.b=ehC1GyWq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234205AbiGDPw7 (ORCPT + 99 others); Mon, 4 Jul 2022 11:52:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230338AbiGDPw5 (ORCPT ); Mon, 4 Jul 2022 11:52:57 -0400 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7C6D38B6 for ; Mon, 4 Jul 2022 08:52:56 -0700 (PDT) Received: by mail-qk1-x733.google.com with SMTP id b24so7041145qkn.4 for ; Mon, 04 Jul 2022 08:52:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ndufresne-ca.20210112.gappssmtp.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-transfer-encoding:user-agent:mime-version; bh=kkQHz0ww2YIQVgHTYO/Cd9qN+mZ6MqLTHtoC/Ua9CeY=; b=ehC1GyWqhnzkt9U0tqD6vVyGrcf56JWE7mryGu6QPm6FIcy5fJx4gqLCQNjLM6yGuC X+ARQkvMHpvIw019++6sbedvfDIw7MMZh0HOMSQFVUrT9O75aF7VMHLxjUwSmhPw7Kt5 67WpLmcBVjC00M9zuwdRwFF8hbZVsig/KxvRc1GgRGwvHu+BihBn4FPrHU/0fMMc8NSJ yQ0FjQfshGdL85pQogx/1nhSPDWezITV4udAUiZjQV2AEgFJyXXNsd2h6f7l3bCdQcEn nSwIQ+8S+yZAgzKqZyrUAqtY163R0tk93E6LuncfSRoBDtynJO0FUScgwq3cdHqkbXEJ vrAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-transfer-encoding:user-agent:mime-version; bh=kkQHz0ww2YIQVgHTYO/Cd9qN+mZ6MqLTHtoC/Ua9CeY=; b=DGNak6FfOnfy8Cy7lwxeg/5CXO4bzrqOD+6oWbQDpkSg7JVhJLl05EdvYBsWpn7Wzk lyQUorFpj06laI3wVd2Ghu37/tNKVqAP9B1sZnQ8cdcbthMsv5pUM0CqFneD5L7yGpBR NVg21l4QzbkICZDko1ArWZSd6Hyh64iXJddiqmNeOjupj8DnSjCpakx+zryA8obW9IFe hqPmzh3WuyA4LY7fK4sxZHNVWUTngvZHJhKn+btj1CDMlnE6H71Bhgku4+sD9ZPDui3q iogiI7PI3QVAvorMa3EMAySDttaNZtkITkyVbVxoOtmOogznwwKFB9uMJSWRiw3FqeSc 7vrg== X-Gm-Message-State: AJIora+myIPpuQ/zDB+9BgWo3uKmVjlormjJABPKhnE7k1DbopyAisY0 cLy7fSSfPytsAT2EW0RZeIyZZw== X-Received: by 2002:ae9:ec19:0:b0:6ae:e43b:80ff with SMTP id h25-20020ae9ec19000000b006aee43b80ffmr20513084qkg.324.1656949975812; Mon, 04 Jul 2022 08:52:55 -0700 (PDT) Received: from nicolas-tpx395.localdomain (mtl.collabora.ca. [66.171.169.34]) by smtp.gmail.com with ESMTPSA id do56-20020a05620a2b3800b006a684c87f4bsm9808338qkb.68.2022.07.04.08.52.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jul 2022 08:52:55 -0700 (PDT) Message-ID: Subject: Re: [PATCH] media: videobuf2: add V4L2_BUF_FLAG_CODECCONFIG flag From: Nicolas Dufresne To: Ming Qian , mchehab@kernel.org, hverkuil-cisco@xs4all.nl Cc: shawnguo@kernel.org, robh+dt@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Date: Mon, 04 Jul 2022 11:52:54 -0400 In-Reply-To: <20220628021909.14620-1-ming.qian@nxp.com> References: <20220628021909.14620-1-ming.qian@nxp.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.2 (3.44.2-1.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le mardi 28 juin 2022 =C3=A0 10:19 +0800, Ming Qian a =C3=A9crit=C2=A0: > By setting the V4L2_BUF_FLAG_CODECCONFIG flag, > user-space should be able to hint decoder > the vb2 only contains codec config header, > but does not contain any frame data. > It's only used for parsing header, and can't be decoded. This is copied from OMX specification. I think we we import this, we should= at least refer to the original. >=20 > Current, it's usually used by android. >=20 > Signed-off-by: Ming Qian > --- > Documentation/userspace-api/media/v4l/buffer.rst | 9 +++++++++ > include/uapi/linux/videodev2.h | 2 ++ > 2 files changed, 11 insertions(+) >=20 > diff --git a/Documentation/userspace-api/media/v4l/buffer.rst b/Documenta= tion/userspace-api/media/v4l/buffer.rst > index 4638ec64db00..acdc4556f4f4 100644 > --- a/Documentation/userspace-api/media/v4l/buffer.rst > +++ b/Documentation/userspace-api/media/v4l/buffer.rst > @@ -607,6 +607,15 @@ Buffer Flags > the format. Any subsequent call to the > :ref:`VIDIOC_DQBUF ` ioctl will not block anymore, > but return an ``EPIPE`` error code. > + * .. _`V4L2-BUF-FLAG-CODECCONFIG`: > + > + - ``V4L2_BUF_FLAG_CODECCONFIG`` > + - 0x00200000 > + - This flag may be set when the buffer only contains codec config > + header, but does not contain any frame data. Usually the codec confi= g > + header is merged to the next idr frame, with the flag > + ``V4L2_BUF_FLAG_KEYFRAME``, but there is still some scenes that will > + split the header and queue it separately. I think the documentation is clear. Now, if a driver uses this, will existi= ng userland (perhaps good to check GStreamer, FFMPEG and Chromium ?) will brea= k ? So we need existing driver to do this when flagged to, and just copy/append= when the userland didn't opt-in that feature ? > * .. _`V4L2-BUF-FLAG-REQUEST-FD`: > =20 > - ``V4L2_BUF_FLAG_REQUEST_FD`` > diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev= 2.h > index 5311ac4fde35..8708ef257710 100644 > --- a/include/uapi/linux/videodev2.h > +++ b/include/uapi/linux/videodev2.h > @@ -1131,6 +1131,8 @@ static inline __u64 v4l2_timeval_to_ns(const struct= timeval *tv) > #define V4L2_BUF_FLAG_TSTAMP_SRC_SOE 0x00010000 > /* mem2mem encoder/decoder */ > #define V4L2_BUF_FLAG_LAST 0x00100000 > +/* Buffer only contains codec header */ > +#define V4L2_BUF_FLAG_CODECCONFIG 0x00200000 > /* request_fd is valid */ > #define V4L2_BUF_FLAG_REQUEST_FD 0x00800000 > =20