
shaimaabes
Egypt
Asked
— Edited
Hello , I want to control the JD camera from my visual studio plugin , I've try the following code but it doesn't work EZ_B.Camera.GetVideoCaptureDevices();
plz I need ur help as soon as possible .
@shaimaabes,
Most of us have been students too (in my time it was much more difficult) limited internet, and no money to buy IT books, we hang out in public book stores, reading, copying code & information from store's books until a clerk pointed the exit door.
Windows Form Application Example code post #15: the initial code have everything you need to handle the EZB camera video frames.
i took a small brake to improve the code, please check the github repository.
the code shows video feed in the form application, is not rocket science, but if you have doubts before, i really hope they will be gone.
i had also some extra concurrency code to prevent future issues.
@ptp i should add that the OnNewFrame event will never execute twice. The event is indeed executed on a worker thread (not ui), however it will never execute concurrent or require locks.
If your OnNewFrame event runs for a lengthy time, any new frames that arrive will be skipped. The OnNewFrame event will only be raised when a new frame arrives and there is no current instance of the OnNewFrame event running.
Eng ,@ptp
thanks verrrrrrrrrryyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy muchhhhhhhhhhhhhhhhhhhh for ur kindness & ur smart behavior when u answering me , u are an excellent man , & no words would give u ur value .
yeah nw is mush better for students to learn but u know that sometimes our minds get stopped .
anyway I appreciate ur words , kindness & ur effort
yep, i assumed that
this is a good advice (re quote, to enforce the importance):
the concurrency issues are: OneSecondTimer_Tick (measuring) the fps counter, is a Windows Form Timer so the execution is in the UI thread and changing a counter variable same used for OnFrame event, minor detail to enforce two threads using the same variable.
OnNewFrame, Invoke to the UI/Control/Thread (i assumed it wasn't the ui thread, and you confirmed).
like i said no "rocket science code", but if you follow the good practices (even with simple code) it will save your neck later if you keep adding code
@DJ: One little detail, the camera's close event is being called twice, i double checked the code... not a big deal, i noticed due the output debug.