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 --- src/plugins/avfoundation/camera/avfcameraservice.mm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/plugins/avfoundation/camera/avfcameraservice.mm') diff --git a/src/plugins/avfoundation/camera/avfcameraservice.mm b/src/plugins/avfoundation/camera/avfcameraservice.mm index 25111c5cc..20792000a 100644 --- a/src/plugins/avfoundation/camera/avfcameraservice.mm +++ b/src/plugins/avfoundation/camera/avfcameraservice.mm @@ -54,6 +54,7 @@ #include "avfvideorenderercontrol.h" #include "avfmediarecordercontrol.h" #include "avfimagecapturecontrol.h" +#include "avfmediavideoprobecontrol.h" #include #include @@ -119,6 +120,12 @@ QMediaControl *AVFCameraService::requestControl(const char *name) if (qstrcmp(name, QCameraImageCaptureControl_iid) == 0) return m_imageCaptureControl; + if (qstrcmp(name,QMediaVideoProbeControl_iid) == 0) { + AVFMediaVideoProbeControl *videoProbe = 0; + videoProbe = new AVFMediaVideoProbeControl(this); + m_session->addProbe(videoProbe); + return videoProbe; + } if (!m_videoOutput) { if (qstrcmp(name, QVideoRendererControl_iid) == 0) m_videoOutput = new AVFVideoRendererControl(this); @@ -139,6 +146,13 @@ void AVFCameraService::releaseControl(QMediaControl *control) m_session->setVideoOutput(0); delete control; } + AVFMediaVideoProbeControl *videoProbe = qobject_cast(control); + if (videoProbe) { + m_session->removeProbe(videoProbe); + delete videoProbe; + return; + } + } #include "moc_avfcameraservice.cpp" -- cgit v1.2.3