Device app - VideoDeviceController matched to IDeviceIoControl object
-
Monday, June 04, 2012 9:56 PMI have a webcam related DeviceApp which accesses standard properties via the VideoDeviceController and custom properties through IDeviceIoControl without problem. (To access custom properties, I use Windows::Devices::Enumeration to get a list of device paths.)
This all works fine if there is only one camera. Only one enumerated path will successfully result in a IDeviceIoControl object and I can assume it's the same device represented in VideoDeviceController. But if there are multiple cameras attached, then I don't know which enumerated path matches the device represented in the VideoDeviceController.
Is there any way to get more device information from the VideoDeviceController? If I could get vid/pid info, I might be able to match that with the enumerated data.
Is there a solution to this or do need to resort to MFT?
Thanks.
All Replies
-
Tuesday, June 05, 2012 4:14 AMModerator
Gary,
I am looking into this for you.
Best Wishes - Eric
-
Tuesday, June 05, 2012 6:30 AMModerator
Gary,
The following should work great for you:
http://msdn.microsoft.com/en-us/library/windows/apps/hh464997.aspx#ListOfCanonicalProperties
You might be able to us these slightly simpler calls (I am not sure they will return enough information however):
http://msdn.microsoft.com/en-us/library/windows/apps/br225393.aspx
Best Wishes - Eric
- Marked As Answer by Eric Hanson-MSFTMicrosoft Employee, Moderator Tuesday, June 05, 2012 6:30 AM
- Unmarked As Answer by Eric Hanson-MSFTMicrosoft Employee, Moderator Monday, June 11, 2012 9:48 PM
-
Monday, June 11, 2012 7:41 PM
Hi Eric,
Thanks for the response. These links will be very helpful. However, it still does not connect the enumerated device and the device represented by the VideoDeviceController.
I think the answer is to use the MFT, which, according to various sources, can be used to control custom properties as well as modifying the image. But I haven't found a sample doing this.
I have successfully built the sample MFT and got it working with my own app. I can apply an algorithm to alter the frames for effect such as grayscale. That's fine, but what I want to do is access custom properties in my driver. In the MFT code there is a lot of information but I'm not sure what to use to connect with the driver for the device instance at hand.
For example, in the MFT, I can use IMFTransform to get the following string (via IMFAttributes/MFT_ENUM_HARDWARE_URL_Attribute):
\\\\?\\USB#VID_046D&PID_082D&MI_00#6&25f03fb2&0&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\\{bbefb6c7-2fc4-4139-bb8b-a58bba724083}
I could parse this and replace the generic webcam guid with my own guid so I can open a IDeviceIOControl object. But this would be a risky hack since the device path structure appears not to be documented.
What would be ideal would be something like this:
devpath = GetDevicePath ( inputStreamId, <my guid> )
I'll keep looking around the various interfaces exposed in the MFT.
BTW, I have been going over the following:
Metro style Device Apps for Cameras (dated May 31, 2012)
http://msdn.microsoft.com/en-us/library/windows/hardware/hh454870.aspx
Similar post
http://social.msdn.microsoft.com/Forums/nl/tailoringappsfordevices/thread/da145ce6-3e66-4562-8631-f93a5709a500
-
Tuesday, June 12, 2012 10:35 PMModerator
Gary,
I am looking into this for you.
Best Wishes - Eric
-
Friday, June 15, 2012 4:45 AMModerator
Gary,
Still working on this.
Best Wishes - Eric
-
Friday, June 15, 2012 9:16 PMModerator
Gary,
I did post an update to the on thread you mention (Does it clarify things at all?):
Best Wishes - Eric
-
Friday, June 15, 2012 9:19 PMModerator
Actually I responded to this on also with the same answer:
Best Wishes - Eric
-
Friday, June 15, 2012 9:22 PMModerator
Gary,
We did just post a sample of a Metro style app accessing MFT0 (Look at the JavaScript version):
http://code.msdn.microsoft.com/windowsapps/Metro-style-device-app-for-4f39b7bf
The JavaScript version of the app access the MFT0.
Best Wishes - Eric
-
Tuesday, June 19, 2012 6:48 PM
Hi Eric,
Sorry for the late reply.
I downloaded the latest Metro-style-device-app example (I had already downloaded this on 6/6) and I see that a line has been added to the wrapper
Microsoft::WRL::ComPtr<IMFTransform> m_spMft;
My problem is not how can we get this interface to the DeviceApp (as shown here). I can always add methods to the MFT0 interface for access from the device app and work with the MFTransform in the MFT code directly.
The problem is that I don't know how wo use IMFTransform to access custom driver properties. IMFTransform has access to a lot of information and I've tried working with some of it, but with no luck.
Thanks,
-
Thursday, June 21, 2012 5:43 AMModerator
Gary,
Are you referring to the JavaScript C++ version of the sample?
Best Wishes - Eric
- Proposed As Answer by Eric Hanson-MSFTMicrosoft Employee, Moderator Thursday, June 21, 2012 5:43 AM
- Unproposed As Answer by Eric Hanson-MSFTMicrosoft Employee, Moderator Thursday, June 28, 2012 6:19 AM
-
Thursday, June 21, 2012 8:32 PMYes.
-
Thursday, June 28, 2012 5:28 AMModerator
Gary,
Could you list a couple of properties you would like set? Are you trying to do this with the MFT0?
Best Wishes - Eric
-
Wednesday, October 24, 2012 5:19 PM
Hi Eric,
After learning more about the driver MFT (and MFTs in general), I see that IDeviceIoControl should be used to access custom driver settings not MFT.


