secile / UsbCamera

C# source code for using usb camera and web camera in WinForms/WPF. With only single CSharp source code. No external library required.
MIT License
179 stars 55 forks source link

Release taking long time sometimes #19

Closed EugeneQilo closed 1 year ago

EugeneQilo commented 1 year ago

Hello @secile, The Release is taking long time intermittently, I'm not sure why... tracking the call stack, it hangs on this line case FILTER_STATE.Stopped: mediaControl.Stop(); break;

Any idea what could be the reason?

Steps to reproduce: 1) Start the camera 2) Release the camera 3) Keep repeating steps 1 to 2, it will eventually happen....

Tested with my laptop integrated camera

secile commented 1 year ago

Hello. I tested as follow, but I can not reproduce your problem. (by using SampleProject/UsbCameraForms project.)

(1) add button3 and if clicked, execute camera.Start(). (2) add button4 and if clicked, execute camera.Stop(). (3) pressing buttons 3 and 4 repeatedly.

Steps to reproduce:

  1. Start the camera
  2. Release the camera
  3. Keep repeating step1 to 2, it will eventually happen....

Are you executing step1 and step2 with no wait? (no interval?) could you show me your code?