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. Access denied finding property "vendor.camera.aux.packagelist"
Forum Updated to NodeBB v4.3 + New Features

Access denied finding property "vendor.camera.aux.packagelist"

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
16 Posts 3 Posters 4.8k 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 Ivelin

    Hello, I have tried a simpler codebase.

    Currently I have main.cpp

    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
    
        checkPermission();
        checkPermission1();
    
        QCamera *camera = new QCamera;
        QMediaCaptureSession m_captureSession;
        QImageCapture *m_imageCapture;
    
        camera = new QCamera(QCameraDevice::FrontFace);
        m_captureSession.setCamera(camera);
    
        m_imageCapture = new QImageCapture;
        m_captureSession.setImageCapture(m_imageCapture);
    
        camera->start();
        int id = m_imageCapture->captureToFile("/storage/emulated/0/Download/f.jpeg");
    
        qDebug() << "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAa";
    
        return a.exec();
    }
    

    on Xiaomi Redmi Note 11 Pro 5G I get the very same error, but on Samsung A71 I don't have any errors, but the file still doesn't get saved.

    Could someone please help me find out why that is ? What's the solution of this ?

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

    @Ivelin said in Access denied finding property "vendor.camera.aux.packagelist":

    camera->start();
    int id = m_imageCapture->captureToFile("/storage/emulated/0/Download/f.jpeg");

    I guess you need to wait for camera to actually start (maybe https://doc.qt.io/qt-6/qcamera.html#active-prop)?

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

    I 2 Replies Last reply
    0
    • jsulmJ jsulm

      @Ivelin said in Access denied finding property "vendor.camera.aux.packagelist":

      camera->start();
      int id = m_imageCapture->captureToFile("/storage/emulated/0/Download/f.jpeg");

      I guess you need to wait for camera to actually start (maybe https://doc.qt.io/qt-6/qcamera.html#active-prop)?

      I Offline
      I Offline
      Ivelin
      wrote on last edited by Ivelin
      #4

      @jsulm, I suppose not because camera->isActive() returns true (before I call the capture method)!

      It should be something else we are talking about.

      Could you please advice something I've been stuck here for 3-4 days now..

      1 Reply Last reply
      0
      • jsulmJ jsulm

        @Ivelin said in Access denied finding property "vendor.camera.aux.packagelist":

        camera->start();
        int id = m_imageCapture->captureToFile("/storage/emulated/0/Download/f.jpeg");

        I guess you need to wait for camera to actually start (maybe https://doc.qt.io/qt-6/qcamera.html#active-prop)?

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

        @jsulm, hello again.

        Thankfully to your suggestion I've been able to get somewhere!

        Here's what I have now

        main.cpp

        int main(int argc, char *argv[])
        {
            QApplication a(argc, argv);
        
            checkPermission();
            checkPermission1();
        
            QWidget widget;
            QPushButton btn;
            btn.setMinimumSize(QSize(200, 200));
            btn.setText("Take a picutre");
        
            QVBoxLayout layout;
            layout.addWidget(&btn);
            widget.setLayout(&layout);
        
            QCamera *camera = new QCamera;
            QMediaCaptureSession m_captureSession;
            QImageCapture *m_imageCapture;
        
            camera = new QCamera(QCameraDevice::FrontFace);
            m_captureSession.setCamera(camera);
        
            m_imageCapture = new QImageCapture;
            m_captureSession.setImageCapture(m_imageCapture);
        
            camera->start();
        
            QObject::connect(&btn, &QPushButton::clicked, [m_imageCapture, camera]()
                             {
                                 qDebug() << camera->isActive() << " " << m_imageCapture->isReadyForCapture();
                                 int id = m_imageCapture->captureToFile("/storage/emulated/0/Download/f.jpeg"); });
        
            widget.show();
            return a.exec();
        }
        

        The interesting part in this code is the qDebug outout for camera->isActive() and m_imageCapture->isReadyForCapture()!

        camera->isActive() is true, but m_imageCature->isReadyForCapture() is false.

        However, I have no idea why ?

        Could someone take a look ? Why is m_imageCapture->isReadyForCapture() false ? How can I fix it?

        jsulmJ 1 Reply Last reply
        0
        • I Ivelin

          @jsulm, hello again.

          Thankfully to your suggestion I've been able to get somewhere!

          Here's what I have now

          main.cpp

          int main(int argc, char *argv[])
          {
              QApplication a(argc, argv);
          
              checkPermission();
              checkPermission1();
          
              QWidget widget;
              QPushButton btn;
              btn.setMinimumSize(QSize(200, 200));
              btn.setText("Take a picutre");
          
              QVBoxLayout layout;
              layout.addWidget(&btn);
              widget.setLayout(&layout);
          
              QCamera *camera = new QCamera;
              QMediaCaptureSession m_captureSession;
              QImageCapture *m_imageCapture;
          
              camera = new QCamera(QCameraDevice::FrontFace);
              m_captureSession.setCamera(camera);
          
              m_imageCapture = new QImageCapture;
              m_captureSession.setImageCapture(m_imageCapture);
          
              camera->start();
          
              QObject::connect(&btn, &QPushButton::clicked, [m_imageCapture, camera]()
                               {
                                   qDebug() << camera->isActive() << " " << m_imageCapture->isReadyForCapture();
                                   int id = m_imageCapture->captureToFile("/storage/emulated/0/Download/f.jpeg"); });
          
              widget.show();
              return a.exec();
          }
          

          The interesting part in this code is the qDebug outout for camera->isActive() and m_imageCapture->isReadyForCapture()!

          camera->isActive() is true, but m_imageCature->isReadyForCapture() is false.

          However, I have no idea why ?

          Could someone take a look ? Why is m_imageCapture->isReadyForCapture() false ? How can I fix it?

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

          @Ivelin Connect a slot to https://doc.qt.io/qt-6/qimagecapture.html#readyForCaptureChanged - is it called?
          You can also check https://doc.qt.io/qt-5/qcamera.html#captureMode-prop

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

          I 1 Reply Last reply
          0
          • jsulmJ jsulm

            @Ivelin Connect a slot to https://doc.qt.io/qt-6/qimagecapture.html#readyForCaptureChanged - is it called?
            You can also check https://doc.qt.io/qt-5/qcamera.html#captureMode-prop

            I Offline
            I Offline
            Ivelin
            wrote on last edited by Ivelin
            #7

            @jsulm, no it is not being called. Seems like a bug?

                QMediaCaptureSession m_captureSession;
                QImageCapture *m_imageCapture = new QImageCapture;
            
                camera = new QCamera(QCameraDevice::FrontFace);
                m_captureSession.setCamera(camera);
            
                m_captureSession.setImageCapture(m_imageCapture);
            
                camera->start();
            
                if (!m_imageCapture->isReadyForCapture())
                {
                    qDebug() << "Camera is not ready for capture";
                }
            
                QObject::connect(&btn, &QPushButton::clicked, [m_imageCapture, camera]()
                                 {
                                     qDebug() << camera->isActive() << " " << m_imageCapture->isReadyForCapture();
                                     int id = m_imageCapture->captureToFile("/storage/emulated/0/Download/f.jpeg"); });
            
                QObject::connect(m_imageCapture, &QImageCapture::readyForCaptureChanged, []()
                                 { qDebug() << "READYYYYYYYYYYYYYYYYYY"; });
            
            

            There is no "READYYYYYYYYYYYYYYYYYY" in my logs. I have tried both on Xiaomi and Samsung.

            jsulmJ 1 Reply Last reply
            0
            • I Ivelin

              @jsulm, no it is not being called. Seems like a bug?

                  QMediaCaptureSession m_captureSession;
                  QImageCapture *m_imageCapture = new QImageCapture;
              
                  camera = new QCamera(QCameraDevice::FrontFace);
                  m_captureSession.setCamera(camera);
              
                  m_captureSession.setImageCapture(m_imageCapture);
              
                  camera->start();
              
                  if (!m_imageCapture->isReadyForCapture())
                  {
                      qDebug() << "Camera is not ready for capture";
                  }
              
                  QObject::connect(&btn, &QPushButton::clicked, [m_imageCapture, camera]()
                                   {
                                       qDebug() << camera->isActive() << " " << m_imageCapture->isReadyForCapture();
                                       int id = m_imageCapture->captureToFile("/storage/emulated/0/Download/f.jpeg"); });
              
                  QObject::connect(m_imageCapture, &QImageCapture::readyForCaptureChanged, []()
                                   { qDebug() << "READYYYYYYYYYYYYYYYYYY"; });
              
              

              There is no "READYYYYYYYYYYYYYYYYYY" in my logs. I have tried both on Xiaomi and Samsung.

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

              @Ivelin What Qt version do you use? Try with the latest one.

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

              I 1 Reply Last reply
              0
              • jsulmJ jsulm

                @Ivelin What Qt version do you use? Try with the latest one.

                I Offline
                I Offline
                Ivelin
                wrote on last edited by
                #9

                @jsulm, I am using Qt 6.2.4.

                I try to stick to something older, so there is lower chance for bugs, unfortunately this doesn't seem to be the case, so I will try the latest one.

                jsulmJ JoeCFDJ 2 Replies Last reply
                0
                • I Ivelin

                  @jsulm, I am using Qt 6.2.4.

                  I try to stick to something older, so there is lower chance for bugs, unfortunately this doesn't seem to be the case, so I will try the latest one.

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

                  @Ivelin said in Access denied finding property "vendor.camera.aux.packagelist":

                  I try to stick to something older, so there is lower chance for bugs

                  Bugs get fixed in newer versions (of course new bugs are also introduced :-)).

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

                  I 1 Reply Last reply
                  0
                  • jsulmJ jsulm

                    @Ivelin said in Access denied finding property "vendor.camera.aux.packagelist":

                    I try to stick to something older, so there is lower chance for bugs

                    Bugs get fixed in newer versions (of course new bugs are also introduced :-)).

                    I Offline
                    I Offline
                    Ivelin
                    wrote on last edited by
                    #11

                    @jsulm, hello

                    Late update. It is not the version I am pretty sure.

                    The Qt 6.2 example for camera works just fine, so it must be something from my code.

                    Yes, I am still banging my head, so I can fix that problem. it is been a week now I am getting pretty desperate

                    The problem must be in the code.

                    Could someone please help me ? Any Ideas ?

                    1 Reply Last reply
                    0
                    • I Offline
                      I Offline
                      Ivelin
                      wrote on last edited by
                      #12

                      I also went over the whole documentation, but still can't see where is the problem in this simple code..

                      1 Reply Last reply
                      0
                      • I Ivelin

                        @jsulm, I am using Qt 6.2.4.

                        I try to stick to something older, so there is lower chance for bugs, unfortunately this doesn't seem to be the case, so I will try the latest one.

                        JoeCFDJ Offline
                        JoeCFDJ Offline
                        JoeCFD
                        wrote on last edited by
                        #13

                        @Ivelin QMultimedia module was reworked in Qt6. Better to use the latest version of Qt6.

                        I 1 Reply Last reply
                        0
                        • JoeCFDJ JoeCFD

                          @Ivelin QMultimedia module was reworked in Qt6. Better to use the latest version of Qt6.

                          I Offline
                          I Offline
                          Ivelin
                          wrote on last edited by
                          #14

                          @JoeCFD, I am going to try With Qt 6.6 ( latest current ), but again the qt camera example for qt 6.2 worked just fine, so I suppose it should be a problem in the code.

                          JoeCFDJ 1 Reply Last reply
                          0
                          • I Ivelin

                            @JoeCFD, I am going to try With Qt 6.6 ( latest current ), but again the qt camera example for qt 6.2 worked just fine, so I suppose it should be a problem in the code.

                            JoeCFDJ Offline
                            JoeCFDJ Offline
                            JoeCFD
                            wrote on last edited by
                            #15

                            @Ivelin put or zip your whole test code somewhere for other people to be able to access for testing.

                            I 1 Reply Last reply
                            0
                            • JoeCFDJ JoeCFD

                              @Ivelin put or zip your whole test code somewhere for other people to be able to access for testing.

                              I Offline
                              I Offline
                              Ivelin
                              wrote on last edited by
                              #16

                              @JoeCFD, I will, but I just think that I have found something !

                              This is my current code:

                              int main(int argc, char *argv[])
                              {
                                  QApplication a(argc, argv);
                              
                                  checkPermission();
                                  checkPermission1();
                              
                                  QWidget widget;
                                  QPushButton btn;
                                  btn.setMinimumSize(QSize(200, 200));
                                  btn.setText("Take a picutre");
                              
                                  QVBoxLayout layout;
                                  layout.addWidget(&btn);
                                  widget.setLayout(&layout);
                              
                                  QCamera *camera = new QCamera;
                                  QMediaCaptureSession m_captureSession;
                                  QImageCapture *m_imageCapture;
                              
                                  camera = new QCamera(QCameraDevice::FrontFace);
                                  m_captureSession.setCamera(camera);
                              
                                  m_imageCapture = new QImageCapture;
                                  m_captureSession.setImageCapture(m_imageCapture);
                                  QObject::connect(camera, &QCamera::errorOccurred, [&camera]()
                                                   {
                                      if (camera->error() != QCamera::NoError)
                                          qDebug() << "ERROR: " << camera->errorString(); });
                              
                                  QObject::connect(m_imageCapture, &QImageCapture::errorOccurred, [](int id, const QImageCapture::Error error, const QString &errorString)
                                                   { qDebug() << "ERROR: " << errorString; });
                              
                                  camera->start();
                              
                                  QObject::connect(&btn, &QPushButton::clicked, [m_imageCapture, camera]()
                                                   {
                                                       qDebug() << camera->isActive() << " " << m_imageCapture->isReadyForCapture();
                                                       int id = m_imageCapture->captureToFile("/storage/emulated/0/Download/f.jpeg"); });
                              
                                  widget.show();
                                  return a.exec();
                              }
                              

                              After having those QObject:connect for rrorOccured when clicking the button, so I can take a picture I get:

                              ERROR:  "Could not capture in stopped state"
                              

                              Maybe this is a valid lead ?

                              Could someone take a look?

                              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