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

Provide a QML enum for QVideoFrameFormat::PixelFormat

XMLWordPrintable

    • All

      I write QML code to select an appropriate CameraFormat for my application; in my case, I want to avoid the overhead of cameras which produce their output as JPEG. Consider the following QML snippet:

       

      Item {
          CaptureSession {
              id: captureSession
              camera: Camera {
                  id: camera
                  cameraFormat: {
                      let videoFormats = Object.values(camera.cameraDevice.videoFormats)
                      // Failure: VideoFrameFormat.Format_Jpeg is not defined; use the number 29 instead.
                      videoFormats = videoFormats.filter(videoFormat => videoFormat.pixelFormat !== VideoFrameFormat.Format_Jpeg)
                      return videoFormats[0]
      }
      }
      }
      }

       

      Note that the enum VideoFrameFormat.Format_Jpeg is not defined, causing this code to fail. Therefore, providing this enum would improve the quality of QML code.

        For Gerrit Dashboard: QTBUG-120721
        # Subject Branch Project Status CR V

            qtmultimediateam Qt Multimedia Team
            bjones Bryan Jones
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change