예제 #1
0
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;
}
예제 #2
0
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()
예제 #3
0
/*
 * 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;
}
예제 #5
0
파일: AudioOss.cpp 프로젝트: qnebra/lmms
void AudioOss::stopProcessing()
{
	stopProcessingThread( this );
}
예제 #6
0
파일: AudioAlsa.cpp 프로젝트: uro5h/lmms
void AudioAlsa::stopProcessing()
{
	stopProcessingThread( this );
}
예제 #7
0
파일: AudioSndio.cpp 프로젝트: BaraMGB/lmms
void AudioSndio::stopProcessing( void )
{
	stopProcessingThread( this );
}