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

CoreMediaIO.CMIOObjectSetPropertyData ValueError #554

Closed
mansourmoufid opened this issue May 10, 2023 · 3 comments
Closed

CoreMediaIO.CMIOObjectSetPropertyData ValueError #554

mansourmoufid opened this issue May 10, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@mansourmoufid
Copy link

Describe the bug

Attempting to call CMIOObjectSetPropertyData() raises a ValueError exception:

  File "main.py", line 1028, in cmio_set_property
    status = CoreMediaIO.CMIOObjectSetPropertyData(
ValueError: depythonifying 'pointer', got 'CoreMediaIO.CMIOObjectPropertyAddress'

CMIOObjectGetPropertyData() works fine on the same objectID.

In CoreMediaIO/_metadata.py, I see:

    "CMIOObjectSetPropertyData": (b"iI^{CMIOObjectPropertyAddress=III}I^vI^v",),

and in the same file:

    "CMIOObjectGetPropertyData": (
        b"iI^{CMIOObjectPropertyAddress=III}I^vI^I^v",
        "",
        {
            "arguments": {
                1: {"type_modifier": "n"},
                3: {"c_array_length_in_arg": 2, "type_modifier": "o"},
                5: {"type_modifier": "o"},
                6: {"c_array_length_in_arg": (4, 5), "type_modifier": "o"},
            }
        },
    ),

The two functions have the same signature except for the second to last argument.

I just copy-pasted the tuple for CMIOObjectGetPropertyData into CMIOObjectSetPropertyData, and the exception is gone, it seems to work now.

Platform information

  • Python version: 3.8.13
  • How was python installed (python.org, anaconda, homebrew, ...): source
  • macOS version: 13.3.1 (a)

To Reproduce

See here: https://gist.github.com/eliteraspberries/0c26993bc82f7b62056cff1733ebfba8

Expected behavior

CMIOObjectSetPropertyData() should return non-zero (fail).

Additional context

@mansourmoufid mansourmoufid added the bug Something isn't working label May 10, 2023
@Alexandro1112
Copy link

Same error(

@ronaldoussoren
Copy link
Owner

This is due to incomplete metadata. I'm working on a fix (starting with updating the test that should have detected this problem...)

ronaldoussoren added a commit that referenced this issue May 13, 2023
Also add an extra check for the generic metadata sanity check that
would have detected this problem (sadly only for functions and not
selectors because the test gives too many false positives for
selectors).

Also exclude definitions from "CMIOHardwarePlugIn.h" from the
CoreMediaIO bindings (those never worked and cannot work without
a lot more work)

Issue #554
@ronaldoussoren
Copy link
Owner

I've pushed a fix for this issue.

I'm not sure yet when I'll push out a release with this fix, my plan was to wait for the 3.12 beta release, but that's been postponed so I may release sooner than that.

ronaldoussoren added a commit that referenced this issue May 27, 2023
The metadata sanity check update from #554 found issues in other
bindings as well, this changeset fixes those issues.

Also fix some super usage issue in tests related to #549
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants