Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QCameraInfo::availableCameras() CANNOT update when remove a webcam
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.0k 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.
  • G Offline
    G Offline
    grandyang
    wrote on last edited by
    #1

    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
    0
    • yeckelY Offline
      yeckelY Offline
      yeckel
      wrote on last edited by
      #2

      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
      0
      • yeckelY Offline
        yeckelY Offline
        yeckel
        wrote on last edited by
        #3

        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
        0
        • G Offline
          G Offline
          grandyang
          wrote on last edited by
          #4

          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
          0
          • yeckelY Offline
            yeckelY Offline
            yeckel
            wrote on last edited by
            #5

            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
            0

            • Login

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