jtfrey / uvc-util

USB Video Class (UVC) control management utility for Mac OS X
MIT License
108 stars 26 forks source link

Update UVCController's UVC_PROCESSING_UNIT_ID #10

Closed dhughes-xumak closed 3 years ago

dhughes-xumak commented 3 years ago

UVC_PROCESSING_UNIT_ID should be 4, not 2. Update both UVC_INPUT_TERMINAL_ID and UVC_PROCESSING_UNIT_ID to use the earlier constants minus 1.

This was prohibiting the Processing Unit controls from being accessed. Fixes part of my original reported issue #8.

jtfrey commented 3 years ago

Reading through the specification more deeply and comparing against VVUVCKit, the unitId is not a constant. Each vendor/device can order its component terminal, processing unit, etc. units however it wants. So the issue here isn't that UVC_PROCESSING_UNIT_ID is one value or another — it (and in theory UVC_INPUT_TERMINAL_ID) can adopt an arbitrary value. Thus, a single set of constant uvc_control_t structures to describe the units isn't appropriate (egad).

So the UVCController needs a major overhaul to embed a copy of the templated uvc_control_t structures in each instance, with their unitId set when the unit chain is walked (e.g. in findControllerInterfaceForServiceObject:).

dhughes-xumak commented 3 years ago

Oh darn, of course it wouldn't be so simple. I'll try to give this some more attention later this week.

jtfrey commented 3 years ago

Closing, please see ongoing discussion on #8