diff options
author | Ludger Krämer <kraemer@dem-gmbh.de> | 2014-09-09 13:46:20 +0200 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@digia.com> | 2014-09-12 17:57:52 +0200 |
commit | 762ff94f67a58df6c7c6315268ea64a2d2151f95 (patch) | |
tree | 7f446cf1ddfd1a67336af320d846578e92351c5d /src/plugins/avfoundation/camera/avfcameraservice.mm | |
parent | 9267a7833c6c30ccd4cbda3d087f0f901fb462eb (diff) |
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>
Diffstat (limited to 'src/plugins/avfoundation/camera/avfcameraservice.mm')
-rw-r--r-- | src/plugins/avfoundation/camera/avfcameraservice.mm | 14 |
1 files changed, 14 insertions, 0 deletions
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 <private/qmediaplaylistnavigator_p.h> #include <qmediaplaylist.h> @@ -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<AVFMediaVideoProbeControl *>(control); + if (videoProbe) { + m_session->removeProbe(videoProbe); + delete videoProbe; + return; + } + } #include "moc_avfcameraservice.cpp" |