Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp122413ybs; Tue, 26 May 2020 05:20:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrOwOZxpssggvPK6VmvVxZ9By/4WEVeRLLKd2Yl0yoMx4+xuv66oAOjRknKGMvlkYflHuv X-Received: by 2002:a50:cb8a:: with SMTP id k10mr19780768edi.345.1590495627991; Tue, 26 May 2020 05:20:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590495627; cv=none; d=google.com; s=arc-20160816; b=blpQdCvsVICSZUOevWvLLKrU/KxY20qet2keo5COQoW9lDr3OwUhyZQjyk5wqGsbCw 9IkXFomv0Z6VN8JE+NJ56x7o8V0fy3Y8Aa4Wf0zRTTJzaCy/ZbBbdS9hbSk4QVcNIw/s dVS8NE2+ShBg9uUCIO/4poN9cCE+sZ1p/NLrMkJwSrH3Ew++Kzoliqd3wm89dC2KZpjx kAAOKiIjDsiKwPqhpQK1a6hSbqNgu5DMVA/9IUI9By9d0E/lpWsKh7jdFLsbJa946T5b yKcSDTbNm5HQPygSXkdbLlCeVxehqeCAxInQM0UE8cdy6HiuqW2PMzN/obBhJeOpTXOG Ykig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=podEtQJynn8vbkjGNeeC+JbB0UoOH6+FyCUK9sYUJn4=; b=z85hMaF9RllQ3CEAoNgB3KTcpc6oEy59scrucu0FawmN7YgrFgrHGhp5a4z9Mzztqz 0xqTdWaBR10LqzLptLZFQf6dgjjD+/SXEl26IvFoG/1cUlJw/7d0cg8IzsVN/ASDZRtF jAD5iZiJe41nKpz6Ushxzm0gVnDlSWgk8UbsnI1J5riWKvFaKkWNWIiCiu2b71oCwxKl jIyF9knxXj9i53Ur6lU01GNE4KUYcykcsc6QisCTi7eOkhHSyGEmbLsOhM5zvcpDmwOY BW1WPMy/LQIWRaFWCQL8IpAEdpTvmkcxZtbuExwdQVrmIEFIrtahoprFW12XyVHYjjDL gP2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Nr8rKuZk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 h6si10770749edl.221.2020.05.26.05.20.04; Tue, 26 May 2020 05:20:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=Nr8rKuZk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S1731562AbgEZIzB (ORCPT + 99 others); Tue, 26 May 2020 04:55:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726926AbgEZIzA (ORCPT ); Tue, 26 May 2020 04:55:00 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EB8DC03E97E for ; Tue, 26 May 2020 01:55:00 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id z5so22980106ejb.3 for ; Tue, 26 May 2020 01:55:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=podEtQJynn8vbkjGNeeC+JbB0UoOH6+FyCUK9sYUJn4=; b=Nr8rKuZkt8KweBOcyHo2g4Ujy7JjKujFluF3VELDXfSs/xdouAXDKFVDjpG0peqBwJ vRjDKWUDCpNHxl0J0bWwUyk4HsD2HNLQ5pEvOzhdI/BEUjSBg3tuYQima0+NTj3thyx+ vs04YQ4EKXsymFcN8+4s6v/nACegXCY9qTxHiogWscUrH8BeS0QeJ4Nm2m7+VTUa9mcH HUtMkkCzVi5MH+IT4QuOqO/yKXc0vJpIxx0hQ6/9OwlrUUvrtfcEZpOUlprfKktAe53t 1ODusxv6Wa0DkhYtVYcl3yPklUkW5c0Tr1PJsP0qdrmgOSPq8Irfu5KXfYa59ipV1K9C qYoQ== 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; bh=podEtQJynn8vbkjGNeeC+JbB0UoOH6+FyCUK9sYUJn4=; b=oJObTGbD6l6VbDQRRRPVjqAXi1TEbKDpOb0IKJjDSupiPD3x36MIouGiNaDqU0ZjEp i1gL+dxECVQnrVrQYbj662KwZtFVsotWqtSmM6tqVZ4seKbhKi1IUjjDVp72KbWVR0m6 QDYAyl9mU37YqQ/22BQ/A8t8tCJhQPpMOGBrVkJ1yLy38piQFPdCpR3g4L/r/eS9QLFQ BOyAW0BDPq6I10/bhTSRnyZzmQsB7pnw6V2ZXWJrSHqm5nx8IPaw+ux8sXbyEKFIWxNE cs3rFGxau1SaBSCuVAqnTjcxx90JZxqqJuWFa37sHaDfbiDXqeQV/gABBnjsKVzqrf8/ EBXQ== X-Gm-Message-State: AOAM530moYIjRtuoBC6W1voWWT6Sstn5+K0Cw/XSo6+9j5CIBOwfCito R20OM+ner32X2NhFZu+/zz9Hag== X-Received: by 2002:a17:906:1907:: with SMTP id a7mr188846eje.251.1590483298671; Tue, 26 May 2020 01:54:58 -0700 (PDT) Received: from localhost.localdomain (212-5-158-184.ip.btc-net.bg. [212.5.158.184]) by smtp.gmail.com with ESMTPSA id o21sm18134521edr.68.2020.05.26.01.54.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 01:54:57 -0700 (PDT) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Hans Verkuil , Philipp Zabel , Ezequiel Garcia , Paul Kocialkowski , Nicolas Dufresne , Tomasz Figa , Stanimir Varbanov Subject: [PATCH] v4l2-ctrl: add control for thumnails Date: Tue, 26 May 2020 11:54:46 +0300 Message-Id: <20200526085446.30956-1-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add v4l2 control for decoder thumbnail. Signed-off-by: Stanimir Varbanov --- Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst | 7 +++++++ drivers/media/v4l2-core/v4l2-ctrls.c | 2 ++ include/uapi/linux/v4l2-controls.h | 2 ++ 3 files changed, 11 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst index d0d506a444b1..e838e410651b 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst @@ -3726,6 +3726,13 @@ enum v4l2_mpeg_video_hevc_size_of_length_field - disables generating SPS and PPS at every IDR. Setting it to one enables generating SPS and PPS at every IDR. +``V4L2_CID_MPEG_VIDEO_DECODER_THUMBNAIL (button)`` + Instructs the decoder to produce immediate output. The decoder should + consume first input buffer for progressive stream (or first two buffers + for interlace). Decoder should not allocate more output buffers that it + is required to consume one input frame. Usually the decoder input + buffers will contain only I/IDR frames but it is not mandatory. + .. _v4l2-mpeg-hevc: ``V4L2_CID_MPEG_VIDEO_HEVC_SPS (struct)`` diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index b188577db40f..cb2554404c63 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -991,6 +991,7 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS: return "HEVC Slice Parameters"; case V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE: return "HEVC Decode Mode"; case V4L2_CID_MPEG_VIDEO_HEVC_START_CODE: return "HEVC Start Code"; + case V4L2_CID_MPEG_VIDEO_DECODER_THUMBNAIL: return "Thumbnail generation"; /* CAMERA controls */ /* Keep the order of the 'case's the same as in v4l2-controls.h! */ @@ -1234,6 +1235,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_AUTO_FOCUS_START: case V4L2_CID_AUTO_FOCUS_STOP: case V4L2_CID_DO_WHITE_BALANCE: + case V4L2_CID_MPEG_VIDEO_DECODER_THUMBNAIL: *type = V4L2_CTRL_TYPE_BUTTON; *flags |= V4L2_CTRL_FLAG_WRITE_ONLY | V4L2_CTRL_FLAG_EXECUTE_ON_WRITE; diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index 62271418c1be..7e44a2779863 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -743,6 +743,8 @@ enum v4l2_cid_mpeg_video_hevc_size_of_length_field { #define V4L2_CID_MPEG_VIDEO_REF_NUMBER_FOR_PFRAMES (V4L2_CID_MPEG_BASE + 643) #define V4L2_CID_MPEG_VIDEO_PREPEND_SPSPPS_TO_IDR (V4L2_CID_MPEG_BASE + 644) +#define V4L2_CID_MPEG_VIDEO_DECODER_THUMBNAIL (V4L2_CID_MPEG_BASE + 645) + /* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0) -- 2.17.1