Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    QCameraInfo::availableCameras() CANNOT update when remove a webcam

    General and Desktop
    2
    5
    1828
    Loading More Posts
    • 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.
    • G
      grandyang last edited by

      Hi all

      I have a question about QCameraInfo::availableCameras(). This function return all the available cameras connecting to my machine. It returns NULL when no cameras plugged in, and it works fine when I connect a webcam, however, it doesn't work when I unplugged the camera, which means it still returns the camera. Should't it return NULL when I disconnect the camera?

      Waiting for reply and thanks very much!

      1 Reply Last reply Reply Quote 0
      • yeckel
        yeckel last edited by

        It's the similar behavior as on Ubuntu 14.04:
        1)
        i) Programs starts (one camera), calling QCameraInfo::availableCameras() -> 1
        ii) connecting 2nd camera, QCameraInfo::availableCameras() -> 1

        i) Programs starts (one camera), connecting 2nd camera, availableCameras() -> 2

        Removing is not working( not showing NULL). Which OS/multimedia plugin are you using?

        1 Reply Last reply Reply Quote 0
        • yeckel
          yeckel last edited by

          Hi, I believe its a bug hot QT is using gstreamer. I tried to make a simple fix "https://codereview.qt-project.org/106730":https://codereview.qt-project.org/106730

          1 Reply Last reply Reply Quote 0
          • G
            grandyang last edited by

            Hi Yeckel

            Why my Qt5.4 with VS2010 does not contain qgstutils.cpp in the QtMultimedia folder?

            [quote author="yeckel" date="1424357096"]Hi, I believe its a bug hot QT is using gstreamer. I tried to make a simple fix "https://codereview.qt-project.org/106730":https://codereview.qt-project.org/106730[/quote]

            1 Reply Last reply Reply Quote 0
            • yeckel
              yeckel last edited by

              I have no idea :) how did you got the sourcecode? I was following "Building-Qt-5-from-Git":http://qt-project.org/wiki/Building-Qt-5-from-Git eg @git clone git://gitorious.org/qt/qt5.git qt5@ and then @perl init-repository@. Then the file should be there: qt5/qtmultimedia/src/gsttools/qgstutils.cpp

              1 Reply Last reply Reply Quote 0
              • First post
                Last post