Skip to content

feat(config): add useRgbData config to control RGB preview mode#505

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
add-uos:master
Jul 21, 2026
Merged

feat(config): add useRgbData config to control RGB preview mode#505
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
add-uos:master

Conversation

@add-uos

@add-uos add-uos commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Add DConfig option "useRgbData" to control whether YUV frames are converted to RGB for preview rendering. Supports three modes: -1: auto (default, let system decide)
0: force disable
1: force enable

添加DConfig配置项"useRgbData",控制预览时是否将YUV帧数据转换为RGB格式。
支持三态:-1自动判断(默认)、0强制关闭、1强制开启。

Log: 添加RGB预览模式配置项
PMS: BUG-366739
Influence: 通过DConfig配置可强制控制预览RGB数据的使用,便于排查特定机型显示异常问题。

Add DConfig option "useRgbData" to control whether YUV frames are
converted to RGB for preview rendering. Supports three modes:
-1: auto (default, let system decide)
0: force disable
1: force enable

添加DConfig配置项"useRgbData",控制预览时是否将YUV帧数据转换为RGB格式。
支持三态:-1自动判断(默认)、0强制关闭、1强制开启。

Log: 添加RGB预览模式配置项
PMS: BUG-366739
Influence: 通过DConfig配置可强制控制预览RGB数据的使用,便于排查特定机型显示异常问题。

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @add-uos, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

[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.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

★ 总体评分:100分

■ 【总体评价】

代码实现了通过DConfig控制相机RGB预览模式的功能,逻辑严谨且无安全漏洞
代码结构清晰,校验逻辑完善,未引入任何安全风险,质量优秀

■ 【详细分析】

  • 1.语法逻辑(完全正确)✓

main.cpp中对DConfig配置项的读取和校验逻辑正确,datamanager.h的接口定义规范,majorimageprocessingthread.cpp中的条件判断逻辑无误。
潜在问题:无
建议:无需修改

  • 2.代码质量(优秀)✓

新增代码遵循了项目的命名规范,注释详尽说明了-1、0、1代表的含义,JSON配置文件也包含了中英文名称和描述。
潜在问题:无
建议:无需修改

  • 3.代码性能(无性能问题)✓

majorimageprocessingthread.cpp的run()方法中,虽然每次循环都会调用getUseRgbData(),但该函数为内联函数,仅返回一个整型成员变量,开销极小。
潜在问题:(无)
建议:无需修改

  • 4.代码安全(存在0个安全漏洞)✓

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
代码从DConfig读取配置数据,并在main.cpp中进行了严格的白名单校验(仅允许-1, 0, 1),有效防止了非法值导致的未定义行为。无外部不可信输入直接用于危险操作。

  • 建议:无需修改

■ 【改进建议代码示例】

// 代码已经非常完善,无需修改。若追求极致性能,可将配置读取移至循环外,但当前实现已足够。

@add-uos

add-uos commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

/merge

@deepin-bot
deepin-bot Bot merged commit e6dc8fc into linuxdeepin:master Jul 21, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants