Restore CameraControl and VideoProcAmp property support #63
No reviewers
Labels
No labels
Bug
Duplicate
Enhancement
Help Wanted
Invalid
Question
Wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-obsproject/libdshowcapture!63
Loading…
Reference in a new issue
No description provided.
Delete branch "prgmitchell/restoreCameraSettings"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Restore camera property support based on Exeldro's #37 with added validation of driver responses and property values to avoid restoring invalid settings. Although this is based on the original implementation, I have tried to simplify a bit. The original implementation was querying IDs 0-255 rather than just querying the 7 defined CameraControl properties and 10 defined VideoProcAmp properties, then accepting any non-failing Get result regardless of if GetRange succeeded. Tried to make this as safe as possible by required S_OK from both calls and rejecting unsupported IDs/modes/values. Further validation done on the win-dshow side before restoring settings as well.
Docs for reference:
CameraControlProperty
VideoProcAmpProperty
Motivation and Context
People ask for this often enough, there are even some third party tools meant to save/restore these settings for you so I wanted to try to fix it within obs-studio again.
How Has This Been Tested?
Built a version of OBS with win-dshow changes that I will be PRing as well, tested that properties were saved and restored without issues. I previously had issues with the original implementation using my Camlink so I tested the same scenario to confirm that invalid settings were no longer being restored as well.
Types of changes
Checklist:
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.