[libcamera-devel] Issues with ControlSerializer

Kieran Bingham kieran.bingham at ideasonboard.com
Mon Jul 26 12:15:21 CEST 2021


Hi Jacopo,

On 26/07/2021 11:10, Jacopo Mondi wrote:
> Hi Kieran
> 
> On Mon, Jul 26, 2021 at 10:07:17AM +0100, Kieran Bingham wrote:

<snip>

>>> Or rather redefine it to retrieve the numeric id internally, something
>>> like:
>>>
>>>         ControlInfoMap::iterator find(const ControlId *controlId)
>>>         {
>>>                 return find(controlId->id());
>>>         }
>>>
>>> I would maintain the current interface for consistency and add this
>>> tiny wrapper.
>>
>>
>> I think I recall one reason we were ok comparing pointers was that they
>> were unique across multiple ControlLists/ControlInfoMaps which might
>> otherwise have the same IDs ?
>>
>> (i.e. if there are libcamera controls, and v4l2 controls with both lists
>> starting with ids based at 0, we don't want to allow a comparator to say
>> V4L2::ID(0) == libcamera::ID(0)...
>>
>> Will this be an issue? or can we already ensure that we don't make
>> comparisons against incompatible lists?
>>
> 
> Correct, good memory. We indeed open the door to id collision between
> v4l2 controls and libcamera controls. Currently we cannot distinguish
> between a v4l2 defined control and a libcamera defined one by design.
> Unless we add a flag isV4L2_ or something, but I'm not sure it's
> ideal.

Indeed, I don't think it should be a per-list flag, but some identifier
on the list itself. Perhaps something that could be copied across when
serialising/deserialising so that the IPA can know that it has the right
control list type.

Even if this were just a static enum type registration would be better
to start with .. but I agree we need to avoid the pointer comparisons
anyway...

--
Kieran



More information about the libcamera-devel mailing list