Original code checks if the videoframe's handle type is VideoFrame::NoHandle (CPU addressable) before the conversion to QImage. The other case, if the videoframe resides in GPU is not handled and image is not decoded in that case.
After looking into the QVideoFrame source (link) it turns out that this check is already done in .toImage() method and aproperiate conversion is done within. I wasn't able to test this myself but it seems that skipping of this explicit check should be enough to make conversion work for both cpu and gpu frames.
Original code checks if the videoframe's handle type is
VideoFrame::NoHandle
(CPU addressable) before the conversion to QImage. The other case, if the videoframe resides in GPU is not handled and image is not decoded in that case.After looking into the QVideoFrame source (link) it turns out that this check is already done in
.toImage()
method and aproperiate conversion is done within. I wasn't able to test this myself but it seems that skipping of this explicit check should be enough to make conversion work for both cpu and gpu frames.