Hi,

On Thursday 24 September 2009 11:14:35 Bo Liu wrote:
> Hi, All
> 
>      I have a question about VIDIOC_S_FMT?
> 
>      Gstreamer will ioctl(VIDIOC_STREAMINGOFF), then ioctl(VIDIOC_S_FMT),
>  then ioctl(VIDIOC_STREAMINGON)
> 
>      The newest's code have these patch:
> 
> diff --git a/drivers/media/video/uvc/uvc_v4l2.c
>  b/drivers/media/video/uvc/uvc_v4l2.c index 507542d..f8b94d6 100644 (file)
> --- a/drivers/media/video/uvc/uvc_v4l2.c
> +++ b/drivers/media/video/uvc/uvc_v4l2.c
> @@ -251,7 +251,7 @@ static int uvc_v4l2_set_format(struct uvc_video_device
>  *video, if (fmt->type != video->streaming->type)
>                 return -EINVAL;
> 
> -       if (uvc_queue_streaming(&video->queue))
> +       if (uvc_queue_allocated(&video->queue))
>                 return -EBUSY;
> 
>         ret = uvc_v4l2_try_format(video, fmt, &probe, &format, &frame);
> 
> 
> 
>       And, I found after this patch ioctl(VIDIOC_S_FMT) will failed at
>  uvc_queue_allocated(it won't failed at uvc_queue_streaming).
> 
>       So, Now Can Gstreamer set the format(use ioctl(VIDIOC_STREAMINGOFF),
>  then ioctl(VIDIOC_S_FMT), then ioctl(VIDIOC_STREAMINGON)) after open the
>  device(doesn't close) ? If not, How to implement this?

You can't change the format while buffers are allocated. You need to free the 
buffers before, using VIDIOC_REQBUFS with a buffer count of 0.

-- 
Regards,

Laurent Pinchart
_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to