add uvc extension unit guid

This commit is contained in:
kalman 2018-05-07 15:03:52 +08:00
parent 113d2e5951
commit b1b9b60626
2 changed files with 16 additions and 8 deletions

View File

@ -15,6 +15,8 @@ MYNTEYE_BEGIN_NAMESPACE
namespace { namespace {
const uvc::xu mynteye_xu = {3, 1, {0x18682d34, 0xdd2c, 0x4073, {0xad, 0x23, 0x72, 0x14, 0x73, 0x9a, 0x07, 0x4c}}};
int XuCamCtrlId(Option option) { int XuCamCtrlId(Option option) {
switch (option) { switch (option) {
case Option::EXPOSURE_MODE: case Option::EXPOSURE_MODE:
@ -838,7 +840,7 @@ bool Channels::PuControlQuery(
bool Channels::XuControlQuery( bool Channels::XuControlQuery(
channel_t channel, uvc::xu_query query, uint16_t size, channel_t channel, uvc::xu_query query, uint16_t size,
uint8_t *data) const { uint8_t *data) const {
return XuControlQuery({3}, channel >> 8, query, size, data); return XuControlQuery(mynteye_xu, channel >> 8, query, size, data);
} }
bool Channels::XuControlQuery( bool Channels::XuControlQuery(

View File

@ -278,7 +278,7 @@ public:
struct device { struct device {
const std::shared_ptr<context> parent; const std::shared_ptr<context> parent;
int vid, pid; int vid, pid;
const std::string unique_id; std::string unique_id;
std::string name; std::string name;
com_ptr<reader_callback> reader_callback; com_ptr<reader_callback> reader_callback;
@ -551,14 +551,14 @@ bool pu_control_query(
return false; return false;
} }
} }
/*
void get_extension_control_range(const device &device, const xu &xu, uint8_t selector, xu_query query, uint8_t *data) void get_extension_control_range(const device &device, const xu &xu, uint8_t selector, xu_query query, uint8_t *data)
{ {
CHECK_NOTNULL(data); CHECK_NOTNULL(data);
int offset = 0; int offset = 0;
auto ks_control = const_cast<uvc::device &>(device).get_ks_control(xu); auto ks_control = const_cast<uvc::device &>(device).get_ks_control(xu);
/* get step, min and max values*/ // get step, min and max values
KSP_NODE node; KSP_NODE node;
memset(&node, 0, sizeof(KSP_NODE)); memset(&node, 0, sizeof(KSP_NODE));
node.Property.Set = reinterpret_cast<const GUID &>(xu.id); node.Property.Set = reinterpret_cast<const GUID &>(xu.id);
@ -610,7 +610,7 @@ void get_extension_control_range(const device &device, const xu &xu, uint8_t sel
* data = (uint8_t)*(pRangeValues + offset); * data = (uint8_t)*(pRangeValues + offset);
} }
*/
bool xu_control_query( bool xu_control_query(
const device &device, const xu &xu, uint8_t selector, xu_query query, const device &device, const xu &xu, uint8_t selector, xu_query query,
uint16_t size, uint8_t *data) uint16_t size, uint8_t *data)
@ -634,10 +634,16 @@ bool xu_control_query(
node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY; node.Property.Flags = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_TOPOLOGY;
break; break;
case XU_QUERY_MIN: case XU_QUERY_MIN:
offset = 1;
node.Property.Flags = KSPROPERTY_TYPE_BASICSUPPORT | KSPROPERTY_TYPE_TOPOLOGY;
break;
case XU_QUERY_MAX: case XU_QUERY_MAX:
offset = 2;
node.Property.Flags = KSPROPERTY_TYPE_BASICSUPPORT | KSPROPERTY_TYPE_TOPOLOGY;
break;
case XU_QUERY_DEF: case XU_QUERY_DEF:
get_extension_control_range(device, xu, selector, query, data); node.Property.Flags = KSPROPERTY_TYPE_DEFAULTVALUES | KSPROPERTY_TYPE_TOPOLOGY;
return true; break;
default: default:
return false; return false;
} }