Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QT API changes from Qt 5 (5.12.11) to Qt 6 (6.4.0).
QtWS25 Last Chance

QT API changes from Qt 5 (5.12.11) to Qt 6 (6.4.0).

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
xcodeiosqvideoframeapichangesqt5.12.11
6 Posts 4 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    inkfil
    wrote on last edited by inkfil
    #1

    Hello Community,
    I have an iPadOs application written in Qt 5.12.11, and it has used QVideoFrame API.
    now since I have to migrate from Qt 5.12.11 to Qt 6.4.0, when I compile the application, I get error message as follows

    /Users/ronakjain/eye/ws640/app/vis.cpp:73:94: error: no member named 'Format_YV12' in 'QVideoFrame'
            QVideoFrame videoframe(y_size + uv_size*2, QSize(width, height), width, QVideoFrame::Format_YV12);
                                                                                    ~~~~~~~~~~~~~^
    /Users/ronakjain/eye/ws640/app/vis.cpp:74:24: error: incomplete type 'QAbstractVideoBuffer' named in nested name specifier
            videoframe.map(QAbstractVideoBuffer::WriteOnly);
                           ^~~~~~~~~~~~~~~~~~~~~~
    In file included from /Users/ronakjain/eye/ws640/app/vis.cpp:1:
    In file included from Focus/vis.h:5:
    In file included from ../../Qt/6.4.0/ios/include/QtMultimedia/QVideoFrame:1:
    ../../Qt/6.4.0/ios/include/QtMultimedia/qvideoframe.h:18:7: note: forward declaration of 'QAbstractVideoBuffer'
    class QAbstractVideoBuffer;
          ^
    /Users/ronakjain/eye/ws640/app/vis.cpp:75:31: error: no matching member function for call to 'bits'
            auto dst = videoframe.bits();
                       ~~~~~~~~~~~^~~~
    In file included from /Users/ronakjain/eye/ws640/app/vis.cpp:1:
    In file included from Focus/vis.h:5:
    In file included from ../../Qt/6.4.0/ios/include/QtMultimedia/QVideoFrame:1:
    ../../Qt/6.4.0/ios/include/QtMultimedia/qvideoframe.h:88:12: note: candidate function not viable: requires single argument 'plane', but no arguments
          were provided
        uchar *bits(int plane);
               ^
    ../../Qt/6.4.0/ios/include/QtMultimedia/qvideoframe.h:89:18: note: candidate function not viable: requires single argument 'plane', but no arguments
          were provided
        const uchar *bits(int plane) const;
                     ^
    /Users/ronakjain/eye/ws640/app/vis.cpp:22:31: warning: implicit conversion loses integer precision: 'qsizetype' (aka 'long long') to 'int'
          [-Wshorten-64-to-32]
            int y_size = eye_data.size();
                ~~~~~~   ~~~~~~~~~^~~~~~
    1 warning and 3 errors generated.
    

    can anyone help me with how the QVideoFrame Object should be initiated with the parameters as per the new Qt API (Qt version 6.4.0)?
    Note: I've already tried to go through docs and that seems to have constructors (check below link)
    but I want to instantiate QVideoFrame Object with Frame Size, Frame Format, ...

    REFERENCES:
    https://codebrowser.dev/qt6/qtmultimedia/src/multimedia/video/qvideoframe.h.html

    Thanks
    Ronak Jain.

    jsulmJ 1 Reply Last reply
    0
    • Paul ColbyP Offline
      Paul ColbyP Offline
      Paul Colby
      wrote on last edited by
      #2

      Hi @inkfil,

      WriteOnly has moved from QAbstractVideoBuffer::WriteOnly (Qt5) to QVideoFrame::WriteOnly (Qt6). So I guess:

       videoframe.map(QVideoFrame::WriteOnly);
      

      Cheers.

      I 1 Reply Last reply
      0
      • I inkfil

        Hello Community,
        I have an iPadOs application written in Qt 5.12.11, and it has used QVideoFrame API.
        now since I have to migrate from Qt 5.12.11 to Qt 6.4.0, when I compile the application, I get error message as follows

        /Users/ronakjain/eye/ws640/app/vis.cpp:73:94: error: no member named 'Format_YV12' in 'QVideoFrame'
                QVideoFrame videoframe(y_size + uv_size*2, QSize(width, height), width, QVideoFrame::Format_YV12);
                                                                                        ~~~~~~~~~~~~~^
        /Users/ronakjain/eye/ws640/app/vis.cpp:74:24: error: incomplete type 'QAbstractVideoBuffer' named in nested name specifier
                videoframe.map(QAbstractVideoBuffer::WriteOnly);
                               ^~~~~~~~~~~~~~~~~~~~~~
        In file included from /Users/ronakjain/eye/ws640/app/vis.cpp:1:
        In file included from Focus/vis.h:5:
        In file included from ../../Qt/6.4.0/ios/include/QtMultimedia/QVideoFrame:1:
        ../../Qt/6.4.0/ios/include/QtMultimedia/qvideoframe.h:18:7: note: forward declaration of 'QAbstractVideoBuffer'
        class QAbstractVideoBuffer;
              ^
        /Users/ronakjain/eye/ws640/app/vis.cpp:75:31: error: no matching member function for call to 'bits'
                auto dst = videoframe.bits();
                           ~~~~~~~~~~~^~~~
        In file included from /Users/ronakjain/eye/ws640/app/vis.cpp:1:
        In file included from Focus/vis.h:5:
        In file included from ../../Qt/6.4.0/ios/include/QtMultimedia/QVideoFrame:1:
        ../../Qt/6.4.0/ios/include/QtMultimedia/qvideoframe.h:88:12: note: candidate function not viable: requires single argument 'plane', but no arguments
              were provided
            uchar *bits(int plane);
                   ^
        ../../Qt/6.4.0/ios/include/QtMultimedia/qvideoframe.h:89:18: note: candidate function not viable: requires single argument 'plane', but no arguments
              were provided
            const uchar *bits(int plane) const;
                         ^
        /Users/ronakjain/eye/ws640/app/vis.cpp:22:31: warning: implicit conversion loses integer precision: 'qsizetype' (aka 'long long') to 'int'
              [-Wshorten-64-to-32]
                int y_size = eye_data.size();
                    ~~~~~~   ~~~~~~~~~^~~~~~
        1 warning and 3 errors generated.
        

        can anyone help me with how the QVideoFrame Object should be initiated with the parameters as per the new Qt API (Qt version 6.4.0)?
        Note: I've already tried to go through docs and that seems to have constructors (check below link)
        but I want to instantiate QVideoFrame Object with Frame Size, Frame Format, ...

        REFERENCES:
        https://codebrowser.dev/qt6/qtmultimedia/src/multimedia/video/qvideoframe.h.html

        Thanks
        Ronak Jain.

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @inkfil said in QT API changes from Qt 5 (5.12.11) to Qt 6 (6.4.0).:

        /Users/ronakjain/eye/ws640/app/vis.cpp:74:24: error: incomplete type 'QAbstractVideoBuffer'

        Include QAbstractVideoBuffer header file in vis.cpp

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • Paul ColbyP Offline
          Paul ColbyP Offline
          Paul Colby
          wrote on last edited by
          #4

          @jsulm said in QT API changes from Qt 5 (5.12.11) to Qt 6 (6.4.0).:

          Include QAbstractVideoBuffer header file in vis.cpp

          QAbstractVideoBuffer was made private in Qt 6.4, so you can't include its header anymore.

          Give my earlier suggestion a try:

          videoframe.map(QVideoFrame::WriteOnly);
          

          Cheers.

          1 Reply Last reply
          0
          • Paul ColbyP Paul Colby

            Hi @inkfil,

            WriteOnly has moved from QAbstractVideoBuffer::WriteOnly (Qt5) to QVideoFrame::WriteOnly (Qt6). So I guess:

             videoframe.map(QVideoFrame::WriteOnly);
            

            Cheers.

            I Offline
            I Offline
            inkfil
            wrote on last edited by
            #5

            @Paul-Colby

             videoframe.map(QVideoFrame::MapMode::WriteOnly);
            

            this worked
            but I also have other parameters that I need like Frame Format, ...

            can you please help me with that

            JonBJ 1 Reply Last reply
            0
            • I inkfil

              @Paul-Colby

               videoframe.map(QVideoFrame::MapMode::WriteOnly);
              

              this worked
              but I also have other parameters that I need like Frame Format, ...

              can you please help me with that

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #6

              @inkfil
              At Qt6 all(?) enumerated types have been moved from from a "general, high-level" class/namespace --- like Qt::AlignLeft or QVideoFrame::WriteOnly --- down into a more "specific, low-level" class/namespace --- like Qt::AlignmentFlag::AlignLeft or QVideoFrame::MapMode::WriteOnly. You need to change all your code accordingly. There isn't a definitive list, you just have to find out and do it as necessary.

              In https://stackoverflow.com/questions/72086632/migrating-to-qt6-pyqt6-what-are-all-the-deprecated-short-form-names-in-qt5 and/or https://pypi.org/project/PyQtEnumConverter/ somebody wrote some kind of converter for Python/PyQt6 for this, maybe it will give you inspiration to understand what has changed.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved