From patchwork Sun Dec 6 10:27:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 338813 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp1914717jai; Sun, 6 Dec 2020 02:30:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGuH+riLxJnS3JKVjghxMnT6VKMBpOkBfV5ygJQh5NS6ykMjfPGrd3WAePvFSC1k2lYefR X-Received: by 2002:a17:906:edca:: with SMTP id sb10mr14866856ejb.284.1607250613593; Sun, 06 Dec 2020 02:30:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607250613; cv=none; d=google.com; s=arc-20160816; b=uYl6Joak0JVv0JeezycyoM1PDfL8CPepytV5tKzdWqhfoQCsqmKrqBQknTul+1QLso TmfvpzjWZzrDxQPxoCbbamQB0glIXMc9weSoJevByWicu2CnbnXxCHcfr2nFbFYaI5NX mdwmKpO5OlskUENxEL3lZoWksnt0dDWW88wtBqqlrSA6Li+4Fdxijyx0LJCgWul1opw6 +NxFcw+y3hBrPZRwokZexDOq2tRv+i+kyLOV31DJdbFTq7uJWzJKHMe16w5lCz0TDRx2 L22s2VPEl7UUW4tLOq1EVJJaX4PTtQqQLnVFAuzCF7rWdt0+7rXr5KcbnIvkUxNXAKG0 0lXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=Ev1MHxyFPvBX0WX6Ak+7DquMzfw9EA0IgRW7BFvB0WA=; b=aazFs83iOEBGnpzq9hEiWEzL3AI8cv0us3FEojULpsgSSmbpN6ZsMo3sdL6XROzFVL gfMImuxafw18pAHQyz8DNqCdndOg7bx8n8UD3twfVoLMnqZ39fqIE/fk0mF2fS43ZiQC mnBzHbNG04SGJmxEodb8uLp+ja9wTDw1X50v+mb+eWAI2DWaAz6hCK1A/vAxaxm28oCX eHevpENStE01ELoaRhDtH16G2Gt8tcfrdHOUCwUZtkWEUpqQH9NSfDjnjVuh9QNWyXE/ xRE7ar1smkUzHMEiB0iQozPpaIhA4iOSXRAWdsPI7vHvngLsRrawLhqGnPU14FvkBTyS A1sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ME76Cvki; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t8si6254944edj.6.2020.12.06.02.30.13; Sun, 06 Dec 2020 02:30:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ME76Cvki; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727352AbgLFK3C (ORCPT + 15 others); Sun, 6 Dec 2020 05:29:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726828AbgLFK3B (ORCPT ); Sun, 6 Dec 2020 05:29:01 -0500 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7A2EC08C5F2 for ; Sun, 6 Dec 2020 02:27:45 -0800 (PST) Received: by mail-ed1-x543.google.com with SMTP id v22so10500130edt.9 for ; Sun, 06 Dec 2020 02:27:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ev1MHxyFPvBX0WX6Ak+7DquMzfw9EA0IgRW7BFvB0WA=; b=ME76Cvki8Wg7HJJsM1H5BTjuHkZPvd1rbNN3qn+fVxrix7lY36ASFmvzHNmmdhBfYP /36KO/rlPLry+e0XReyIaDvk7L8/O5FPd4oHsvVty31ETk5ppo5wrgKMiUsxVBC8yav+ hc4UZo+TGVkPWKXsChhfLrninN2xFTZRe6y1sitUkaryPjRNGIV2Q7cyAMcQAAqefuJ2 fgOnKhe+RK5+91V5Qln3w1bomGPSXtNC2Ud5AdEye6V+1fufhJn9i7cIHnJ4UwYIfIPa wkfBR5jtdkrpZ/8siQN8H57GnxdVLhT2l/wOYgvIBcT5IxzLdhFivL3KMqniEoZI9A+T OecQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ev1MHxyFPvBX0WX6Ak+7DquMzfw9EA0IgRW7BFvB0WA=; b=EhNNL74uY6GVXgyw16I7BxRTE5nEMF6PItN30qPawKd4wuCklpLN9A7C8HbtSGSWfp 8GwyCLMFqgyMaZNJPARTN82fJpVY4i2s5WMlYE5OtYD8szBh7PJvCcXxoOSLfucfXFyf TjKFyWebEgY45r4tATI4p0AhUFaMsYpRGSaL9Fsl4B+QtF78LQwsPv15K690PMthVVev /XAOJba4E/m4KvSqCCeyTPKOUh3xX+SxKynTBBrS7xU14NeBAiERHC90EU3Klx3UXXds y2E7dzG4/FHF+mfAIoS8mNmulQn5Q34LG8Mh+e7lR2QpE5kuPGKfhyWRzVVZpqGRe9nn VOGg== X-Gm-Message-State: AOAM531e3MJHh9kNfC9zaQYPSRgqN+/cnNzLrUs28kfs2Xf2baV9bOfo kiq/6ruE0Vcmd3Uvql3X0WMOHA== X-Received: by 2002:a50:a6c9:: with SMTP id f9mr15257142edc.158.1607250464686; Sun, 06 Dec 2020 02:27:44 -0800 (PST) Received: from localhost.localdomain (hst-221-17.medicom.bg. [84.238.221.17]) by smtp.gmail.com with ESMTPSA id d4sm8464736edq.36.2020.12.06.02.27.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Dec 2020 02:27:44 -0800 (PST) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Ezequiel Garcia , Nicolas Dufresne , Maheshwar Ajja , Hans Verkuil , Stanimir Varbanov Subject: [PATCH v2 3/4] media: v4l2-ctrls: Add control for AUD generation Date: Sun, 6 Dec 2020 12:27:16 +0200 Message-Id: <20201206102717.19000-4-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201206102717.19000-1-stanimir.varbanov@linaro.org> References: <20201206102717.19000-1-stanimir.varbanov@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add a control to enable inserting of AUD NALU into encoded bitstream. Signed-off-by: Stanimir Varbanov --- Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst | 5 +++++ drivers/media/v4l2-core/v4l2-ctrls.c | 2 ++ include/uapi/linux/v4l2-controls.h | 1 + 3 files changed, 8 insertions(+) -- 2.17.1 Reviewed-by: Hans Verkuil diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst index d65d7c1381b7..32eb233ee089 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst @@ -679,6 +679,11 @@ enum v4l2_mpeg_video_frame_skip_mode - otherwise the decoder expects a single frame in per buffer. Applicable to the decoder, all codecs. +``V4L2_CID_MPEG_VIDEO_AU_DELIMITER (boolean)`` + If enabled then, AUD (Access Unit Delimiter) NALUs will be generated. + That could be useful to find the start of a frame without having to + fully parse each NALU. Applicable to the H264 and HEVC encoders. + ``V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (boolean)`` Enable writing sample aspect ratio in the Video Usability Information. Applicable to the H264 encoder. diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index ac44848d2d6e..ea2de8b51e29 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -875,6 +875,7 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_MPEG_VIDEO_HEADER_MODE: return "Sequence Header Mode"; case V4L2_CID_MPEG_VIDEO_MAX_REF_PIC: return "Max Number of Reference Pics"; case V4L2_CID_MPEG_VIDEO_FRAME_SKIP_MODE: return "Frame Skip Mode"; + case V4L2_CID_MPEG_VIDEO_AU_DELIMITER: return "Generate Access Unit Delimiters"; case V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP: return "H263 I-Frame QP Value"; case V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP: return "H263 P-Frame QP Value"; case V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP: return "H263 B-Frame QP Value"; @@ -1232,6 +1233,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE: case V4L2_CID_MPEG_VIDEO_MPEG4_QPEL: case V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER: + case V4L2_CID_MPEG_VIDEO_AU_DELIMITER: case V4L2_CID_WIDE_DYNAMIC_RANGE: case V4L2_CID_IMAGE_STABILIZATION: case V4L2_CID_RDS_RECEPTION: diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index 54b9072ac49d..1fb1a3ba3985 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -423,6 +423,7 @@ enum v4l2_mpeg_video_multi_slice_mode { #define V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE (V4L2_CID_CODEC_BASE+228) #define V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME (V4L2_CID_CODEC_BASE+229) #define V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD (V4L2_CID_CODEC_BASE+230) +#define V4L2_CID_MPEG_VIDEO_AU_DELIMITER (V4L2_CID_CODEC_BASE+231) /* CIDs for the MPEG-2 Part 2 (H.262) codec */ #define V4L2_CID_MPEG_VIDEO_MPEG2_LEVEL (V4L2_CID_CODEC_BASE+270)