Page 1 of 1

How to use VideoSourceError

PostPosted: Wed Apr 24, 2019 4:02 am
by JTALATALA
I want to stop the VideoSource when there is an error to prevent application from hanging.
How can i use the VideoSourceError to do that.

this is what i have so far and it's not working.

FinalVideoSource = new VideoCaptureDevice(camMoniker);
FinalVideoSource.NewFrame += FinalVideoSource_NewFrame;
FinalVideoSource.VideoSourceError += FinalVideoSource_VideoSourceError;
FinalVideoSource.Start();

private void FinalVideoSource_VideoSourceError(object sender, VideoSourceErrorEventArgs eventArgs)
{
FinalVideoSource.Stop();
FinalVideoSource.SignalToStop();
}

Re: How to use VideoSourceError

PostPosted: Wed Apr 24, 2019 8:57 am
by andrew.kirillov
JTALATALA wrote:I want to stop the VideoSource when there is an error to prevent application from hanging.

Application should not really hang in case of errors comming from video source. Yes, video will not come. But nothing will hang either. If it does happen, then something else is done wrong.

JTALATALA wrote:this is what i have so far and it's not working.

What exactly does not work? Don't put Stop() there, just SignalToStop().