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

Provide a QML enum for QVideoFrameFormat::PixelFormat

    XMLWordPrintable

Details

    • All

    Description

      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.

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change