Skip to content

Improve HEVC hardware decoding defaults on MTK Android TV#190

Open
zhiffu wants to merge 1 commit into
takagen99:mainfrom
zhiffu:mtk-hevc-harddecode
Open

Improve HEVC hardware decoding defaults on MTK Android TV#190
zhiffu wants to merge 1 commit into
takagen99:mainfrom
zhiffu:mtk-hevc-harddecode

Conversation

@zhiffu

@zhiffu zhiffu commented Jul 8, 2026

Copy link
Copy Markdown

Summary

  • Prefer the platform/default MediaCodec renderer on Android TV instead of forcing the NextLib extension renderer.
  • Disable Exo extension renderers by default on TV when the default renderer is selected, so HEVC is less likely to be taken over by FFmpeg/software decoding.
  • Keep the manual NextLib option for streams that still need extension decoder compatibility.
  • Avoid killing the whole process when HomeActivity is destroyed by low-memory reclaim, which prevents playback from being sent back to the home screen.

Why this helps MTK TV SoCs

On MTK Android TV devices with capable HEVC hardware decoders, extension-first renderer selection can make high-bitrate H.265/HEVC playback fall back to app-process software decoding. In that case CPU usage spikes and playback stutters even though the device has a working c2.mtk.hevc.decoder.

This change should benefit other MTK Android TV SoCs with a similar Codec2/MediaCodec HEVC hardware decoder path, because it lets the platform decoder win by default. It is not MTK-only code and should be safe on other TV devices too, but the biggest benefit is expected on MTK TVs where HEVC software fallback is noticeably expensive. Users can still select NextLib manually if a specific stream needs it.

Validation

  • Tested on Syinix TV / MT9676 / Android 14.
  • Confirmed HEVC hardware decoding works with System, IJK, and Exo playback after the change.
  • Confirmed high-bitrate HEVC playback no longer shows the same app-process FFmpeg HEVC CPU bottleneck when hardware decode is active.
  • Built release variant: :app:assembleArmeabiHisenseNormalRelease.

- 电视端默认优先系统 MediaCodec 硬解,避免 Exo 扩展软解接管 HEVC
- 保留手动选择 NextLib 的能力,兼顾特殊片源兼容性
- 低内存回收 HomeActivity 时不再误触发全局退出,减少播放中退回主页
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