user avatar
AVFImageCaptureControl - do not block the capture's callback
Timur Pocheptsov authored
It's possible to initiate an asynchronous image capture
(via AVCaptureStillImageOutput object) and immediately
stop AVCaptureSession. In this case image capture's callback
can potentially block forever, waiting for a semaphore: (if)
no new frames arrive after 'stop' (on whatever thread
AVFoundation/GDC chooses), this semaphore is never released.
To avoid this we try to acquire a semaphore with a (reasonable)
timeout and report an error in case of failure. To make sure
we are not leaking a semaphore and not creating a danling pointer,
we use a QSharedPointer now.

Task-number: QTBUG-61367
Change-Id: I208cd463f843bc807b53b23ac9651aab0382775a
Reviewed-by: default avatarChristian Stromme <christian.stromme@qt.io>
Reviewed-by: default avatarTimur Pocheptsov <timur.pocheptsov@qt.io>
f6d8fa50