Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp392600pxb; Tue, 9 Feb 2021 03:10:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyd5qLMJCoOVuhnq+DUkrbcvQnDRRmXq6pCMa4EEsVG8McU/jNpkd7WAp/1nlTQeQ7UgNkV X-Received: by 2002:a05:6402:289:: with SMTP id l9mr8096470edv.218.1612869023988; Tue, 09 Feb 2021 03:10:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612869023; cv=none; d=google.com; s=arc-20160816; b=U4HsxgiZ1W1/8EWrHURuyCr+PWnINEDLwx9SPeCH3Gh+Ty4l0lnSPGX+eJtMgiJSOR 0w6E5Pf8Bs0rKk1JMAuRXNh14lCth0GaZQn0+myknDgzNPhi7mqJQwR3gmBkFCY59jwA CDPLhpcsZdOn7x9MDyK9tBalmfslRLvdLHcuc8w7jxOX28v/ZNvT3qkUUj9MzyAZ7g1i 5aOSCmVBMvss4yf/d+JeEe0Nv/3ueoWagnukXTGXpV25kJgrRPd7VcuSeXledxyq2bgU 6qNngXNOcjbVmWuYq8CekiRysOv2aqqJhLtyGkEvdllFuK/vyqo53Boh3/xrN0eK4nqj gJUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=rTk96AFcfGUn5lwbTCQQMfPdWb4QJsgHf6oGPRXSZ1k=; b=ldmzwaei8xkemTZHImm0nqeZs823Om3/EgOGuYqgJ6dneUFwKUEbahl9utyKN8j0xC FaetwBVz4qyuB1JDf+YJpZH4zyyh9VnEK+iy/hiEr1ow1a2poKyrbKUIBeIFvkGJvUqG M9ShicQa9D/QIlUZ5pxXqJFkkyjkwOTpJXcR7ro45KNxXp5xYRdSpQGKZrBg22c4wzOB yxELOaVeqEP7MOlT6NFHnRL2+RLEyYfgTrDdFPGnKaNEqDSFKZlY4jPdsDiH72m0CAEU jSTbbViFrp6cOuDuhIZ5eJCFM25T8po8B0M0exF6URuK7NsHhY1c5+ceUq2/qldqju+E Gh3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xs4all.nl header.s=s2 header.b=wTuUnk1b; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hs7si4236260ejc.128.2021.02.09.03.10.00; Tue, 09 Feb 2021 03:10:23 -0800 (PST) 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=@xs4all.nl header.s=s2 header.b=wTuUnk1b; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232297AbhBILIM (ORCPT + 99 others); Tue, 9 Feb 2021 06:08:12 -0500 Received: from lb1-smtp-cloud7.xs4all.net ([194.109.24.24]:43913 "EHLO lb1-smtp-cloud7.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232314AbhBILGU (ORCPT ); Tue, 9 Feb 2021 06:06:20 -0500 Received: from cust-b5b5937f ([IPv6:fc0c:c16d:66b8:757f:c639:739b:9d66:799d]) by smtp-cloud7.xs4all.net with ESMTPA id 9Qpkl3B6m9z9J9QpnloTo8; Tue, 09 Feb 2021 12:05:31 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xs4all.nl; s=s2; t=1612868731; bh=rTk96AFcfGUn5lwbTCQQMfPdWb4QJsgHf6oGPRXSZ1k=; h=Subject:To:From:Message-ID:Date:MIME-Version:Content-Type:From: Subject; b=wTuUnk1boLzRLaADfJGbYQ0VVgs7991lt3vYhscgjmbuteIhgUa0uYWAtTQ8qrMQN HSnQ5acDZ5Muhrm86vMZnM1RAARvyRw2RCz04TwRxRb0XLgA5fQNfdmvFLO0WrKaKU G08ddDZoHIussFOtEXZKjVuucTwofvXe8mkJjdIzLLVoiOsYefRjZ0gqURbf7/WjKG j6F9DlLN98ZY/AhyKjn7zkQGK0vb3DXEvcPmw9BMnz+2tGWrGDzSvcbMlsBvhQeQJ9 nmyvR9+YTfFB8hxonXOjKKONjyoJMeFOAAItZi4QX7CJtm3miG/0AgrqOmG59JPJFm lpXxAeh76feFQ== Subject: Re: [PATCH 1/2] v4l2-ctrl: Add decoder conceal color control To: Stanimir Varbanov , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org References: <20210209094527.2173690-1-stanimir.varbanov@linaro.org> <20210209094527.2173690-2-stanimir.varbanov@linaro.org> From: Hans Verkuil Message-ID: Date: Tue, 9 Feb 2021 12:05:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210209094527.2173690-2-stanimir.varbanov@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfNa8tKldIu4/n90P4g+inBwvTDmVuJlACLrORYsl24Es8lL+1+2zq0f9rxfATa62+W+wcMZSFEiFKHE5JuOEhH2QvdKYAdJPfPDXn7s4iUHY3BUczyHw TWLiBSA+A5W6144BqpX6yB4QKAUFHlxjU/eAz8fvnEpRia6hhj6zI+jwLJYg2uX3hXDrosp0Dr8Aj5m6EK8Y/jl1N5E7YCHRwK/+xXosfKniGSRVD9g2k2Iz 2quz3tsLunorToUydY/p9gAnmKO82rLZRdqMqHAFOBJ21CuT+f/1b9AyQgkYTnlaIEA3jSIWJylFEIY2byiz+bRmTzzsM92vsq9RYcbeshM= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/02/2021 10:45, Stanimir Varbanov wrote: > Add decoder v4l2 control to set conceal color. > > Signed-off-by: Stanimir Varbanov > --- > .../media/v4l/ext-ctrls-codec.rst | 20 +++++++++++++++++++ > drivers/media/v4l2-core/v4l2-ctrls.c | 9 +++++++++ > include/uapi/linux/v4l2-controls.h | 1 + > 3 files changed, 30 insertions(+) > > diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst > index 00944e97d638..994650052333 100644 > --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst > +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst > @@ -674,6 +674,26 @@ enum v4l2_mpeg_video_frame_skip_mode - > is currently displayed (decoded). This value is reset to 0 whenever > the decoder is started. > > +``V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR (integer64)`` > + This control sets conceal color in YUV color space. It describes the > + client preference of error conceal color in case of error where > + reference frame is missing. The decoder would paint the reference > + buffer with preferred color and use it for future decoding. > + Applicable to decoders. You should mention explicitly that this is using 16-bit color components and expects Limited Range. > + > +.. flat-table:: > + :header-rows: 0 > + :stub-columns: 0 > + > + * - Bit 0:15 > + - Y luminance > + * - Bit 16:31 > + - Cb chrominance > + * - Bit 32:47 > + - Cr chrominance > + * - Bit 48:63 > + - Must be zero > + > ``V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (boolean)`` > If enabled the decoder expects to receive a single slice per buffer, > otherwise the decoder expects a single frame in per buffer. > diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c > index 016cf6204cbb..a3b9d28a00b7 100644 > --- a/drivers/media/v4l2-core/v4l2-ctrls.c > +++ b/drivers/media/v4l2-core/v4l2-ctrls.c > @@ -945,6 +945,7 @@ const char *v4l2_ctrl_get_name(u32 id) > case V4L2_CID_MPEG_VIDEO_VBV_SIZE: return "VBV Buffer Size"; > case V4L2_CID_MPEG_VIDEO_DEC_PTS: return "Video Decoder PTS"; > case V4L2_CID_MPEG_VIDEO_DEC_FRAME: return "Video Decoder Frame Count"; > + case V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR: return "Video Decoder Conceal Color"; > case V4L2_CID_MPEG_VIDEO_VBV_DELAY: return "Initial Delay for VBV Control"; > case V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE: return "Horizontal MV Search Range"; > case V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE: return "Vertical MV Search Range"; > @@ -1430,6 +1431,14 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, > *max = 0x7fffffffffffffffLL; > *step = 1; > break; > + case V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR: > + *type = V4L2_CTRL_TYPE_INTEGER64; > + *min = 0; > + /* default for 8bit black, luma is 16, chroma is 128 */ Since this is 16 bit the actual default luma value for black is 4096 and for chroma use 32768 (i.e. both values are times 256). > + *def = 0x8000800010LL; > + *max = 0xffffffffffffLL; > + *step = 1; > + break; > case V4L2_CID_PIXEL_RATE: > *type = V4L2_CTRL_TYPE_INTEGER64; > *flags |= V4L2_CTRL_FLAG_READ_ONLY; > diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h > index 039c0d7add1b..5e5a3068be2d 100644 > --- a/include/uapi/linux/v4l2-controls.h > +++ b/include/uapi/linux/v4l2-controls.h > @@ -428,6 +428,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_BASELAYER_PRIORITY_ID (V4L2_CID_CODEC_BASE+230) > +#define V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR (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) > Regards, Hans