Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
None
-
5.11.1
-
None
Description
On my Android devices QVideoFilterRunnable::run gets a QVideoFrame that reports it's pixelFormat as QVideoFrame::Format_BGR32. However after close inspection I found that the format best matches QImage::Format_RGBX8888.
After some digging I found that QAndroidTextureVideoOutput just uses BGR32 as default:
void QAndroidTextureVideoOutput::onFrameAvailable() { if (!m_nativeSize.isValid() || !m_surface) return; QAbstractVideoBuffer *buffer = new AndroidTextureVideoBuffer(this, m_nativeSize); QVideoFrame frame(buffer, m_nativeSize, QVideoFrame::Format_BGR32);
However, the underlying OpenGL ES Texture is read from the FBO via:
QImage rgbaImage(size, include_alpha ? QImage::Format_RGBA8888_Premultiplied : QImage::Format_RGBX8888); funcs->glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, rgbaImage.bits());
As you can see, this matches exactly the observed format. So we either need a conversion or to report an RGBx pixel format.