From 762ff94f67a58df6c7c6315268ea64a2d2151f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludger=20Kr=C3=A4mer?= Date: Tue, 9 Sep 2014 13:46:20 +0200 Subject: implement QVideoProbe for iOS camera This commit allows to use QVideoProbe for QCamera on iOS. The logic for the implementation is taken from the Android plugin. [ChangeLog][Platform Specific Changes][iOS] QVideoProbe support is implemented for QCamera on iOS Change-Id: I1db50defa8518287c4f1f3cc6602881702a95849 Reviewed-by: Yoann Lopes --- .../avfoundation/camera/avfcamerasession.mm | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/plugins/avfoundation/camera/avfcamerasession.mm') diff --git a/src/plugins/avfoundation/camera/avfcamerasession.mm b/src/plugins/avfoundation/camera/avfcamerasession.mm index a72ef5041..3c58c25d6 100644 --- a/src/plugins/avfoundation/camera/avfcamerasession.mm +++ b/src/plugins/avfoundation/camera/avfcamerasession.mm @@ -46,6 +46,7 @@ #include "avfvideorenderercontrol.h" #include "avfvideodevicecontrol.h" #include "avfaudioinputselectorcontrol.h" +#include "avfmediavideoprobecontrol.h" #include #include @@ -371,4 +372,30 @@ void AVFCameraSession::attachInputDevices() } } +void AVFCameraSession::addProbe(AVFMediaVideoProbeControl *probe) +{ + m_videoProbesMutex.lock(); + if (probe) + m_videoProbes << probe; + m_videoProbesMutex.unlock(); +} + +void AVFCameraSession::removeProbe(AVFMediaVideoProbeControl *probe) +{ + m_videoProbesMutex.lock(); + m_videoProbes.remove(probe); + m_videoProbesMutex.unlock(); +} + +void AVFCameraSession::onCameraFrameFetched(const QVideoFrame &frame) +{ + m_videoProbesMutex.lock(); + QSet::const_iterator i = m_videoProbes.constBegin(); + while (i != m_videoProbes.constEnd()) { + (*i)->newFrameProbed(frame); + ++i; + } + m_videoProbesMutex.unlock(); +} + #include "moc_avfcamerasession.cpp" -- cgit v1.2.3