Output Format of a Video Device RRS feed

  • Question

  • Hello,

    I am an absolute beginner in Media Foundation so I have a basic question. I am trying to find out the output format of a video device(my webcam) and print it out on screen. I want to figure out the major type and the subtype. So I want something like { MFMediaType_Video, MFVideoFormat_RGB32 }.

    This is what I have:

    BYTE* my_name=NULL;
    UINT32 size=0;
    //m_ppDevices is a valid video capture device(webcam)	
    m_ppDevices->GetBlobSize(MF_DEVSOURCE_ATTRIBUTE_MEDIA_TYPE, &size);	
    my_name = new BYTE[size];
    m_ppDevices->GetBlob(MF_DEVSOURCE_ATTRIBUTE_MEDIA_TYPE,my_name, size,NULL);

    This prints out "vids". Which is fine for my "Major Type". I just can't get the subtype. Any help would be appreciated.

    Thursday, August 1, 2013 3:36 PM

All replies

  • Hi,

    what kind of interface is m_ppDevices ? It looks like it would be an IMFAttributes one, but you wrote its a capture device ? An attribute store is no capture device.

    Wherever you got that attributes from, lets assume u got the right store there, couldnt you just do IMFAttributes->GetItem to retrieve the subtype of video ? The code sample here should do it, and i think that GetBlob just calls MFGetAttributesAsBlob internaly to write the attributes into an array like the documentary says here. If u want a specific attribute why not call for it instead of writing all attributes into a array.



    Tuesday, August 6, 2013 11:17 AM
    • Proposed as answer by Francis Grave Thursday, August 8, 2013 9:57 AM
    Thursday, August 8, 2013 9:55 AM