{"id":6068,"library":"pyobjc-framework-audiovideobridging","title":"PyObjC AudioVideoBridging Framework","description":"PyObjC-framework-AudioVideoBridging provides Python wrappers for Apple's AudioVideoBridging framework on macOS, enabling Python applications to interact with AVB-capable hardware and software. It is part of the larger PyObjC bridge, which allows full-featured Cocoa applications to be written in pure Python. The library actively maintains compatibility with the latest macOS SDKs and Python versions, typically releasing updates in sync with new macOS releases.","status":"active","version":"12.1","language":"en","source_language":"en","source_url":"https://github.com/ronaldoussoren/pyobjc","tags":["macOS","PyObjC","framework","audio","video","bridging"],"install":[{"cmd":"pip install pyobjc-framework-audiovideobridging","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Provides the core bridge between Python and Objective-C, essential for all PyObjC framework bindings.","package":"pyobjc-core"}],"imports":[{"note":"This imports the entire AudioVideoBridging framework as a module. Individual classes like AVBManager are then accessed as attributes of this module (e.g., AudioVideoBridging.AVBManager).","symbol":"AudioVideoBridging","correct":"import AudioVideoBridging"}],"quickstart":{"code":"import AudioVideoBridging\nimport Foundation # Often needed for basic Cocoa types\n\ntry:\n    # Access the shared manager instance for the AudioVideoBridging framework\n    # This is a common pattern in Cocoa frameworks.\n    manager = AudioVideoBridging.AVBManager.sharedManager()\n    print(f\"Successfully accessed AVBManager: {manager}\")\n\n    # For actual functionality, refer to Apple's AudioVideoBridging documentation.\n    # Example (conceptual, requires deeper understanding of AVB framework):\n    # interfaces = manager.availableInterfaces()\n    # if interfaces:\n    #     print(\"Available AVB Interfaces:\")\n    #     for interface in interfaces:\n    #         print(f\"  - Name: {interface.name()}, Entity ID: {interface.entityID()}\")\n    # else:\n    #     print(\"No AVB interfaces found.\")\n\nexcept Exception as e:\n    print(f\"Error accessing AudioVideoBridging framework: {e}\")","lang":"python","description":"This quickstart demonstrates how to import the AudioVideoBridging framework and access a fundamental class, `AVBManager`. PyObjC framework wrappers provide direct access to Objective-C classes and methods. Note that PyObjC itself does not include documentation for the wrapped macOS APIs; developers should consult Apple's official AudioVideoBridging documentation for detailed usage of the framework's classes and functions."},"warnings":[{"fix":"Upgrade Python to 3.10 or later, or pin PyObjC to a compatible older version.","message":"PyObjC 12.0 dropped support for Python 3.9, and PyObjC 11.0 dropped support for Python 3.8. Users on these Python versions must use older PyObjC releases.","severity":"breaking","affected_versions":">=11.0"},{"fix":"Review code involving Objective-C initializer methods and `alloc().init()` patterns, ensuring correct object lifecycle management. PyObjC 10.3 introduced `SomeClass(...)` as a more Pythonic alternative to `SomeClass.alloc().init()`.","message":"PyObjC 11.1 introduced a significant change in how initializer methods (methods in the 'init' family) are modeled, aligning with `clang`'s Automatic Reference Counting documentation. These methods now correctly 'steal' a reference to `self` and return a new one. This can lead to unexpected reference counting behavior if existing code relied on the previous modeling.","severity":"breaking","affected_versions":">=11.1"},{"fix":"Upgrade to PyObjC 10.3.1 or later to restore `__init__` functionality when `__new__` is user-implemented. Avoid relying on `__init__` for classes using the PyObjC-provided `__new__`.","message":"PyObjC 10.3 temporarily broke support for `__init__` methods in Python subclasses when a user also provided a custom `__new__` method. While fixed in 10.3.1, this was a breaking change for affected patterns.","severity":"breaking","affected_versions":"10.3"},{"fix":"Migrate away from the `IMServicePlugIn` framework; find alternative APIs provided by Apple for modern macOS versions.","message":"The `IMServicePlugIn` framework bindings were removed in PyObjC 10.0, as the framework itself was deprecated in macOS 10.13 and removed in macOS 14.","severity":"deprecated","affected_versions":">=10.0"},{"fix":"Ensure that if Objective-C code holds weak references to Python objects, the Python objects (or their Objective-C proxies) are explicitly kept alive for the necessary duration. For objects used in views like `NSOutlineView`, it's generally safer to use Python subclasses of `NSObject`.","message":"Using weak references from Objective-C to plain Python objects can cause hard crashes rather than Python exceptions, as the Objective-C proxy object might be deallocated while the Python object is still alive.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Be aware that KVO will not function for Python subclasses of `NSProxy`. If KVO behavior is required, consider alternative implementation patterns or subclassing a different Objective-C class if applicable.","message":"As of PyObjC 12.1, Key-Value Observing (KVO) usage is automatically disabled for subclasses of `NSProxy` defined in Python to prevent `SystemError` issues.","severity":"gotcha","affected_versions":">=12.1"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z","problems":[]}