Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Understanding when the virtual camera is in use and when not #56

Open
yilmazzosmann opened this issue Sep 3, 2024 · 6 comments
Open

Comments

@yilmazzosmann
Copy link

Hello,

Great project! Thanks a lot!
Both the scWaitForConnection and scIsConnected functions get True forever once the camera is opened or the connection is secured. Is it possible to return True let's say when the softcam virtual camera is in use, but if the user changes to another camera then return False? Not to return True forever. I want to fully know when this virtual camera is in use or not, if possible.
Thanks a lot!

@tshino
Copy link
Owner

tshino commented Sep 4, 2024

Thank you for asking!
Your understanding of the behavior of existing functions is correct. Regarding the question, let me think.

@yilmazzosmann
Copy link
Author

I did not fully get the working principle of how it gets to understand it is connected, that I chose that virtual camera in use, maybe in a way if that condition can be checked continuously, that can solve the issue for me

@yilmazzosmann
Copy link
Author

Any news?

@tshino
Copy link
Owner

tshino commented Sep 11, 2024

Sorry for my late response.

Technically that should be possible, but its implementation is not trivial and may require careful coding.

At first, I thought that reference counting of connected applications could be a solution. However, it won't work because a process easily stops without decrementing reference counts when it crashes or is killed by the system.
I think a watchdog to monitor whether the receiver application is alive or not could be a solution.

@yilmazzosmann
Copy link
Author

Do you think it is addable to the current watchdog implementation?

@tshino
Copy link
Owner

tshino commented Sep 14, 2024

Yes.
As you noticed, we already have Watchdog class in the library. It is used to monitor whether the sender is alive as opposed to the abovementioned case. I think applying the class in the opposite direction is also possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants