CameraView::~CameraView() { DEBUGMSG(("starting to stop cameraView...")); if(isCameraConnected) { // Stop processing thread if(processingThread->isRunning()) stopProcessingThread(); // Stop capture thread if(captureThread->isRunning()) stopCaptureThread(); // Remove from shared buffer sharedImageBuffer->remove(id); // Disconnect camera if(captureThread->disconnectCamera()){ // INFOMSG(("[ %d ]Camera successfully disconnected.",id)); }else{ // INFOMSG(( "[ %d ] WARNING: Camera already disconnected.",id)); } } while(captureThread->isRunning()) { usleep(2000); INFOMSG((".")); } // Delete UI delete ui; }
void Controller::disconnectCamera() { // Stop processing thread if(processingThread->isRunning()) stopProcessingThread(); // Stop capture thread if(captureThread->isRunning()) stopCaptureThread(); // Clear image buffer clearImageBuffer(); // Disconnect camera captureThread->disconnectCamera(); // Delete threads deleteCaptureThread(); deleteProcessingThread(); // Delete image buffer deleteImageBuffer(); } // disconnectCamera()
/* * Causes the various threads to stop gracefully. * Allow each thread to handle its own resources, and simply delegate calls to them. */ void Controller::dropVideo() { if (captureThread->isRunning()) stopCaptureThread(); captureThread->dropVideo(); deleteCaptureThread(); if (displayThread->isRunning()) stopDisplayThread(); displayThread->dropFrame(); deleteDisplayThread(); if (processThread->isRunning()) stopProcessingThread(); processThread->dropFrame(); //Remember, only the captureThread keeps track of the video. deleteProcessingThread(); qDebug() << "Finished everything!"; }
CameraView::~CameraView() { if(m_isCameraConnected) { // Stop processing thread if (m_processingThread->isRunning()) { stopProcessingThread(); } // Stop capture thread if (m_captureThread->isRunning()) { stopCaptureThread(); } // Automatically start frame processing (for other streams) if (m_sharedImageBuffer->isSyncEnabledForDeviceNumber(m_deviceNumber)) { m_sharedImageBuffer->setSyncEnabled(true); } // Remove from shared buffer m_sharedImageBuffer->removeByDeviceNumber(m_deviceNumber); // Disconnect camera if (m_captureThread->disconnectCamera()) { qDebug() << "[" << m_deviceNumber << "] Camera successfully disconnected."; } else { qDebug() << "[" << m_deviceNumber << "] WARNING: Camera already disconnected."; } } // Delete UI delete ui; }
void AudioOss::stopProcessing() { stopProcessingThread( this ); }
void AudioAlsa::stopProcessing() { stopProcessingThread( this ); }
void AudioSndio::stopProcessing( void ) { stopProcessingThread( this ); }