public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Cc: linux-media@vger.kernel.org
Subject: Re: Question about v4l2-compliance: cap->readbuffers
Date: Tue, 30 Jul 2013 18:17:22 +0200	[thread overview]
Message-ID: <51F7E712.40103@xs4all.nl> (raw)
In-Reply-To: <CAPybu_2TivP9Pui2O5N8QofT-07tdxYMnOsC2Nvo7Ods0PuX7w@mail.gmail.com>

Hi Ricardo,

On 07/30/2013 05:46 PM, Ricardo Ribalda Delgado wrote:
> Hello
> 
> I have a camera that works on two modes: Mono and colour. On color
> mode it has 3 gains, on mono mode it has 1 gain.
> 
> When the user sets the output to mono I disable the color controls
> (and the other way around).
> 
> Also on color mode the hflip and vflip do not work, therefore I dont show them.
> 
> I could return -EINVAL, but I rather not show the controls to the user.
> 
> What would be the proper way to do this?

Use the INACTIVE flag, that's the way it is typically done. You can still set
such controls, but the new value won't be active until you switch back to a
mode where they do work.

Using INACTIVE will show such controls as disabled in a GUI like qv4l2. I highly
recommend using qv4l2 for testing this since it is the reference implementation
of how GUIs should interpret control flags.

Regards,

	Hans

> 
> 
> Thanks gain.
> 
> 
> 
> 
> 
> On Tue, Jul 30, 2013 at 5:29 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
>> On Tue 30 July 2013 17:18:58 Ricardo Ribalda Delgado wrote:
>>> Thanks for the explanation Hans!
>>>
>>> I finaly manage to pass that one ;)
>>>
>>> Just one more question. Why the compliance test checks if the DISABLED
>>> flag is on on for qctrls?
>>>
>>> http://git.linuxtv.org/v4l-utils.git/blob/3ae390e54a0ba627c9e74953081560192b996df4:/utils/v4l2-compliance/v4l2-test-controls.cpp#l137
>>>
>>>  137         if (fl & V4L2_CTRL_FLAG_DISABLED)
>>>  138                 return fail("DISABLED flag set\n");
>>>
>>> Apparently that has been added on:
>>> http://git.linuxtv.org/v4l-utils.git/commit/0a4d4accea7266d7b5f54dea7ddf46cce8421fbb
>>>
>>> But I have failed to find a reason
>>
>> It shouldn't be used anymore in drivers. With the control framework there is
>> no longer any reason to use the DISABLED flag.
>>
>> If something has a valid use case for it, then I'd like to know what it is.
>>
>> Regards,
>>
>>         Hans
> 
> 
> 

  reply	other threads:[~2013-07-30 16:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-30 13:12 Question about v4l2-compliance: cap->readbuffers Ricardo Ribalda Delgado
2013-07-30 13:45 ` Hans Verkuil
2013-07-30 15:18   ` Ricardo Ribalda Delgado
2013-07-30 15:29     ` Hans Verkuil
2013-07-30 15:46       ` Ricardo Ribalda Delgado
2013-07-30 16:17         ` Hans Verkuil [this message]
2013-07-31  7:09           ` Ricardo Ribalda Delgado
2013-07-31  7:37             ` Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51F7E712.40103@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=ricardo.ribalda@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox