does this seem right?

        const QImage&   image(pix);

        #if _QT6_
                QVideoFrameFormat       frameFormat(
                        image.size(),
                        
QVideoFrameFormat::pixelFormatFromImageFormat(image.format()));
                QVideoFrame             vidFrame(frameFormat); 
vidFrame.map(QVideoFrame::WriteOnly);
                uchar*                  memBitsP(vidFrame.bits());
                const uchar*            imageBitsP(image.bits());
                size_t                  memSizeL(vidFrame.mappedBytes());
                size_t                  imgSizeL(image.sizeInBytes());

                CF_ASSERT(memSizeL == imgSizeL);
                std::copy(imageBitsP, imageBitsP + memSizeL, memBitsP);
                vidFrame.unmap();
        #else
                // qt5 version
                QVideoFrame             vidFrame(image);
        #endif

        present(vidFrame, opacityF);

seems like a lot of convolution just to get an image into a video frame. also 
why was the API designed to have the unnecessary copy? the api should take a 
bits* directly, rather than forcing you to copy your bits into yet another 
buffer.

am i missing something?

> On Jul 7, 2021, at 8:48 AM, David M. Cotter <d...@kjams.com> wrote:
> 
> seems the API to so so has been removed, so how do i do it?
> 
> i can't find any documentation on porting guidance

_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to