Skip to content

[cdm] Fix MacOS SDK deprecations #1849

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

Merged
merged 1 commit into from
May 10, 2025

Conversation

CastagnaIT
Copy link
Collaborator

@CastagnaIT CastagnaIT commented May 4, 2025

Description

Remove warnings, i dont have way to test, so i will see only CI results

Motivation and context

MacOS compiler warnings

/Users/Shared/jenkins/workspace/binary-addons/kodi-osx-arm64-Piers/tools/depends/target/binary-addons/inputstream.adaptive/lib/cdm/cdm/base/native_library_mac.mm:77:37: warning: 'CFBundleOpenBundleResourceMap' is deprecated: first deprecated in macOS 10.15 - The Carbon Resource Manager is deprecated. This should only be used to access Resource Manager-style resources in old bundles. [-Wdeprecated-declarations]
  native_lib->bundle_resource_ref = CFBundleOpenBundleResourceMap(bundle);
                                    ^
/Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBundle.h:330:16: note: 'CFBundleOpenBundleResourceMap' has been explicitly marked deprecated here
CFBundleRefNum CFBundleOpenBundleResourceMap(CFBundleRef bundle) API_DEPRECATED("The Carbon Resource Manager is deprecated. This should only be used to access Resource Manager-style resources in old bundles.", macosx(10.0, 10.15)) API_UNAVAILABLE(ios, watchos, tvos);
               ^
/Users/Shared/jenkins/workspace/binary-addons/kodi-osx-arm64-Piers/tools/depends/target/binary-addons/inputstream.adaptive/lib/cdm/cdm/base/native_library_mac.mm:88:7: warning: 'CFBundleCloseBundleResourceMap' is deprecated: first deprecated in macOS 10.15 - The Carbon Resource Manager is deprecated. This should only be used to access Resource Manager-style resources in old bundles. [-Wdeprecated-declarations]
      CFBundleCloseBundleResourceMap(library->bundle,
      ^
/Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBundle.h:343:6: note: 'CFBundleCloseBundleResourceMap' has been explicitly marked deprecated here
void CFBundleCloseBundleResourceMap(CFBundleRef bundle, CFBundleRefNum refNum) API_DEPRECATED("The Carbon Resource Manager is deprecated. This should only be used to access Resource Manager-style resources in old bundles.", macosx(10.0, 10.15)) API_UNAVAILABLE(ios, watchos, tvos);
     ^

How has this been tested?

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

Checklist:

  • I have read the Contributing document
  • My code follows the Code Guidelines of this project
  • My change requires a change to the Wiki documentation
  • I have updated the documentation accordingly

@CastagnaIT CastagnaIT added Type: Fix non-breaking change which fixes an issue v22 Piers labels May 4, 2025
Copy link

@kambala-decapitator kambala-decapitator left a comment

Choose a reason for hiding this comment

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

that build x64 dont show warnings, the arm build still show warnings

because minimum macOS version for x64 is 10.14 (where that function isn't deprecated yet), but for ARM it's 11.0.

So, the easiest solution is to simply remove all that code. And also remove bundle_resource_ref from the header.

@CastagnaIT
Copy link
Collaborator Author

because minimum macOS version for x64 is 10.14 (where that function isn't deprecated yet)

@kambala-decapitator if on 10.14 is not deprecated means that if we full remove it suggest that we cause a memory leak or not?

@CastagnaIT
Copy link
Collaborator Author

CastagnaIT commented May 5, 2025

ah no sorry you want to remove both so also CFBundleOpenBundleResourceMap, have you a way to test if works?

@kambala-decapitator
Copy link

ah no sorry you want to remove both so also CFBundleOpenBundleResourceMap, you can test if still works?

yes. But I can't test on 10.14 because I don't have such system at hand.

Those functions are quite old and not needed in modern code AFAIK.

@CastagnaIT CastagnaIT force-pushed the macOs_deprecations branch from c6f646b to 2c4c3e5 Compare May 6, 2025 13:56
@CastagnaIT
Copy link
Collaborator Author

changes done
when you can please try to play a widevine video thank you

@kambala-decapitator
Copy link

changes done when you can please try to play a widevine video thank you

got a link at hand? and do I need to configure anything in the add-on?

@CastagnaIT
Copy link
Collaborator Author

plugin.video.isasamples folder of this repository its an addon to test videos
zip that folder and install it to kodi
you will find more widevine videos that you can try

@CastagnaIT
Copy link
Collaborator Author

@CastagnaIT
Copy link
Collaborator Author

@kambala-decapitator
i forgot that if its the first time you use it, you need to install widevine cdm library,
so install InputStream Helper addon from kodi repository, its under "Program add-ons",
then open his settings and do "install cdm"

@kambala-decapitator
Copy link

thanks, managed to install everything. My results (anything not listed played fine):

List CBCS streams

all Microsoft streams don't play - unsupported DRM

List DRM ClearKey streams

  • Bitmovin - can't download manifest
  • dash google angel one - only sound plays

List DRM PlayReady streams

  • Axiom multiDRM [multi-drm] PR - missing DRM license server URL
  • all Microsoft streams don't play - unsupported DRM

List DRM Widevine streams

  • Bitmovin - simply nothing happens
  • google angel one - only sound plays
  • google sintel - simply nothing happens
  • google tears [default_KID on DRM CP] - I see that playback starts, but neither sound nor image appear, and there's a constant spinning wheel visible

List streams with subtitles

  • BBC - can't download manifest
  • google angel one - only sound plays

Stopped at this point, I guess that's sufficient.

@CastagnaIT
Copy link
Collaborator Author

ohha! thanks you had fun i see... i only asked for widevine
anyway dont worry its expected that not all sample streams works, since there are use cases not full implemented or not implemented at all

@CastagnaIT CastagnaIT merged commit c62e516 into xbmc:Piers May 10, 2025
10 checks passed
@CastagnaIT CastagnaIT deleted the macOs_deprecations branch May 10, 2025 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Fix non-breaking change which fixes an issue v22 Piers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants