RE: [PATCH v5 2/3] v4l: Add multi-planar ioctl handling code

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

 



Hi,

>Hans Verkuil <hverkuil@xxxxxxxxx> wrote:
>On Friday 30 July 2010 10:49:42 Pawel Osciak wrote:

<snip>

>>  static long __video_do_ioctl(struct file *file,
>>  		unsigned int cmd, void *arg)
>>  {
>>  	struct video_device *vfd = video_devdata(file);
>>  	const struct v4l2_ioctl_ops *ops = vfd->ioctl_ops;
>>  	void *fh = file->private_data;
>> +	struct v4l2_format f_copy;
>>  	long ret = -EINVAL;
>>
>>  	if (ops == NULL) {
>> @@ -720,6 +822,11 @@ static long __video_do_ioctl(struct file *file,
>>  			if (ops->vidioc_enum_fmt_vid_cap)
>>  				ret = ops->vidioc_enum_fmt_vid_cap(file, fh, f);
>>  			break;
>> +		case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
>> +			if (ops->vidioc_enum_fmt_vid_cap_mplane)
>> +				ret = ops->vidioc_enum_fmt_vid_cap_mplane(file,
>> +									fh, f);
>> +			break;
>>  		case V4L2_BUF_TYPE_VIDEO_OVERLAY:
>>  			if (ops->vidioc_enum_fmt_vid_overlay)
>>  				ret = ops->vidioc_enum_fmt_vid_overlay(file,
>> @@ -729,6 +836,11 @@ static long __video_do_ioctl(struct file *file,
>>  			if (ops->vidioc_enum_fmt_vid_out)
>>  				ret = ops->vidioc_enum_fmt_vid_out(file, fh, f);
>>  			break;
>> +		case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
>> +			if (ops->vidioc_enum_fmt_vid_out_mplane)
>> +				ret = ops->vidioc_enum_fmt_vid_out_mplane(file,
>> +									fh, f);
>> +			break;
>>  		case V4L2_BUF_TYPE_PRIVATE:
>>  			if (ops->vidioc_enum_fmt_type_private)
>>  				ret = ops->vidioc_enum_fmt_type_private(file,
>> @@ -757,22 +869,79 @@ static long __video_do_ioctl(struct file *file,
>>
>>  		switch (f->type) {
>>  		case V4L2_BUF_TYPE_VIDEO_CAPTURE:
>> -			if (ops->vidioc_g_fmt_vid_cap)
>> +			if (ops->vidioc_g_fmt_vid_cap) {
>>  				ret = ops->vidioc_g_fmt_vid_cap(file, fh, f);
>> +			} else if (ops->vidioc_g_fmt_vid_cap_mplane) {
>> +				if (fmt_sp_to_mp(f, &f_copy))
>> +					break;
>> +				ret = ops->vidioc_g_fmt_vid_cap_mplane(file, fh,
>> +									&f_copy);
>> +				/* Driver is currently in multi-planar format,
>> +				 * we can't return it in single-planar API*/
>> +				if (f_copy.fmt.pix_mp.num_planes > 1) {
>
>Only do this if ret == 0.
>

Good point, thanks. Driver-produced errors should take precedence over EBUSY.


Best regards
--
Pawel Osciak
Linux Platform Group
Samsung Poland R&D Center





--
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