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

Call stopRunning on captureSession when freeing #382

Open
hetelek opened this issue Mar 12, 2022 · 1 comment
Open

Call stopRunning on captureSession when freeing #382

hetelek opened this issue Mar 12, 2022 · 1 comment
Labels
bug Something isn't working question Further information is requested

Comments

@hetelek
Copy link

hetelek commented Mar 12, 2022

Currently, the green light (on a Mac) indicating the camera is in use never goes off, even after closing the videoTrack. I think stopRunning should be called on the captureSession when the videoTrack is closed. This patch seems to work for me:

diff --git a/pkg/avfoundation/AVFoundationBind/AVFoundationBind.m b/pkg/avfoundation/AVFoundationBind/AVFoundationBind.m
index ed75c99..db8f838 100644
--- a/pkg/avfoundation/AVFoundationBind/AVFoundationBind.m
+++ b/pkg/avfoundation/AVFoundationBind/AVFoundationBind.m
@@ -236,6 +236,7 @@ STATUS AVBindSessionFree(PAVBindSession *ppSession) {
     CHK(ppSession != NULL, STATUS_NULL_ARG);
     PAVBindSession pSession = *ppSession;
     if (pSession->refCaptureSession != NULL) {
+        [pSession->refCaptureSession stopRunning];
         [pSession->refCaptureSession release];
         pSession->refCaptureSession = NULL;
     }

or maybe call AVBindSessionClose instead?

@EmrysMyrddin
Copy link
Contributor

Do you still experience this ? I have tested it and the green light stops when I close the video track.

Do you have an example that triggers the bug for you ?

@EmrysMyrddin EmrysMyrddin added bug Something isn't working question Further information is requested labels Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants