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.
Attachments
For Gerrit Dashboard: QTBUG-69968 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
240008,3 | Android: Change video frame format from BGR32 to ABGR32 | dev | qt/qtmultimedia | Status: MERGED | +2 | 0 |
240012,3 | Android: Mirror QImage while mapping a video frame | dev | qt/qtmultimedia | Status: DEFERRED | 0 | 0 |
242479,2 | Setup QVideoFrame::Format_ABGR32 | dev | qt/qtmultimedia | Status: MERGED | +2 | 0 |
242491,1 | Add QImage::Format_RGBA8888 as equivalent to QVideoFrame::Format_ABGR32 | dev | qt/qtmultimedia | Status: ABANDONED | -2 | 0 |