windows UVC Extension unit 问题

YouNeverCanTell 2014-04-11 05:06:05
我想自己写一个UVC Extension 来弥补windows XP 平台上对UVC Extension 支持的不足,按照微软官网
http://msdn.microsoft.com/en-us/library/windows/hardware/ff568681(v=vs.85).aspx
给出的例子,编译通过,在window7上测试通过,能够和FW 正常通信。

但是一旦放到XP 调试我写的代码的时候,总是报错,错误代码:0x80004002,错误语句


找不到我当前自己注册node control,请教一下各位大神。谢谢!

hr = pKsTopologyInfo->CreateNodeInstance(i, __uuidof(IExtensionUnit), (void **)&pExtensionUnit);[




HRESULT FindExtensionNode(IKsTopologyInfo *pKsTopologyInfo, GUID guid, DWORD *node)
{
HRESULT hr = E_FAIL;
DWORD dwNumNodes = 0;
GUID guidNodeType;
IKsControl *pKsControl = NULL;
ULONG ulBytesReturned = 0;
KSP_NODE ExtensionProp;

if(!pKsTopologyInfo || !node)
return E_POINTER;

// Retrieve the number of nodes in the filter
hr = pKsTopologyInfo->get_NumNodes(&dwNumNodes);
if(!SUCCEEDED(hr))
return hr;
if(dwNumNodes == 0)
return E_FAIL;


// Find the extension unit node that corresponds to the given GUID
for(unsigned int i = 0; i < dwNumNodes; i++)
{
hr = E_FAIL;
pKsTopologyInfo->get_NodeType(i, &guidNodeType);
if(IsEqualGUID(guidNodeType, KSNODETYPE_DEV_SPECIFIC))
{
printf("found one xu node\n");
IExtensionUnit* pExtensionUnit = NULL;
hr = pKsTopologyInfo->CreateNodeInstance(i, __uuidof(IExtensionUnit), (void **)&pExtensionUnit);
if(SUCCEEDED(hr))
{
ExtensionProp.Property.Set = guid;
ExtensionProp.Property.Id = 0;
ExtensionProp.Property.Flags = KSPROPERTY_TYPE_SETSUPPORT | KSPROPERTY_TYPE_TOPOLOGY;
ExtensionProp.NodeId = i;
ExtensionProp.Reserved = 0;

*node = i;
return hr;

/*
hr = pKsControl->KsProperty((PKSPROPERTY)&ExtensionProp, sizeof(ExtensionProp), NULL, 0, &ulBytesReturned);
if(SUCCEEDED(hr))
{
*node = i;
break;
}
*/
}
else
{
printf("CreateNodeInstance failed - 0x%x\n", hr);
}
}
}

return hr;
}
...全文
1383 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
手牵手 2016-03-15
  • 打赏
  • 举报
回复
楼主,你还在吗,能不能写个教程微软UVC Extension Unit的文件怎么正常运行啊,跪求。
kite_621 2015-07-15
  • 打赏
  • 举报
回复
哥们你这问题怎么解决的???我现在也遇到这个问题,pKsTopologyInfo->CreateNodeInstance的时候失败。麻烦指点一下。
driamemo 2014-08-12
  • 打赏
  • 举报
回复
有大神在吗?
driamemo 2014-08-08
  • 打赏
  • 举报
回复
能教学下微软文件是如何编译通过的吗?
YouNeverCanTell 2014-04-16
  • 打赏
  • 举报
回复
自己搞定,后续放出结局方案。 顺带说一句,国外的人都是牛人吗? bullshit!!! XP 不支持 UVC Extension 多个字节扩展 https://groups.google.com/forum/#!topic/microsoft.public.development.device.drivers/f0Iml9bxpvE The problem is, when this webcam is plugged into a computer with Windows XP SP2/SP3 installed, Windows only asked GET_LEN for my extension unit controls and i can't set/get their properties by using IKsControl interface obtained from UVC device filter(error code is 0x80070490). But if this webcam is plugged into the same computer with Windows Vista installed, Windows asked GET_LEN/GET_INFO/GET_MAX/GET_MIN/ GET_DEF for each XU control and i can set/get their properties. 、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、 But still, the problem exists. Since Windows XP doesn't ask GET_INFO/GET_MIN/GET_MAX/GET_RES/GET_DEF after asking GET_LEN, Windows disables XU's controls. This is why IKsControl failed. After comparing my Webcam with other UVC compliant webcams, I found some interesting things: 1. Windows XP only accepts that the return value of GET_LEN for XU is smaller than 10. I found the thread "A WinXPSP2 Video Class Driver problem" telling the same thing. I think the return value of GET_LEN for XU should be only smaller than 0xFFFF, not 10 or 0x0B. 2. My Webcam descriptor should offer an interrupt endpoint for Video Control Interface. If no interrupt endpoint declared, Windows XP won't ask GET_INFO/GET_MIN/GET_MAX/GET_RES/GET_DEF after asking GET_LEN. I think USB Video Class dones't mention this limitation. 3. The above limitations are not applied to Windows Vista. 、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、 1. Windows XP only accepts that the return value of GET_LEN for XU is smaller than 10. I found the thread "A WinXPSP2 Video Class Driver problem" telling the same thing. I think the return value of GET_LEN for XU should be only smaller than 0xFFFF, not 10 or 0x0B. 2. My Webcam descriptor should offer an interrupt endpoint for Video Control Interface. If no interrupt endpoint declared, Windows XP won't ask GET_INFO/GET_MIN/GET_MAX/GET_RES/GET_DEF after asking GET_LEN. I think USB Video Class dones't mention this limitation. 3. The above limitations are not applied to Windows Vista. 、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
YouNeverCanTell 2014-04-11
  • 打赏
  • 举报
回复
引用 1 楼 chang_bo 的回复:
由Windows版移至C++
能详细聊聊吗?
夜鹰 2014-04-11
  • 打赏
  • 举报
回复
由Windows版移至C++

64,666

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧