fix(camera): prefer DConfig resolution over local config (BUG-366203)#490
Merged
deepin-bot[bot] merged 1 commit intoJun 29, 2026
Conversation
When preferredResolution is set via DConfig, use it directly instead of the locally cached resolution from config file on first launch. DConfig的preferredResolution配置优先于本地配置文件中的分辨率, 修复首次打开应用时仍使用本地旧配置的问题。 Log: 修复preferredResolution首次启动不生效的问题 PMS: BUG-366203 Influence: 设置preferredResolution后首次启动即可生效,无需重启两次。
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR ensures that, on first launch, the camera uses the preferred resolution from DConfig (if set) instead of the locally cached resolution, and updates copyright years and includes the necessary header for preferred resolution access. Sequence diagram for updated camera resolution selection in camInitsequenceDiagram
participant camInit
participant DConfig
participant v4l2core
camInit->>v4l2core: v4l2core_prepare_new_format(my_vd, my_config->format)
camInit->>DConfig: get_preferred_resolution_width()
camInit->>DConfig: get_preferred_resolution_height()
alt preferredResolution available
camInit->>v4l2core: v4l2core_prepare_new_resolution(my_vd, get_preferred_resolution_width(), get_preferred_resolution_height())
camInit->>camInit: my_config->width = get_my_width()
camInit->>camInit: my_config->height = get_my_height()
else no preferredResolution
camInit->>v4l2core: v4l2core_prepare_new_resolution(my_vd, my_config->width, my_config->height)
end
camInit->>v4l2core: v4l2core_update_old_format(my_vd, my_config->width, my_config->height, v4l2core_get_requested_frame_format(my_vd))
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider caching the results of get_preferred_resolution_width()/get_preferred_resolution_height() in local variables before the conditional to avoid repeated calls and make the logic clearer.
- When preferredResolution is used, the previous adjustment log for mismatched resolutions is skipped; if that adjustment is still relevant, you may want to preserve some logging so it’s visible when DConfig values are corrected.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider caching the results of get_preferred_resolution_width()/get_preferred_resolution_height() in local variables before the conditional to avoid repeated calls and make the logic clearer.
- When preferredResolution is used, the previous adjustment log for mismatched resolutions is skipped; if that adjustment is still relevant, you may want to preserve some logging so it’s visible when DConfig values are corrected.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
lzwind
approved these changes
Jun 29, 2026
Contributor
Author
|
/merge |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos, lzwind The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
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.
When preferredResolution is set via DConfig, use it directly instead of the locally cached resolution from config file on first launch.
DConfig的preferredResolution配置优先于本地配置文件中的分辨率,
修复首次打开应用时仍使用本地旧配置的问题。
Log: 修复preferredResolution首次启动不生效的问题
PMS: BUG-366203
Influence: 设置preferredResolution后首次启动即可生效,无需重启两次。
Summary by Sourcery
Prioritize DConfig-provided preferred camera resolution over the locally cached configuration on initialization to ensure the configured resolution takes effect on first launch.
Bug Fixes:
Enhancements: