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. QCamera busy problem
Qt 6.11 is out! See what's new in the release blog

QCamera busy problem

Scheduled Pinned Locked Moved Unsolved General and Desktop
16 Posts 5 Posters 3.3k Views 2 Watching
  • 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.
  • mrjjM Offline
    mrjjM Offline
    mrjj
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi
    Why does it say that ?
    You try to open it multiple times or does your app crash and dont clean up ?
    I have not seen such feature in QCamera and it seems to be very tied to the OS
    but there might be :)

    C 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #3

      Hi,

      What are you doing with that camera ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • mrjjM mrjj

        Hi
        Why does it say that ?
        You try to open it multiple times or does your app crash and dont clean up ?
        I have not seen such feature in QCamera and it seems to be very tied to the OS
        but there might be :)

        C Offline
        C Offline
        CptN3m0
        wrote on last edited by
        #4

        @mrjj said in QCamera busy problem:

        Hi
        Why does it say that ?
        You try to open it multiple times or does your app crash and dont clean up ?
        I have not seen such feature in QCamera and it seems to be very tied to the OS
        but there might be :)

        @SGaist said in QCamera busy problem:

        Hi,

        What are you doing with that camera ?

        Hi, its just when the app crash suddenly, the camera dont clean up and I got an error message at the next run, that the camera is busy.

        T 1 Reply Last reply
        0
        • C CptN3m0

          @mrjj said in QCamera busy problem:

          Hi
          Why does it say that ?
          You try to open it multiple times or does your app crash and dont clean up ?
          I have not seen such feature in QCamera and it seems to be very tied to the OS
          but there might be :)

          @SGaist said in QCamera busy problem:

          Hi,

          What are you doing with that camera ?

          Hi, its just when the app crash suddenly, the camera dont clean up and I got an error message at the next run, that the camera is busy.

          T Offline
          T Offline
          thippu
          wrote on last edited by thippu
          #5

          @CptN3m0 Hi,
          are u using c++?
          solution is:
          delete the QCamera object before u initialize it,
          do like this to avoid program crash

          //cam is QCamera Pointer object
          if(cam)
          {
          delete cam;
          }
          //Then do initialization of cam object 
          
          
          

          It will frees the previous resource if it is still holding.
          Let me the status of ur problem.
          :)

          jsulmJ 1 Reply Last reply
          0
          • T thippu

            @CptN3m0 Hi,
            are u using c++?
            solution is:
            delete the QCamera object before u initialize it,
            do like this to avoid program crash

            //cam is QCamera Pointer object
            if(cam)
            {
            delete cam;
            }
            //Then do initialization of cam object 
            
            
            

            It will frees the previous resource if it is still holding.
            Let me the status of ur problem.
            :)

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

            @thippu You are aware that there is nothing to delete if you did not yet initialize it?

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

            T 1 Reply Last reply
            0
            • jsulmJ jsulm

              @thippu You are aware that there is nothing to delete if you did not yet initialize it?

              T Offline
              T Offline
              thippu
              wrote on last edited by
              #7

              @jsulm yeah,
              It won't enter the if statement ,if there is nothing;

              jsulmJ 1 Reply Last reply
              0
              • T thippu

                @jsulm yeah,
                It won't enter the if statement ,if there is nothing;

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

                @thippu That's the point: it will not solve the issue as it will not do anything

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

                T 2 Replies Last reply
                0
                • jsulmJ jsulm

                  @thippu That's the point: it will not solve the issue as it will not do anything

                  T Offline
                  T Offline
                  thippu
                  wrote on last edited by thippu
                  #9

                  @jsulm How can you say, it can not solve?Have you tried this?

                  jsulmJ 1 Reply Last reply
                  0
                  • T thippu

                    @jsulm How can you say, it can not solve?Have you tried this?

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

                    @thippu You start the app, it crashes and leaves the device in busy state. Now you start the app again and execute this lines:

                    // cam will not be initialized, so if part will not be executed
                    // So, how can this fix the problem?
                    if(cam)
                    {
                        delete cam; // This will NEVER be executed
                    }
                    

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

                    T 1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      @thippu That's the point: it will not solve the issue as it will not do anything

                      T Offline
                      T Offline
                      thippu
                      wrote on last edited by
                      #11

                      @jsulm .It will enter the if statement ,if there is any previous resource right?

                      jsulmJ T 2 Replies Last reply
                      0
                      • T thippu

                        @jsulm .It will enter the if statement ,if there is any previous resource right?

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

                        @thippu There will not be previous ressource in the app as you start the app again...

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

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #13

                          The memory used in an application run has nothing to do with the memory used in the next run. Therefore an object allocated in one application run won't be available at all in the next run. The memory space have nothing in common.

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          T 1 Reply Last reply
                          1
                          • jsulmJ jsulm

                            @thippu You start the app, it crashes and leaves the device in busy state. Now you start the app again and execute this lines:

                            // cam will not be initialized, so if part will not be executed
                            // So, how can this fix the problem?
                            if(cam)
                            {
                                delete cam; // This will NEVER be executed
                            }
                            
                            T Offline
                            T Offline
                            thippu
                            wrote on last edited by
                            #14

                            @jsulm said in QCamera busy problem:

                            @thippu You start the app, it crashes and leaves the device in busy state. Now you start the app again and execute this lines:

                            // cam will not be initialized, so if part will not be executed
                            // So, how can this fix the problem?
                            if(cam)//if cam not initialized this statement will not be executed right?
                            {
                                delete cam; // This will NEVER be executed
                            }
                            
                            1 Reply Last reply
                            0
                            • T thippu

                              @jsulm .It will enter the if statement ,if there is any previous resource right?

                              T Offline
                              T Offline
                              thippu
                              wrote on last edited by
                              #15

                              @thippu yes ,you are getting it;

                              1 Reply Last reply
                              0
                              • SGaistS SGaist

                                The memory used in an application run has nothing to do with the memory used in the next run. Therefore an object allocated in one application run won't be available at all in the next run. The memory space have nothing in common.

                                T Offline
                                T Offline
                                thippu
                                wrote on last edited by
                                #16

                                @SGaist Yes, true

                                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