-
Notifications
You must be signed in to change notification settings - Fork 58
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
[HACK][Camera2] init parameters #122
base: camera2
Are you sure you want to change the base?
Conversation
Change-Id: I16aa912382396026204266fe80c796774b7aa5a7
Change-Id: Id4e30769f50f44333521347075f47e29ec91b790
// Solution: propagate the initial exposure compensation to all subsequent retries before the preview and other requests are 'on'. | ||
std::string exposure_compensation = camera->m_param_map["exposure-compensation"]; | ||
camera->m_param_map = param_map; | ||
if (exposure_compensation.size()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (exposure_compensation.size()) { | |
if (param_map.count("exposure-compensation") == 0 && exposure_compensation.size()) { |
from my understanding there is no longer a way to actually change the value with your code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, the code: the []
operator returns a default constructed string if there's none, that's why I check for size. It also creates an entry, so the count
may fail next.
Indeed, checking for its' presence with count would be better.
Secondly: The quick hack is around the fact that jolla-camera
(or gst-droid
itself) does not initialize the camera with the previous exposure compensation setting but ONCE. This change propagates that one time value to all the params at initialization until there's an actual request (be it preview, image or video request) is set - so the code only runs when none of the above are set.
Then, the usual get params / set params should work. So the jolla-camera
can now set other values and store other values to use for the next session. My hunch is that the lack of setting the exposure-compensation at the beginning (because not even preview is on) triggers a read of the default compensation and we're left with that - but I am open to being corrected!
Thanks for your comment! This is just a "here, I got it working on my device" PR and it is a HACK. Gstreamer should be aware of this initialization process (maybe?) and act properly with camera2.
This PR is a hack as the title says.
There are two observations around current camera2 initialization that this fixes:
The fix for this was to make a copy of the params and re-apply them when actual requests are alive
exposure-compensation
is part of only ONE initial set of params sent from gst-droid, and not the second one. So there are at least TWO param updates before at least the preview request is alive, and only the first one has the exposure. The fix was to always propagate the first exposure-compensation sent until the copied params are applied at actual initialization.I realize this is not a fix at all - it is just some info.
It does help me with 1. applying edge-mode and noisereduction initially and 2. applying the previous exposure