Re: [RFC/PATCH v1 1/3] v4l: Add new framesamples field to struct v4l2_mbus_framefmt

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

 



Hi Tomasz,

On 11/22/2011 12:07 PM, Tomasz Stanislawski wrote:
> On 11/22/2011 10:55 AM, Sylwester Nawrocki wrote:
>> The purpose of the new field is to allow the video pipeline elements to
>> negotiate memory buffer size for compressed data frames, where the buffer
>> size cannot be derived from pixel width and height and the pixel code.
>>
>> For VIDIOC_SUBDEV_S_FMT and VIDIOC_SUBDEV_G_FMT ioctls, the framesamples
>> parameter should be calculated by the driver from pixel width, height,
>> color format and other parameters if required and returned to the caller.
>> This applies to compressed data formats only.
>>
>> The application should propagate the framesamples value, whatever returned
>> at the first sub-device within a data pipeline, i.e. at the pipeline's data
>> source.
>>
>> For compressed data formats the host drivers should internally validate
>> the framesamples parameter values before streaming is enabled, to make sure
>> the memory buffer size requirements are satisfied along the pipeline.
>>
>> Signed-off-by: Sylwester Nawrocki<s.nawrocki@xxxxxxxxxxx>
>> Signed-off-by: Kyungmin Park<kyungmin.park@xxxxxxxxxxx>
>> ---
>>   Documentation/DocBook/media/v4l/subdev-formats.xml |    7 ++++++-
>>   include/linux/v4l2-mediabus.h                      |    4 +++-
>>   2 files changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/DocBook/media/v4l/subdev-formats.xml
>> b/Documentation/DocBook/media/v4l/subdev-formats.xml
>> index 49c532e..d0827b4 100644
>> --- a/Documentation/DocBook/media/v4l/subdev-formats.xml
>> +++ b/Documentation/DocBook/media/v4l/subdev-formats.xml
>> @@ -35,7 +35,12 @@
>>       </row>
>>       <row>
>>       <entry>__u32</entry>
>> -    <entry><structfield>reserved</structfield>[7]</entry>
>> +    <entry><structfield>framesamples</structfield></entry>
> 
> Why you do not use name sizeimage?

The media bus format data structure describes data as seen on the media bus,
in general single subdevs might not know how data samples are translated into
data in memory. So, not in my opinion only, the name 'framesamples' is more 
appropriate, even though the translation of some media bus data formats into 
data in memory is straightforward.
We've discussed this roughly several times, e.g. during the Cambourne meeting.

> It is used in struct v4l2_plane_pix_format and struct v4l2_pix_format?
> 
> Should old drivers be modified to update this field?

I think the drivers that expose a sub-device node to user space might need to
be modified to set the framesamples field to 0 for raw formats. There is about
9 of them in the mainline AFAICS, and only two use compressed formats.


--
Regards,
Sylwester
--
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