mirror of
https://github.com/Silent1566/webhtv.git
synced 2026-10-16 10:32:44 +00:00
fix(player): 修正硬解回软解对 Dolby Vision 等改写 mime 渲染器的误判
hasHardwareVideoDecoder 原先只要平台未列出该 mime 的硬件解码器就返回 false。 但 MediaCodecSelector.DEFAULT 即 MediaCodecUtil::getDecoderInfos,其内部 getDecoderInfosInternal -> getCodecMimeType 只匹配真正声明该 mime 的编解码器, 因此非原生 Dolby Vision 设备上 video/dolby-vision 返回空列表;而 ExoUtil 的 DV5 GPU 渲染器与 Dolby Vision HDR10 回退渲染器仍会把该轨判定为 FORMAT_HANDLED (内部改写为 video/hevc 交给硬件 HEVC 解码)。needsSoftDecode 于是把这条本已 硬解的 Dolby Vision 轨误判为"硬解无硬件通路",强制切到软解并重建播放器。 改为:只有平台确实列出了该 mime 的解码器且全部为软件解码器时才返回 false; 空列表表示平台不声明该 mime,可能由应用自有渲染器接管,按"未证实"处理,不再 改变用户可见的解码模式。AVS3 等"完全无解码器"场景仍由 needsSoftDecode 的 decodable == null 分支触发软解,行为不变。 同时修正 ExoUtil 中"硬解绝不注册软件回退"的注释:该约束只适用于扩展渲染器 (FFmpeg);getVideoCodecSelector 保留平台软件解码器作为最后兜底是有意为之, 且正是 PlayerManager 判定需要切软解的信号,两者必须保持一致。 Verification: 编译 :app:compileLeanbackArm64_v8aDebugJavaWithJavac BUILD SUCCESSFUL exit 0 Task-Guard: PLAYER-HWDEC-REVIEW-FIX-01 Verification: 编译 :app:compileLeanbackArm64_v8aDebugJavaWithJavac BUILD SUCCESSFUL exit 0;证据链:MediaCodecSelector.DEFAULT = MediaCodecUtil::getDecoderInfos(严格 mime 匹配),getDecoderInfosInternal 经 getCodecMimeType 只匹配声明该 mime 的编解码器,故非原生 DV 设备上 video/dolby-vision 返回空列表;ExoUtil DV HDR10 回退渲染器(1102-1108)与 ExoDv5GpuRenderer 仍以 video/hevc 判定该轨 FORMAT_HANDLED。未做设备实测(本次无可用设备)。 Task-Guard: PLAYER-HWDEC-REVIEW-FIX-01
This commit is contained in:
parent
bd24f9d53d
commit
590942503a
1 changed files with 32 additions and 8 deletions
Loading…
Add table
Add a link
Reference in a new issue