LOL, I didn't find that class, so I wrote one for my own little more
than a week ago:
http://lists.qt-project.org/pipermail/interest/2014-January/010992.html

I believe no QML class exist with the same functionality (fix me if
I'm wrong, looks like I'm not good at finding classes :) ), so you
need to do it in C++.

I can help you more with the conversion part, I did it like this:

// frame is originally const QVideoFrame&, but the map function is not const
QVideoFrame nonConstFrame(frame);  // shallow copy
nonConstFrame.map(QAbstractVideoBuffer::ReadOnly);

QImage::Format format =
QVideoFrame::imageFormatFromPixelFormat(nonConstFrame.pixelFormat());
QImage image = QImage(nonConstFrame.bits(), nonConstFrame.width(),
nonConstFrame.height(), nonConstFrame.bytesPerLine(),format).copy();

nonConstFrame.unmap();

Tr3w

On Thu, Feb 6, 2014 at 3:49 PM, Jason H <scorp...@yahoo.com> wrote:
> I have a QML project (Lin/Android) that I need to scan bar codes using the
> camera or video playback (for testing).
>
> I found the QVideoProbe class. But not sure how to use it in QML. I have a
> C++ class that will do the bar code recognition, it takes a QImage or QUrl
> of an image. The reader works with images, so that part works.
>
> But how do I assemble all this, and important convert from a QVideoFrame to
> a QImage?
>
> I would want to do something like:
> {
> Camera {}
> Text {} // barcode display
> BarCodeReader { onBarCode: text.text =  barcode }
> VideoProbe: { source: camera; onFrame: barcodeReader.read(frame)
> }
>
>
> Thanks!
>
>
> _______________________________________________
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to