none
How to implement photo sequence mode in AVStream mini driver for Win8.1? RRS feed

  • Question

  • I have implemented flsh control mode and ROI  (including image pin) in my AVStream driver. I can use MediaCapture API to get or set both controls. I also tried  photo sequence mode. But I got some problems.According to the document(https://msdn.microsoft.com/en-us/library/windows/hardware/dn553146(v=vs.85).aspx), I supported  all  extended controls that are required for a camera driver to support photo sequence mode.

    NTSTATUS CCaptureFilter::ExtendedCameraCtrlGetHandler( PIRP Irp, PKSPROPERTY Property, PVOID pData )

    {

        PAGED_CODE();
        NTSTATUS Status = STATUS_SUCCESS;
        NT_ASSERT(Irp);
        NT_ASSERT(Property);

        PKSCAMERA_EXTENDEDPROP_HEADER Data = (PKSCAMERA_EXTENDEDPROP_HEADER)pData;
        PKSCAMERA_EXTENDEDPROP_VALUE pValue = (PKSCAMERA_EXTENDEDPROP_VALUE)((PUCHAR)Data + sizeof(KSCAMERA_EXTENDEDPROP_HEADER));

        DbgPrint("--> CExtendedCameraCtrl::GetHandler(), ID = %d\n",Property->Id);

        Data->Version = 0;
        Data->PinId = KSCAMERA_EXTENDEDPROP_FILTERSCOPE;
        Data->Size = sizeof(KSCAMERA_EXTENDEDPROP_HEADER)+sizeof(KSCAMERA_EXTENDEDPROP_VALUE);
        Data->Result = 0;
        Data->Capability = 0;
        Data->Flags = 0;

        switch (Property->Id)

        {
    case KSPROPERTY_CAMERACONTROL_EXTENDED_PHOTOMODE:
    Data->PinId = 3;  //photo pin ID 
    Data->Size = sizeof(KSCAMERA_EXTENDEDPROP_HEADER)+sizeof(KSCAMERA_EXTENDEDPROP_PHOTOMODE);
    Data->Capability = KSCAMERA_EXTENDEDPROP_CAPS_ASYNCCONTROL;
            Data->Flags = KSCAMERA_EXTENDEDPROP_PHOTOMODE_SEQUENCE;
    {
    PKSCAMERA_EXTENDEDPROP_PHOTOMODE pPhoto = (PKSCAMERA_EXTENDEDPROP_PHOTOMODE)((PUCHAR)Data + sizeof(KSCAMERA_EXTENDEDPROP_HEADER));

    pPhoto->RequestedHistoryFrames = 4;
    pPhoto->MaxHistoryFrames = 5;
    pPhoto->SubMode = 0;
    pPhoto->Reserved = 0;
    }
    break;

    case KSPROPERTY_CAMERACONTROL_EXTENDED_PHOTOFRAMERATE:
    Data->PinId = 3;
    pValue->Value.ratio.HighPart = 15;
    pValue->Value.ratio.LowPart = 1;
    break;
    case KSPROPERTY_CAMERACONTROL_EXTENDED_PHOTOMAXFRAMERATE:
    Data->PinId = 3;
    pValue->Value.ratio.HighPart = 30;
    pValue->Value.ratio.LowPart = 1;
    Data->Capability = KSCAMERA_EXTENDEDPROP_CAPS_ASYNCCONTROL;
    break;
    case KSPROPERTY_CAMERACONTROL_EXTENDED_PHOTOTRIGGERTIME:
    Data->PinId = 3;
    Data->Flags = KSPROPERTY_CAMERA_PHOTOTRIGGERTIME_CLEAR;
    break;

    case KSPROPERTY_CAMERACONTROL_EXTENDED_WARMSTART:
    Data->PinId = 3;
    Data->Size = sizeof(KSCAMERA_EXTENDEDPROP_HEADER);
    Data->Capability = KSCAMERA_EXTENDEDPROP_CAPS_ASYNCCONTROL | KSCAMERA_EXTENDEDPROP_WARMSTART_MODE_DISABLED;
                    Data->Flags = 0;
    break;

    case KSPROPERTY_CAMERACONTROL_EXTENDED_MAXVIDFPS_PHOTORES:
    Data->PinId = 3;
    Data->Size = sizeof(KSCAMERA_EXTENDEDPROP_HEADER)+sizeof(KSCAMERA_MAXVIDEOFPS_FORPHOTORES);
    Data->Result = 0;
    Data->Capability = 0;
    Data->Flags = 0;
    {
    PKSCAMERA_MAXVIDEOFPS_FORPHOTORES pPhotoRes = (PKSCAMERA_MAXVIDEOFPS_FORPHOTORES)((PUCHAR)Data + sizeof(KSCAMERA_EXTENDEDPROP_HEADER));
    RtlZeroMemory(pPhotoRes, sizeof(KSCAMERA_MAXVIDEOFPS_FORPHOTORES));
    }
    break;
    case KSPROPERTY_CAMERACONTROL_EXTENDED_PHOTOTHUMBNAIL:
    Data->PinId = 3;
    Data->Size = sizeof(KSCAMERA_EXTENDEDPROP_HEADER)+sizeof(KSCAMERA_EXTENDEDPROP_VALUE);
    Data->Result = 0;
    Data->Capability = KSCAMERA_EXTENDEDPROP_CAPS_ASYNCCONTROL | KSCAMERA_EXTENDEDPROP_PHOTOTHUMBNAIL_DISABLE
    | KSCAMERA_EXTENDEDPROP_PHOTOTHUMBNAIL_2X| KSCAMERA_EXTENDEDPROP_PHOTOTHUMBNAIL_4X
    | KSCAMERA_EXTENDEDPROP_PHOTOTHUMBNAIL_8X | KSCAMERA_EXTENDEDPROP_PHOTOTHUMBNAIL_16X;
    Data->Flags = KSCAMERA_EXTENDEDPROP_PHOTOTHUMBNAIL_DISABLE;
    break;

    case KSPROPERTY_CAMERACONTROL_EXTENDED_FLASHMODE:

    Data->PinId = KSCAMERA_EXTENDEDPROP_FILTERSCOPE;
    Data->Size = sizeof(KSCAMERA_EXTENDEDPROP_HEADER)+sizeof(KSCAMERA_EXTENDEDPROP_VALUE);
    Data->Result = 0;
    Data->Capability = KSCAMERA_EXTENDEDPROP_FLASH_OFF | KSCAMERA_EXTENDEDPROP_FLASH_ON | KSCAMERA_EXTENDEDPROP_FLASH_AUTO
    | KSCAMERA_EXTENDEDPROP_FLASH_SINGLEFLASH | KSCAMERA_EXTENDEDPROP_FLASH_MULTIFLASHSUPPORTED;
    //| KSCAMERA_EXTENDEDPROP_FLASH_ON_ADJUSTABLEPOWER | KSCAMERA_EXTENDEDPROP_FLASH_AUTO_ADJUSTABLEPOWER
    //| KSCAMERA_EXTENDEDPROP_FLASH_REDEYEREDUCTION | KSCAMERA_EXTENDEDPROP_FLASH_SINGLEFLASH;
    Data->Flags = pDevice->FlashMode | KSCAMERA_EXTENDEDPROP_FLASH_SINGLEFLASH;

    break;
    default:
            ntStatus = STATUS_NOT_SUPPORTED;
            break;
        }
        return ntStatus;
    }

    When I run MediaCapture CPP sample, It gets KSPROPERTY_CAMERACONTROL_EXTENDED_PHOTOTHUMBNAIL first, and then KSPROPERTY_CAMERACONTROL_EXTENDED_PHOTOMODE,KSPROPERTY_CAMERACONTROL_EXTENDED_FLASHMODE.

    Next,it sets KSPROPERTY_CAMERACONTROL_EXTENDED_FLASHMODE once. Unfortunately ,when I check capture app , photo sequence is still not supported.

    Is there anything I have missed?



    • Edited by Xu Ke Friday, February 6, 2015 8:42 AM
    Friday, February 6, 2015 7:25 AM