Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unsupported codecs from hwdec-codecs #4942

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

low-batt
Copy link
Contributor

This commit will:

  • Add a new class HardwareDecodeCapabilities
  • Add a call to HardwareDecodeCapabilities.checkCapabilities in AppDelegate.applicationWillFinishLaunching
  • Add a new method userOptionsContains to MPVController that checks if a user has configured a mpv option in IINA's advanced settings
  • Add a new property mpvCodecToCodecTypes to MPVController that maps a mpv codec name to core media video codec types
  • Add a new adjustCodecWhiteList method to MPVController that removes codecs from the mpv hwdec-codecs option if the Mac does not support hardware decoding for that codec
  • Change the applyHardwareAccelerationWorkaround method to use the value of the hwdec-codecs option instead of a hardcoded value

These changes cause mpv to not attempt to use hardware decoding for a codec that is known to not be supported. This eliminates the overhead of setting up for hardware decoding only to have it fail. This is not comprehensive. This only covers the recent codecs whose support for hardware decoding varies among Macs. This merely reduces the dependence upon the FFmpeg fallback to software decoding feature in some cases.


Description:

@low-batt
Copy link
Contributor Author

Rebased with develop and fixed merge conflicts.

This commit will:
- Add a new class HardwareDecodeCapabilities
- Add a call to HardwareDecodeCapabilities.checkCapabilities in
  AppDelegate.applicationWillFinishLaunching
- Add a new method userOptionsContains to MPVController that checks if a
  user has configured a mpv option in IINA's advanced settings
- Add a new property mpvCodecToCodecTypes to  MPVController that maps a
  mpv codec name to core media video codec types
- Add a new adjustCodecWhiteList method to MPVController that removes
  codecs from the mpv hwdec-codecs option if the Mac does not support
  hardware decoding for that codec
- Change the applyHardwareAccelerationWorkaround method to use the value
  of the hwdec-codecs option instead of a hardcoded value

These changes cause mpv to not attempt to use hardware decoding for a
codec that is known to not be supported. This eliminates the overhead of
setting up for hardware decoding only to have it fail. This is not
comprehensive. This only covers the recent codecs whose support for
hardware decoding varies among Macs. This merely reduces the dependence
upon the FFmpeg fallback to software decoding feature in some cases.
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.

None yet

1 participant