locked
Custom Properties Windows Store Device App for Camera

    Question

  • I am a long time driver developer.  I now have a client who has a camera that has custom KS properties.  He would like those properties to be exposed to Windows Store apps.  I've looked through the Device App and Device MFT samples, but I don't think those really address this issue.

    The sample app initializer in the Device App receives a CameraSettingsActivatedEventArgs object.  That object has a VideoDeviceExtension property that gets passed to a C++ wrapper, which then extracts interfaces from it.

    What, exactly, IS that VideoDeviceExtension? It is of an anonymous type (Object^), and the documentation is not helpful. Is that actually the IBaseFilter for the camera proxy? What I need is an IKsControl interface. If I can get that, I'm golden.  However, when I try to fetch IKsControl from that object (instead of IMft0), it won't compile because of the WINAPI_FAMILY setting.  I can override and it compiles, but I don't know if it will run.

    So, in short, how do I expose custom KS properties from my camera?  The Device MFT doesn't seem to be the right place.  That is a downstream filter, not a wrapper for the camera itself.


    Tim Roberts, VC++ MVP Providenza & Boekelheide, Inc.

    Thursday, September 26, 2013 11:24 PM

Answers

All replies

  • Hi Tim,

    Our media specialist is out today, but I'll ask him to take a look at this next week.

    --Rob

    Friday, September 27, 2013 10:48 PM
    Owner
  • Hello Tim,

    We recommend that you use the "VideoDeviceController" object to interact with the USB class video device. You can then use the "VideoDeviceController.Get/SetDeviceProperty" method(s) to set the underlying custom property of the video device. Setting the device properties is independent of the driver MFT that is completely optional. The driver MFT can help you implement DSP algorithms that aren't directly available in the device driver itself. This helps to move complex features such as face tracking, etc. from the kernel / driver layer into the user mode / software layer.

    Here are some links that might be helpful:

    How to customize camera options with a Windows Store device app

    http://msdn.microsoft.com/en-us/library/windows/hardware/dn394065(v=vs.85).aspx

    VideoDeviceController.SetDeviceProperty

    http://msdn.microsoft.com/en-us/library/windows/apps/windows.media.devices.videodevicecontroller.setdeviceproperty.aspx

    Windows Store device app for camera sample (Windows 8.1)

    http://code.msdn.microsoft.com/windowsapps/Metro-style-device-app-for-4f39b7bf

    I hope this helps,

    James 


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Monday, September 30, 2013 11:17 PM
    Moderator
  • Thanks for that info.  I completely missed Get/SetDeviceProperty, shame on me.

    Those APIs accept a String^ to identify the property, but a KSPROPERTYID consists of a GUID and an integer.  How do I pack those into a string?

    The property value is an Object^.  Is that literally a pointer to the property value, so I can just cast it to unsigned long^ or whatever?


    Tim Roberts, VC++ MVP Providenza & Boekelheide, Inc.

    Monday, September 30, 2013 11:28 PM