pion / mediadevices

Go implementation of the MediaDevices API.
https://pion.ly/
MIT License
521 stars 120 forks source link

Add FPS Props for Linux Cameras #487

Closed seanavery closed 1 year ago

seanavery commented 1 year ago

Description

This PR allows for retrieving and setting FPS properties on Linux cameras. Like FrameSize, Discrete and Stepwise FrameRate returns are supported.

A simple check is added in the fitness function to avoid adding fps comparisons on MacOS and Screen drivers.

Implementation depends on this blackjack/webcam PR.

Update: fps pr for blackjack/webcam has been merged!

Testing

Manual tests

Make sure there are no regressions across platforms (fitness distance is not affected).

Go tests

seanavery commented 1 year ago

@edaniels @bazile-clyde Tagging for review.

seanavery commented 1 year ago

@edaniels Added tests.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 19.14% and project coverage change: +0.19 :tada:

Comparison is base (8748614) 58.83% compared to head (92b6f82) 59.02%.

:exclamation: Current head 92b6f82 differs from pull request most recent head 4a1bdfe. Consider uploading reports for the commit 4a1bdfe to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #487 +/- ## ========================================== + Coverage 58.83% 59.02% +0.19% ========================================== Files 63 63 Lines 3826 3854 +28 ========================================== + Hits 2251 2275 +24 - Misses 1444 1446 +2 - Partials 131 133 +2 ``` | [Impacted Files](https://app.codecov.io/gh/pion/mediadevices/pull/487?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion) | Coverage Δ | | |---|---|---| | [pkg/driver/camera/camera\_linux.go](https://app.codecov.io/gh/pion/mediadevices/pull/487?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion#diff-cGtnL2RyaXZlci9jYW1lcmEvY2FtZXJhX2xpbnV4Lmdv) | `26.41% <11.62%> (-1.13%)` | :arrow_down: | | [pkg/prop/prop.go](https://app.codecov.io/gh/pion/mediadevices/pull/487?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion#diff-cGtnL3Byb3AvcHJvcC5nbw==) | `75.83% <100.00%> (+1.83%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/pion/mediadevices/pull/487/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

seanavery commented 1 year ago

Cleaning up git history in preparation for merge.