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

threaded camera deadlock on stop stream #165

Open
bsekura opened this issue Mar 6, 2024 · 2 comments
Open

threaded camera deadlock on stop stream #165

bsekura opened this issue Mar 6, 2024 · 2 comments
Labels
MediaFoundation Related to MediaFoundation (Windows) P2 High Priority (Non critical bugfix)
Milestone

Comments

@bsekura
Copy link

bsekura commented Mar 6, 2024

Threaded camera CameraCallback creates a loop camera_frame_thread_loop that continuously acquires the lock. When stop_stream is called, it tries to lock the camera first, but it never succeeds. As a result, one cannot stop the threaded camera - it continues on indefinitely.

@bsekura
Copy link
Author

bsekura commented Mar 6, 2024

This is happening on Windows using media foundation backend. frame internally calls source reader ReadSample, which is a blocking call. So this results in this thread being blocked on ReadSample for most of its time, practically holding the lock all the time.

@l1npengtul
Copy link
Owner

Ill change the MSMF backend to use the callback reader in 0.11

@l1npengtul l1npengtul added this to the 0.11 milestone Oct 12, 2024
@l1npengtul l1npengtul added P2 High Priority (Non critical bugfix) MediaFoundation Related to MediaFoundation (Windows) labels Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MediaFoundation Related to MediaFoundation (Windows) P2 High Priority (Non critical bugfix)
Projects
None yet
Development

No branches or pull requests

2 participants