Re: RFC> multi-crop (was: Multiple Rectangle cropping)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sylvester

Thanks for your response

Unfortunately, the v4l2_crop dont have any reserved field :(

struct v4l2_crop {
__u32 type; /* enum v4l2_buf_type */
struct v4l2_rect        c;
};

And changing that ABI I dont think is an option.

What about a new call: G/S_READOUT .that uses a modified
v4l2_selection as you propose?

That call selects the readable areas from the sensor.

The new structure could be something like:

#define SELECTION_BITMAP 0xffffffff
#define SELECTION_RESET 0xfffffffe
#define SELECTION_MAX_AREAS 32
struct v4l2_selection {
__u32 type;
__u32 target;
__u32                   flags;
union {
   struct v4l2_rect        r;
   __u32 bitmap;
};
__u32 n;
__u32                   reserved[8];
};

n chooses the readout area to choose, up to 32.

When n is == 0xffffffff the user wants to change the bitmap that
selects which areas are enabled.
  When the bitmap is 0x0 all the sensor is read.
  When the bitmap is 0x5 the readout area 0 and 2 are enabled.

When the bitmap is set to a value !=0, the driver checks if the
combination of readout areas is supported by the sensor/readout logic
and returns -EINVAL if not.

The g/s_crop API still works as usual.

Any comment on this? Of course the names should be better chosen, this
is just a declaration of intentions.

Cheers!



On Thu, Sep 5, 2013 at 11:44 PM, Sylwester Nawrocki
<sylvester.nawrocki@xxxxxxxxx> wrote:
> On 09/05/2013 11:10 PM, Ricardo Ribalda Delgado wrote:
>>
>> Hello
>
>
> Hi,
>
>
>>   I am working porting a industrial camera driver to v4l. So far I have
>> been able to describe most of the old functionality with v4l
>> equivalents. The only thing that I am missing is multi cropping.
>>
>> The sensor (both a cmosis and a ccd chips) supports skipping lines
>> from up to 8 regions. This increases the readout speed up to 50%,
>> which is critical for the application.
>>
>> Unfortunately I have no way to describe multiple cropping areas in
>> v4l. I am thinking about creating a new API/extending and old one for
>> this.
>>
>> Any suggestion before I start? Have you faced also this problem? How
>> did you solve it?
>
>
> A similar issue has been raised during discussions on the camera auto
> focus rectangle selection API. While defining need selection targets [1]
> it was also proposed to convert one of the struct v4l2_selection reserved
> fields into an index field, which would indicate one rectangle of some
> set of rectangles supported by a driver. Then there could be a v4l2
> bitmask control to determine which rectangles are currently valid/in use.
>
> Would something like this be relevant to your problem ?
>
>
>> I am planning to go to the Edinburgh mini summit, maybe we could add
>> this to the agenda (if you consider that it is worth the time, of
>> course)
>
>
> It definitely sounds like a good topic to discuss at the mini summit,
> unless it gets resolved until then. ;-)
>
> [1] http://www.spinics.net/lists/linux-media/msg64499.html
>
> --
> Regards,
> Sylwester



-- 
Ricardo Ribalda
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux