diff options
Diffstat (limited to 'src/plugins/avfoundation/camera/avfcamerasession.mm')
-rw-r--r-- | src/plugins/avfoundation/camera/avfcamerasession.mm | 27 |
1 files changed, 27 insertions, 0 deletions
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 <CoreFoundation/CoreFoundation.h> #include <Foundation/Foundation.h> @@ -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<AVFMediaVideoProbeControl *>::const_iterator i = m_videoProbes.constBegin(); + while (i != m_videoProbes.constEnd()) { + (*i)->newFrameProbed(frame); + ++i; + } + m_videoProbesMutex.unlock(); +} + #include "moc_avfcamerasession.cpp" |