<[email protected]>
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0


>
> 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.
>
 
Thanks for your reply, uvc_v4l2_try_format() success now. 
But gstreamer still failed while dequeue buffer, I think maybe it doesn't 
realloc buffer and add to queue.
Then, How and where to realloc the buffer after change the format?
I try to use VIDIOC_REQBUFS with a buffer count. But it seems no useage.
 

> --
> Regards,
>
> Laurent Pinchart                                        
_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. 
It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to