On 09/09/15 11:19, Chetan Nanda wrote:
> [Sorry if duplicate, as my last mail rejected because of HTML content]
> 
> Hi,
> 
> I am working on a V4L2 based video decoder driver,
> 
> At user side there are two contexts.
> One is queuing/dequeuing buffers from driver (in a separate thread)
> and other is the main context, from where I am calling streamon,
> streamoff.
> 
> When I call a streamoff from main context and thread is blocking on
> dqbuf, This cause the blocking thread to unblock from dqbuf with an
> error (EINVAL).
> 
> Seems this error coming from videobuf2-core, as streamoff will unblock
> the waiting thread, and this thread will go and check (in function
> __vb2_wait_for_done_vb) for q->streaming and will return error as
> q->streaming will be set to false on streamoff.
> 
> Is it the right behavior of vb2_dqbuf to return error when streamoff is 
> called?

Yes. No more buffers will arrive, so you want blocking waits to wake up.

Typically you would want to exit the dequeuing thread or do other clean up
actions.

> Or is it a right way to have this kind of mechanism i.e.on userside
> one thread is queue/dequeue buffers while another is doing streamoff.

This approach is fine.

Regards,

        Hans

> 
> Thanks for your help and idea.
> 
> Thanks,
> Chetan Nanda
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to