Results 1 to 9 of 9

Thread: ¿How to stop thread that is capturing from a webcam?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: ¿How to stop thread that is capturing from a webcam?

    Why not stop the thread first and then close the camera?

    Apart from that try to avoid using terminate(). Instead raise some flag in the thread (so that your while(1) loop becomes "while(!finish)") and call QThread::wait() afterwards (in the main thread) to pause until the worker thread exits. You shouldn't be experiencing those weird effects then.

  2. #2
    Join Date
    Jun 2008
    Posts
    11
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: ¿How to stop thread that is capturing from a webcam?

    Wysota says:
    Qt Code:
    1. Why not stop the thread first and then close the camera?
    To copy to clipboard, switch view to plain text mode 

    If I stop thread first and the close cam i get a segmentation fault and program crash.
    So i close cam first and then stop thread, this way i get error but program finish correctly.

Similar Threads

  1. Qthreads and webcam app
    By Schizo in forum Qt Programming
    Replies: 1
    Last Post: 21st June 2007, 09:17
  2. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  3. Replies: 10
    Last Post: 20th March 2007, 22:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.