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

[macOS] panic when setValue activeVideoMinFrameDuration and activeVideoMaxFrameDuration #202

Open
wilsonlmh opened this issue Feb 2, 2025 · 0 comments

Comments

@wilsonlmh
Copy link

wilsonlmh commented Feb 2, 2025

I tested some external USB UVC webcam on macOS. It works with alufers's patch under 0.10.x alufers@7852477
However, these two objc call panic:

            let _: () = unsafe {
                msg_send![self.inner, setValue:min_frame_duration forKey:active_video_min_frame_duration]
            };
            let _: () = unsafe {
                msg_send![self.inner, setValue:min_frame_duration forKey:active_video_max_frame_duration]
            };

Comment it out will work, but the framerate drop to ~1fps. I The min_frame_duration looks normal, and it even contain exact same value as if I choose internal Facetime camera while both selected the same framerate.

According to apple (https://developer.apple.com/documentation/avfoundation/avcapturedevice/activevideominframeduration), the exception should be invalidArgumentException, but the framerate is actually extracted from videoSupportedFrameRateRanges as required.

I don't have a clue. Also it's not able to catch even I disable the exception feature and use objc-exception::try(), although it might not help even if I can catch it.

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

1 participant