Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1174473ybg; Thu, 4 Jun 2020 03:03:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdntvi67BJeCze45QxkqyiafFlivSs20IHe7lmHzF480fEhV3Jg2OoX/iAgMTploYCUu2h X-Received: by 2002:a50:d490:: with SMTP id s16mr3430130edi.242.1591265005143; Thu, 04 Jun 2020 03:03:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591265005; cv=none; d=google.com; s=arc-20160816; b=qaoUNbfVhLIS5J5j37HGj17yxzoQ2vUDjqS5Sw0ocIQnC0Z75Lb19BYLIIs7UgwnsX zG0vdU5RNtk9YzQ4GPSinvJih11joIu38K0PFaTFN1TpIF5mZEnih2IhCVR3yJ8jzt/T ADNREgJycepx0MqxqmcUCSoLAODwIUH0yNbukfo2rGFKs1K2GJkmv9DnMOKyn463qE1V 5g6rlkD6+qc2KJB+Jm+osii99MO4kJSZb0LG3HZUVHjURYkS0Hpoo9YVyZfZ8BASzkHP OZND6TGxDUItWSxTInESyhdOEL2vZrdITbgqZ9/qh+IHiCVfHuVzuU60+i7ZPikEvYyW 65UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:dkim-signature; bh=hHof+p3C9Md136JQ7k0tl8hMmspaaFCEsQhKQBHmNxA=; b=e7frUZo77gX/GursAaN6Cw/illX2Kda4QE23cZGmHK/M14yb0NDwj7K5Ku3zYxFzDb K+gQXsen1rgIcXD+1G4MaCIozDEQhMsr9K25m+PFV2eXNrFmqU9WUmBewtBCfEQA9yAF OHDPi13fu46SIXWUxa6GSUenGg4MpNFRq63gGKt837/2f8MiYLVlontD0IM1nxRzJRVQ Tsc1/HfmqHDvYkASKkT/p3+NNzoLCUNMWUgpSuQmS0ezeSe4pCfr8xRdS/KkagHByN6m jxL5Qdkzkj/lyDaF43R/8I7mVist8QVt0XP3fQ/oUDlsWFZzGm2q+6N3/mejJ1hDjVau Oxsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p1RLJkFH; 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 b18si1345378edx.581.2020.06.04.03.03.01; Thu, 04 Jun 2020 03:03:25 -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=p1RLJkFH; 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 S1728403AbgFDJCr (ORCPT + 99 others); Thu, 4 Jun 2020 05:02:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728089AbgFDJCq (ORCPT ); Thu, 4 Jun 2020 05:02:46 -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 97EF0C03E96E for ; Thu, 4 Jun 2020 02:02:46 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id y13so5243362eju.2 for ; Thu, 04 Jun 2020 02:02:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=hHof+p3C9Md136JQ7k0tl8hMmspaaFCEsQhKQBHmNxA=; b=p1RLJkFHX+/HAaWtEy3jwsTfPtsNiJliZpFxTrV1XyeKjW6c+81N5TFAVnh6b9eAUz 1jWiOzZBl9rVUsnqfcwlgM80fjmLjwZLhpOMjlH8Xwr+lIx4p8FvCKMk7EMGSiBE1ZTu A/1zi/2qERY0KAaorMMvNhuDbklge4kwZ1/mrDweImSwz9dFh9KTjtNMJh7UlIicpjhm G7viBE1GVTYYXxOz5KFnKImb03jUw45EXUrtQwO18cQ7C70e+BiXsjBXL065BXKh8mhs 7Qu51pm3knq8tG30mIZjKZtSMOMGlGYqIxd9WeAdOYJN2qShg9dZ0QETGacpX92pOqQG g6kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=hHof+p3C9Md136JQ7k0tl8hMmspaaFCEsQhKQBHmNxA=; b=G507xFkhaHcvmljn6xglvRbaptXE5LaSKLoONx6ibchl91eg12xnaHgdA7XK/RLRY3 g6+KTF6RnoAN/p5Wkoc8eIbci0TCrxnFm3zf3gHXcBJM7EYQEDzYsMskFGuyljRLirgI qUy4KfiELzyA4z89mXMQx5XJDLCo5Wenj6pjO6DQ8qqmg6TTFDpHLT/nlRS3c4O6IghG fgb2tJtQ8xtQzxeWgLBlgESwjzg4CFz6prZB2xGuCHrzrFwnG9Tm1B6Swh/gNcY+PP7r MEb1iPzw7yw4Pd7fKuLOhKBkeRwUM1LOvUK4ca1/lFDP7XOaaIDSB+pYMeGswH5omSx/ nyog== X-Gm-Message-State: AOAM533bAk3lvTk543xEx5ZWCSjtR/iMhsL8Tb1g3MiX8rPo+f8ymVf7 l8SmyASX5liWuszJM1/YxZCUw+tUq1Socw== X-Received: by 2002:a17:906:69d1:: with SMTP id g17mr2840858ejs.521.1591261365181; Thu, 04 Jun 2020 02:02:45 -0700 (PDT) Received: from [192.168.1.4] (212-5-158-209.ip.btc-net.bg. [212.5.158.209]) by smtp.googlemail.com with ESMTPSA id gt26sm1592670ejb.107.2020.06.04.02.02.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Jun 2020 02:02:44 -0700 (PDT) Subject: Re: [PATCH] v4l2-ctrl: add control for thumnails From: Stanimir Varbanov To: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Philipp Zabel , Ezequiel Garcia , Paul Kocialkowski , Nicolas Dufresne , Tomasz Figa References: <20200526085446.30956-1-stanimir.varbanov@linaro.org> <65ac9697-a43f-7025-e6fe-69c4a44c6d9a@xs4all.nl> Message-ID: Date: Thu, 4 Jun 2020 12:02:42 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Hans, On 5/27/20 12:53 AM, Stanimir Varbanov wrote: > Hi Hans, > > On 5/26/20 3:04 PM, Hans Verkuil wrote: >> On 26/05/2020 10:54, Stanimir Varbanov wrote: >>> 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. >> >> This is very vague. It doesn't explain why the control is called 'THUMBNAIL', >> but more importantly it doesn't explain how this relates to normal decoding. > > If in the normal decode the capture queue buffers are 5, in the > thumbnail mode the number of buffers will be only 1 (if the bitstream is > progressive) and this will guarantee low memory usage. The other > difference is that the decoder will produce decoded frames (without > errors) only for I/IDR (sync frames). > >> >> I.e. if you are decoding and 'press' this control, what happens then? > > Might be the button type wasn't great idea. In fact the control should > be set before streamon so that the driver returns min_capture_bufs 1. > >> >> What exactly is the use-case? > > It could be used to generate thumbnails of all video clips in a folder > or when you open a Gallery application on your phone. > What is your opinion on that control? I could consider to make it Venus custom control but from the use-case it looks other drivers also can benefit of it. I tried to make more generic one [1] but it looks it will be too difficult. -- regards, Stan [1] https://www.spinics.net/lists/linux-media/msg167794.html