The QCamera doesn't works with QVideoProbe under Win32.
-
In the following code, the result of videoProbe->setSource((QMediaObject *)camera)
are false, how to deal with this problem?
@
QCamera *camera = new QCamera;
camera->setCaptureMode(QCamera::CaptureVideo);QCameraViewfinder *viewfinder = new QCameraViewfinder(); camera->setViewfinder(viewfinder); qDebug() << " start set source"; QVideoProbe *videoProbe = new QVideoProbe(this); if (videoProbe->setSource((QMediaObject *)camera)) { qDebug() << " set source succeed"; // Probing succeeded, videoProbe->isValid() should be true. connect(videoProbe, SIGNAL(videoFrameProbed(const QVideoFrame &)), this, SLOT(detectAVA(const QVideoFrame &))); } camera->start(); // Viewfinder frames should now also be emitted by // the video probe, even in still image capture mode. // Another alternative is to install the probe on a // QMediaRecorder connected to the camera to get the // recorded frames, if they are different from the // viewfinder frames. viewfinder->resize(800, 480); viewfinder->show();
@
-
Hi,
For the QVideoProbe support see this "email":http://lists.qt-project.org/pipermail/interest/2014-February/011125.html
-
Using (passing) a Camera element as sourceObj, what will happen?
It will also work.
That was in theory. In practice, it depends on the platform. QVideoProbe is not available on all of them (or only for either a media player or a camera).
It should be in the doc, but here's an overview of QVideoProbe support:
Android: only for camera
Blackberry: no support
iOS: no support
Linux: only for media player
Mac: no support
Windows: only for media playerIf it's not supported it doesn't necessarily mean it's not possible to do it on a given platform, it can mean that it's not currently implemented.
So, Android is only platform that support for Camera, then I am looking for support on Win32, I am willing to add support under win32, is that work will be really hard, and I will merge it into Qt mainline.
Besides, I will add media player support under Android. That's two feature I am looking for.