v4l2bufferpool: cleanly handle streamon failure for output device
authorAurélien Zanelli <aurelien.zanelli@parrot.com>
Tue, 7 Oct 2014 13:29:33 +0000 (15:29 +0200)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Wed, 29 Oct 2014 20:24:20 +0000 (16:24 -0400)
commit1dcc8832616bb382e39355236dc6c312083a88e4
tree445ca770c3965b8b038ebd5e23caf1338418ed39
parent8e9c752eca291577d1ac2b2d70b3769284e862b6
v4l2bufferpool: cleanly handle streamon failure for output device

On streamon failure, the queued buffer is not released from the
bufferpool class point of view because it is queued to the driver and
the flush logic is not performed since we are not in streaming state.
It causes the v4l2 bufferpool to always return that stop method failed
and to leak v4l2 objects and buffers.

This commit solve this by performing the flush logic in error case, ie
flushing the allocator and restoring queued buffer state to non-queued.

https://bugzilla.gnome.org/show_bug.cgi?id=738102
sys/v4l2/gstv4l2bufferpool.c