Open fhdream opened 5 months ago
Hello. On my PC, when I execute camera.Stop(), turned off the light. camera.Release() execute camera.Stop() internal.
Hello.
On my PC, when I execute camera.Stop(), turned off the light.
camera.Release() execute camera.Stop() internal.
Thank you for your reply.
camera.Release() execute camera.Stop() internal.
But on my PC the light always on. I don't know how to turn off the light.
It may be caused by unreasonable hardware design. My solution is to dismantle the LED light
Are you saying that light do not turned off after your app quit?
On my PC, your problem is not occur, so I can't test. But, please test the code below. What could happen.
line 418.
Releasing += () => Stop();
to
Releasing += () =>
{
vcap_source.Stop();
Stop();
};
On my pc, light turned off at the line 'vcap_source.Stop();'.
- Are you saying that light do not turned off after your app quit?
- On my PC, your problem is not occur, so I can't test. But, please test the code below. What could happen.
line 418.
Releasing += () => Stop();
to
Releasing += () => { vcap_source.Stop(); Stop(); };
On my pc, light turned off at the line 'vcap_source.Stop();'.
Stop = () => DirectShow.PlayGraph(graph, DirectShow.FILTER_STATE.Stopped); Releasing += () => { vcap_source.Stop(); Stop(); }; Released += () => { DirectShow.ReleaseInstance(ref builder); DirectShow.ReleaseInstance(ref graph); }; Properties = new PropertyItems(vcap_source);
If you want to turn off the light while using camera, it is impossible.
If you want to turn off the light while using camera, it is impossible.
What I mean is using the button to turn off the usbcamera and turn off the lights at the same time. Now the only way to turn off the camera and lights at the same time is to exit the entire application process.
OK, I understands. On my PC, when I execute camera.Stop(), turned off the light. I'm sorry, but I do not have any idea.
OK, I understands. On my PC, when I execute camera.Stop(), turned off the light. I'm sorry, but I do not have any idea.
Thanks for replying every time. I solved the problem, but I Do not execute function GetPinCategory. I don’t know if it will affect anything.
What I did was as follows
1.Do not execute this code private static Guid GetPinCategory(IPin pPin)
2.Released += () =>
{
Add Codes
DirectShow.ReleaseInstance(...);//The fuction GetVideoFormat()=>basefilter&&pin
DirectShow.ReleaseInstance(...);//The fuction CreateVideoCaptureSource()=>basefilter&&pin
DirectShow.ReleaseInstance(...);//The fuction SetVideoOutputFormat()=>config
}
When the usbcamera has lights,the lights will be turned on after executing code {moniker.BindToObject(null, null, ref guid, out value)}.
But the light is not turned off after { usbcamera.Relase(). }. How can I turn off the lights?