basesrc: Don't hold LIVE_LOCK in create/alloc/fill
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 1 Jun 2017 14:36:26 +0000 (10:36 -0400)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 29 Jun 2017 14:51:33 +0000 (10:51 -0400)
commit523de1a9dc7b7f79c78120bed15c364336f067cb
tree302c6fb8f21f9e72a52cb4ce234bad8573380433
parent946622ec3fa975a5d570047ee37c287f0d8e791c
basesrc: Don't hold LIVE_LOCK in create/alloc/fill

Holding this lock on live source prevents the source from changing
the caps in ::create() without risking a deadlock. This has consequences
as the LIVE_LOCK was replacing the STREAM_LOCK in many situation. As a
side effect:

- We no longer need to unlock when doing play/pause as the LIVE_LOCK
  isn't held. We then let the create() call finish, but will block if
  the state have changed meanwhile. This has the benefit that
  wait_preroll() calls in subclass is no longer needed.
- We no longer need to change the state to unlock, simplifying the
  set_flushing() interface
- We need different handling for EOS depending if we are in push or pull
  mode.

This patch also document the locking of each private class member and
the locking order.

https://bugzilla.gnome.org/show_bug.cgi?id=783301
libs/gst/base/gstbasesrc.c