Skip to content

Portable Device.functions() omits video (FN_VIDEO exists in C) #8

Description

@cursor

What is missing

_usbif.FN_VIDEO (bit 32) is built into the C module and examples/usbif_webcam.py uses it. The portable costume API does not know the name:

# lib/usbif/native_usb.py
_BITS = {"cdc": 1, "msc": 2, "uac": 4, "midi": 8, "hid": 16}
# no "uvc" / "video"

So usbif.auto.device().functions("cdc", "uvc") raises, and the webcam example has to poke _usbif directly.

Why it matters

Costume selection is supposed to be the portable surface. Every other device class is reachable through it; video is the odd one out, which means applications that want a webcam costume cannot stay on the portable API.

Fix shape (for whoever lands it)

Add "uvc": 32 (or "video": 32, matching the C name — pick one and document it) to NativeDevice._BITS and to Device.FUNCTIONS, and extend the costume self-test matrix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions