Skip to content

fix(hdr): 保留客户端黑位精度 - #95

Merged
qiin2333 merged 2 commits into
masterfrom
codex/fix-hlg-client-output
Jul 29, 2026
Merged

fix(hdr): 保留客户端黑位精度#95
qiin2333 merged 2 commits into
masterfrom
codex/fix-hlg-client-output

Conversation

@qiin2333

@qiin2333 qiin2333 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

问题

鸿蒙的 BrightnessInfo 只提供峰值/动态范围,不提供面板最小亮度。客户端此前把未知黑位写成 2 nit,手动峰值覆盖还会把它至少取整到 1 nit;这些值映射到 Sunshine 虚拟显示器或物理显示器色彩配置后,会人为抬高内容黑位元数据,影响 HLG / HDR Vivid 输出。

修改

  • 未知黑位统一回退到 Sunshine 同款 0.001 nit
  • 手动峰值覆盖保留合法的小数黑位,不再强制取整到 1 nit
  • 补充连接模型回归测试,确认 launch 查询发送 minBrightness=0.001
  • 移除“HDR 推荐全范围”的过度表述,明确范围只需与服务端编码和解码器配置一致

验证

  • npm run check
  • assembleHar(nativelib,debug)
  • assembleApp(project,debug)
  • git diff --check

这次只修黑位元数据和设置说明,没去乱碰解码链路,杂鱼也能放心测啦。

Summary by CodeRabbit

  • 改进
    • 优化“视频设置”中 HDR 相关提示文案:调整 HLG 辅助说明,并让“全范围颜色”提示随 HDR 开关动态展示,强调与服务端编码范围一致。
    • 调整 HDR 最小亮度默认策略(更细的暗部表现),提升暗场显示稳定性并减少不必要的黑位偏差。
  • 测试
    • 更新连接与启动相关用例:当最小亮度未提供时,验证实际请求参数按新的默认值传递。

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9c386d04-9aec-4803-aea6-988001e14555

📥 Commits

Reviewing files that changed from the base of the PR and between 529303a and 5e5cbb9.

📒 Files selected for processing (1)
  • scripts/sunshine-mock-connection-test.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/sunshine-mock-connection-test.js

📝 Walkthrough

Walkthrough

Changes

HDR 调整

Layer / File(s) Summary
HDR 最小亮度默认值
entry/src/main/ets/service/streaming/NvHttp.ets
新增 DEFAULT_HDR_MIN_BRIGHTNESS_NITS,并将 HDR 启动查询参数的默认最小亮度从 2 改为 0.001
会话亮度范围与测试
entry/src/main/ets/service/streaming/StreamingSession.ets, scripts/sunshine-mock-connection-test.js
HDR 亮度范围使用统一默认值;有效亮度不再强制取整,测试验证默认查询参数为 0.001
设置页面提示
entry/src/main/ets/pages/SettingsPageV2.ets
移除 HLG 的全范围颜色推荐说明,并根据 HDR 状态切换“全范围颜色”的字幕文案。

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了本次修复的核心:保留 HDR 客户端黑位的精度。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-hlg-client-output

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/sunshine-mock-connection-test.js`:
- Around line 970-974: Update the regression test around defaultBrightnessQuery
to exercise launchApp() and assert the captured
launchRequest.query.minBrightness equals '0.001'. Keep the test configuration’s
minBrightness set to undefined, and remove the assertion that only inspects
buildLaunchQuery() output.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b09e898c-b518-4eb9-ab1f-63832a453ea2

📥 Commits

Reviewing files that changed from the base of the PR and between 27e1c6a and 529303a.

📒 Files selected for processing (4)
  • entry/src/main/ets/pages/SettingsPageV2.ets
  • entry/src/main/ets/service/streaming/NvHttp.ets
  • entry/src/main/ets/service/streaming/StreamingSession.ets
  • scripts/sunshine-mock-connection-test.js

Comment thread scripts/sunshine-mock-connection-test.js Outdated
@qiin2333
qiin2333 merged commit 1290f84 into master Jul 29, 2026
2 checks passed
@qiin2333
qiin2333 deleted the codex/fix-hlg-client-output branch July 29, 2026 12:21
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.

1 participant