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
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user