v4l2: call VIDIOC_REQBUFS with count = 0 in pool_finalize
authorMichael Olbrich <m.olbrich@pengutronix.de>
Mon, 3 Jun 2013 15:07:10 +0000 (17:07 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 4 Jun 2013 08:45:06 +0000 (10:45 +0200)
commit3417a791acdd364c86974552550f853a9c56f5b9
tree206fcaf3b04ae393d440caeef35b87dacb55388c
parent496995a7d52e74c9d73dd644e5ed7af4b2d5f15d
v4l2: call VIDIOC_REQBUFS with count = 0 in pool_finalize

Without this the following sequence fails:

- set_caps()
  - object_stop() (does nothing)
  - set_format() -> VIDIOC_S_FMT
- set_config() -> VIDIOC_REQBUFS with count = N
- set_caps()
  - object_stop()
    - pool_finalize()
  - set_format() -> VIDIOC_S_FMT => EBUSY

Usually the pool is started after set_config(), in which case object_stop()
will result in a pool_stop and therefore VIDIOC_REQBUFS with count = 0 but
that is not guaranteed.
Also calling VIDIOC_REQBUFS with count = 0 in pool_finalize() if necessary
fixes this problem.

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