Hi everyone,
I am working on virtual camera driver based on TestCap sample.
A while ago I found an interesting issue with MediaFoundation/Windows 8.1 (http://www.osronline.com/showthread.cfm?link=255004). Hopefully, it was solved (thanks to Tim R.).
Now, I need to implement “Exposure” option.
That’s what I do (works under Windows 8, not 8.1)
// Define property table
DEFINE_KSPROPERTY_TABLE(CameraControlPropertyTable)
{
DEFINE_KSPROPERTY_ITEM(
KSPROPERTY_CAMERACONTROL_EXPOSURE,
TRUE,
sizeof(KSPROPERTY_CAMERACONTROL_S),
sizeof(KSPROPERTY_CAMERACONTROL_S),
TRUE,
&ExposureValues, // I do not list these values here, 'cause they work OK
0,
NULL,
NULL,
sizeof(ULONG))
};
// Add property table to adapter property set
DEFINE_KSPROPERTY_SET_TABLE(AdapterPropertyTable)
{
// …
DEFINE_KSPROPERTY_SET
(
&PROPSETID_VIDCAP_CAMERACONTROL,
SIZEOF_ARRAY(CameraControlPropertyTable),
CameraControlPropertyTable,
0,
NULL
),
// …
};
Then, I can handle GET/SET requests in my functions:
VOID STREAMAPI AdapterGetProperty( PHW_STREAM_REQUEST_BLOCK pSrb );
VOID STREAMAPI AdapterSetProperty( PHW_STREAM_REQUEST_BLOCK pSrb );
The problem is that media foundation apps (e.g. Camera) in Windows 8.1 do not recognize this property (the Exposure control does not appear in Camera app).
Starting with Windows 8.1, Microsoft introduces extended properties http://msdn.microsoft.com/en-us/library/windows/hardware/dn567570(v=vs.85).aspx
But I feel they are not just additional, but are the replacement for all previous ones.
E.g. the exposure should be now controlled via the KSPROPERTY_CAMERACONTROL_EXTENDED_EXPOSUREMODE property.(http://msdn.microsoft.com/en-us/library/windows/hardware/dn567573(v=vs.85).aspx)
I tried to add them as follows:
// Define property table
DEFINE_KSPROPERTY_TABLE(ExtendedCameraControlProperty)
{
DEFINE_KSPROPERTY_ITEM(
KSPROPERTY_CAMERACONTROL_EXTENDED_EXPOSUREMODE,
TRUE,
sizeof(KSPROPERTY) + sizeof(KSCAMERA_EXTENDEDPROP_HEADER) + sizeof(KSCAMERA_EXTENDEDPROP_VIDEOPROCSETTING),
sizeof(KSPROPERTY) + sizeof(KSCAMERA_EXTENDEDPROP_HEADER) + sizeof(KSCAMERA_EXTENDEDPROP_VIDEOPROCSETTING),
TRUE,
NULL,
0,
NULL,
NULL,
sizeof(KSPROPERTY) + sizeof(KSCAMERA_EXTENDEDPROP_HEADER) + sizeof(KSCAMERA_EXTENDEDPROP_VIDEOPROCSETTING)
)
};
// Add property table to adapter property set
DEFINE_KSPROPERTY_SET_TABLE(AdapterPropertyTable)
{
// …
DEFINE_KSPROPERTY_SET
(
&KSPROPERTYSETID_ExtendedCameraControl,
SIZEOF_ARRAY(ExtendedCameraControlProperty),
ExtendedCameraControlProperty,
0,
NULL
),
// …
};
As a result, I never get the KSPROPERTYSETID_ExtendedCameraControl in my AdapterGetProperty/AdapterSetProperty handlers.
Maybe something is wrong with MinProperty,MinData and Serialized fields in PropertyTable? I just don’t get it…
Please advice.
Thanks,
Anton