Commit f6d8fa50 authored by Timur Pocheptsov's avatar Timur Pocheptsov
Browse files

AVFImageCaptureControl - do not block the capture's callback


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>
parent 9649a6ed
No related merge requests found
Showing with 23 additions and 7 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment