Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-69968

QVideoFrame reports wrong format

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • None
    • 5.11.1
    • Multimedia
    • None
    • Android

    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

        Activity

          People

            valentyn.doroshchuk Valentyn Doroshchuk
            spynacker Martin Schulze
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes