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 <yoann.lopes@digia.com>
This commit is contained in:
committed by
Yoann Lopes
parent
9267a7833c
commit
762ff94f67
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user