Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3105665imu; Sun, 27 Jan 2019 21:55:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN4TpZAl4N4HZRwcgEHLeOOl+zolYSOO56jW5yogk7XInvJWkqX9EW/F0y+mN236F1xncVBd X-Received: by 2002:a63:6704:: with SMTP id b4mr18741351pgc.100.1548654903972; Sun, 27 Jan 2019 21:55:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548654903; cv=none; d=google.com; s=arc-20160816; b=v76uyLAfbEunXX3UxQfU8Lj6I1KehHVIofLqxRFKFqRi/kSjkxL5QJiSMlLQj3aPd+ YptTNOaSb8VEHdmZGD1LX+PKSl68sgwWRWMxttd9ToU/WYYPCfQnmZqKRhz5pCWy51oy +9dIgWslu3K4Rzv4xg+90VoA7Xf5Xk23715X26rhgLf6J+tbh3IpzWhe+ebaY0JUWa1O LXYgARGcPHI4k+HEmInj3gn+opsO4wzF2a14Yfgxcha7U8q1hjXg3Fkzz9Pl6xVM/BCn C3Gt4/eXO8P7SDTa5GP2hthFgE9Pd107Dq3w0imjUZXeOHPKC8SuG3X1mqosxYPMxH6w TbGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=vFcdm97ZQVqY+sV8pPGkw6BS+L2oAzaBBnHbL8dP6qY=; b=H0dR6fJ5bWQZ2P74BnhXh8/l8O0s8jum8Fp09zceLz6EttJGq99bsYJZKVA1Pw5VpB yxFtgRkYSbr9DFYpC/oBl6lic6W/B1ctgHcNl1SdUzNsCyf82d4tE0wj6hS2+x9JmvU8 qUU22fd2IVP36WvGs6OLbuxXMvflEmCxrPBIZ853q2B65Wt5PBXseX9/TuuBy/+DQA0V Vi1WLA44m26Fkw9SMYmUZTT8XSnj+w8qqoAgmKc45t+qak+abuL9qDXCzT1Nlzml5l6U iPJKfrHOc9PTHU8UveQ4OeL5r2euQkCzVl8BDYmXl0+Dk3lgDLgccefGqBmNncCNXXBZ NXrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Uyoff7v8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v69si34851617pgb.3.2019.01.27.21.54.48; Sun, 27 Jan 2019 21:55:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Uyoff7v8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726612AbfA1Fyn (ORCPT + 99 others); Mon, 28 Jan 2019 00:54:43 -0500 Received: from mail-oi1-f195.google.com ([209.85.167.195]:43476 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725782AbfA1Fym (ORCPT ); Mon, 28 Jan 2019 00:54:42 -0500 Received: by mail-oi1-f195.google.com with SMTP id u18so12063175oie.10 for ; Sun, 27 Jan 2019 21:54:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vFcdm97ZQVqY+sV8pPGkw6BS+L2oAzaBBnHbL8dP6qY=; b=Uyoff7v8XzH8f5DxoBbglk0HZJLuF+9E8p7lxgKwVrvu5ZYWUGmCiADjNdzSzDki9M dn31m0DG6cwz/d8+NwWxZI5CL2SMMzbEKpvOXMMgXKMY14+ciHrdd9LNFavU5QXk+l0Q eMU36ihXXuctBaDC0u8ivl7W6QrPxSq8SdAYw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vFcdm97ZQVqY+sV8pPGkw6BS+L2oAzaBBnHbL8dP6qY=; b=pQX+Zp7qjeRFX7pWQdSRnlhIeua7mtgak4zMH4kg7+aSnhOmKGlHn/J/i8wCXmZ2dn SlKDT1kCVtcy4C0pyZYsyPvVI/x0oMjDDcRPj+zW59oWxZuW5ZuawgFATedrvDTMNUWu weM15t/4Kgy6ZpoKvineAgjxVYqSolUepExOYfJ65XOi+kizrCo5B2jmQ5qiiaeAELQX 7uBXoHpG8p5hWHCo9LB1Q8QqvTcBKO8trvGIrtdPllAt2mIKifbuM2sxySZT54GV8JCR ReIqRBkp8wF8ekRi4VXoVfcsU5H2beWYOWQEkeZngmRk1NBolL2HPdrU2SrA4yzhRs8h f/2A== X-Gm-Message-State: AJcUukcxOIuypbGTUwm1rKsKdRf7FsLtPibNPR8F0dQRxn8HnRklOT1N fI6teNfelbUTLq7j8eD+uPRCY9x110c= X-Received: by 2002:aca:1b13:: with SMTP id b19mr5013696oib.215.1548654881505; Sun, 27 Jan 2019 21:54:41 -0800 (PST) Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com. [209.85.167.178]) by smtp.gmail.com with ESMTPSA id 21sm4439292oie.24.2019.01.27.21.54.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Jan 2019 21:54:40 -0800 (PST) Received: by mail-oi1-f178.google.com with SMTP id t204so12073960oie.7 for ; Sun, 27 Jan 2019 21:54:39 -0800 (PST) X-Received: by 2002:a54:4486:: with SMTP id v6mr5215060oiv.233.1548654879619; Sun, 27 Jan 2019 21:54:39 -0800 (PST) MIME-Version: 1.0 References: <20181115145650.9827-1-maxime.ripard@bootlin.com> <20181115145650.9827-2-maxime.ripard@bootlin.com> In-Reply-To: <20181115145650.9827-2-maxime.ripard@bootlin.com> From: Alexandre Courbot Date: Mon, 28 Jan 2019 14:54:27 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/2] media: uapi: Add H264 low-level decoder API compound controls. To: Maxime Ripard Cc: Hans Verkuil , Sakari Ailus , Laurent Pinchart , Tomasz Figa , Pawel Osciak , Paul Kocialkowski , Chen-Yu Tsai , LKML , linux-arm-kernel@lists.infradead.org, Linux Media Mailing List , Nicolas Dufresne , jenskuske@gmail.com, linux-sunxi@googlegroups.com, Thomas Petazzoni , Guenter Roeck Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 15, 2018 at 11:56 PM Maxime Ripard wrote: > > From: Pawel Osciak > > Stateless video codecs will require both the H264 metadata and slices in > order to be able to decode frames. > > This introduces the definitions for a new pixel format for H264 slices that > have been parsed, as well as the structures used to pass the metadata from > the userspace to the kernel. > > Co-Developed-by: Maxime Ripard > Signed-off-by: Pawel Osciak > Signed-off-by: Guenter Roeck > Signed-off-by: Maxime Ripard > diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c > index b854cceb19dc..e96c453208e8 100644 > --- a/drivers/media/v4l2-core/v4l2-ctrls.c > +++ b/drivers/media/v4l2-core/v4l2-ctrls.c > @@ -825,6 +825,11 @@ const char *v4l2_ctrl_get_name(u32 id) > case V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER:return "H264 Number of HC Layers"; > case V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP: > return "H264 Set QP Value for HC Layers"; > + case V4L2_CID_MPEG_VIDEO_H264_SPS: return "H264 SPS"; > + case V4L2_CID_MPEG_VIDEO_H264_PPS: return "H264 PPS"; > + case V4L2_CID_MPEG_VIDEO_H264_SCALING_MATRIX: return "H264 Scaling Matrix"; > + case V4L2_CID_MPEG_VIDEO_H264_SLICE_PARAMS: return "H264 Slice Parameters"; > + case V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAMS: return "H264 Decode Parameters"; > case V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP: return "MPEG4 I-Frame QP Value"; > case V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP: return "MPEG4 P-Frame QP Value"; > case V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP: return "MPEG4 B-Frame QP Value"; To make things future-proof I think it may be good to add a control specifying the granularity of data sent with each request (see https://lkml.org/lkml/2019/1/24/147). Right now we have a consensus that to make things simple, we request one frame of encoded data per request. But this will probably be relaxed in the future, since allowing to process things at lower granularity may improve latency. Moreover the granularity accepted by the encoder is hardware/firmware dependent, so it is probably a good idea to expose this from the beginning. How about a new V4L2_CID_MPEG_VIDEO_H264_GRANULARITY control with only one value at the moment, namely V4L2_MPEG_VIDEO_H264_GRANULARITY_FRAME? We could extend this in the future, and that way user-space will have no excuse for not checking that the codec supports the input granularity it will send. I'm wondering whether this could be made codec-independent, but I'm afraid this would add confusion.