Called when thread is started
| 36 | |
| 37 | // Called when thread is started |
| 38 | void* CaptureThread::Entry() |
| 39 | { |
| 40 | while (true) |
| 41 | { |
| 42 | // check to see if the thread should exit |
| 43 | if (TestDestroy() == true) |
| 44 | { |
| 45 | break; |
| 46 | } |
| 47 | |
| 48 | if (capturing == CAPTURE) |
| 49 | { |
| 50 | // get a new image |
| 51 | CaptureFrame(); |
| 52 | } else if (capturing == PREVIEW) |
| 53 | { |
| 54 | |
| 55 | // get a new image and show it on screen |
| 56 | CaptureFrame(); |
| 57 | SendFrame(imageQueue.back()); |
| 58 | } else if (capturing == IDLE) |
| 59 | { |
| 60 | Sleep(10); |
| 61 | } else if (capturing == STOP) |
| 62 | { |
| 63 | break; |
| 64 | } |
| 65 | |
| 66 | Yield(); |
| 67 | } |
| 68 | |
| 69 | return NULL; |
| 70 | } |
| 71 | |
| 72 | void CaptureThread::CaptureFrame() |
| 73 | { |
nothing calls this directly
no outgoing calls
no test coverage detected