video: Add VIDEO_CTRL_FLAG_EXECUTE_ON_WRITE and VIDEO_CTRL_TYPE_BUTTON#95968
Closed
ngphibang wants to merge 2 commits intozephyrproject-rtos:mainfrom
Closed
video: Add VIDEO_CTRL_FLAG_EXECUTE_ON_WRITE and VIDEO_CTRL_TYPE_BUTTON#95968ngphibang wants to merge 2 commits intozephyrproject-rtos:mainfrom
ngphibang wants to merge 2 commits intozephyrproject-rtos:mainfrom
Conversation
Contributor
ngphibang
commented
Sep 14, 2025
- Add VIDEO_CTRL_FLAG_EXECUTE_ON_WRITE and VIDEO_CTRL_TYPE_BUTTON
Add VIDEO_CTRL_FLAG_EXECUTE_ON_WRITE flag. Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
5f1bdb2 to
c19cf16
Compare
Add VIDEO_CTRL_TYPE_BUTTON to support command-like controls. Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
c19cf16 to
01261cf
Compare
|
josuah
reviewed
Sep 15, 2025
Contributor
josuah
left a comment
There was a problem hiding this comment.
LGTM except some doubt around *type = . The rest is not important.
Thank you!
Comment on lines
+114
to
+120
| case VIDEO_CID_PAN_RELATIVE: | ||
| case VIDEO_CID_TILT_RELATIVE: | ||
| case VIDEO_CID_FOCUS_RELATIVE: | ||
| case VIDEO_CID_IRIS_RELATIVE: | ||
| case VIDEO_CID_ZOOM_RELATIVE: | ||
| *flags |= VIDEO_CTRL_FLAG_WRITE_ONLY | VIDEO_CTRL_FLAG_EXECUTE_ON_WRITE; | ||
| break; |
Contributor
There was a problem hiding this comment.
Do we also need to set *type = VIDEO_CTRL_TYPE_INTEGER? Or otherwise use __fallthrough;.
Contributor
Author
There was a problem hiding this comment.
good catch ! Thanks
Comment on lines
+378
to
381
| ctrl->type == VIDEO_CTRL_TYPE_INTEGER64 | ||
| ? ctrl->val64 == control->val64 | ||
| : ctrl->val == control->val) { | ||
| return 0; |
Contributor
There was a problem hiding this comment.
It is tempting to decompose it like that:
bool changed = ctrl->type == VIDEO_CTRL_TYPE_INTEGER64
? ctrl->val64 == control->val64
: ctrl->val == control->val;
if (changed && !(ctrl->flags & VIDEO_CTRL_FLAG_EXECUTE_ON_WRITE)) {
epc-ake
reviewed
Sep 17, 2025
| /* No new value */ | ||
| if (ctrl->type == VIDEO_CTRL_TYPE_INTEGER64 ? ctrl->val64 == control->val64 | ||
| : ctrl->val == control->val) { | ||
| if (!(ctrl->flags & VIDEO_CTRL_FLAG_EXECUTE_ON_WRITE) && |
Contributor
There was a problem hiding this comment.
I like this. It also allows for control types other than VIDEO_CTRL_TYPE_BUTTON to be able to always trigger an update.
Contributor
Author
|
I applied the suggested changes and move this to #96393. Closing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


