microsoft / Windows-driver-samples

This repo contains driver samples prepared for use with Microsoft Visual Studio and the Windows Driver Kit (WDK). It contains both Universal Windows Driver and desktop-only driver samples.
Microsoft Public License
7.01k stars 4.94k forks source link

[avstream/sampledevicemft] The face detection blue rectangle disappears in the Windows Camera App #1170

Closed ispaddy closed 5 months ago

ispaddy commented 6 months ago

Hi , there

If I enable MF_DEVICEMFT_DECODING_MEDIATYPE_NEEDED in /avstream/sampledevicemft/stdafx.h, the face detection blue rectangle disappears in the Windows Camera App. Can anyone provide me with some advice? Many thanks :)

// @@@@ README Please check / uncheck various hash defines to enable/ disable features
// MF_DEVICEMFT_ASYNCPIN_NEEDED will show how to use Asynchronous queues
// MF_DEVICEMFT_DECODING_MEDIATYPE_NEEDED will show how to decode a compressed mediatype.. it supports H264 and MJPG
// MF_DEVICEMFT_SET_SPHERICAL_ATTRIBUTES will set the spherical attributes
// MF_DEVICEMFT_ENUM_HW_DECODERS will make the device MFT enumerate hardware decoders
// 
//#define MF_DEVICEMFT_ADD_GRAYSCALER_ 1  
#define MF_DEVICEMFT_ASYNCPIN_NEEDED           1
#define MF_DEVICEMFT_DECODING_MEDIATYPE_NEEDED 1       // <------------ enable this
//#define MF_DEVICEMFT_SET_SPHERICAL_ATTRIBUTES  1
//#define MF_DEVICEMFT_ENUM_HW_DECODERS        1

/*Some important notes regarding Device MFT
Device MFT is an asynchronous transform that is loaded in the device source
There are a few key operations that need a special mention
1) InitializeTransform: This is where the device MFT should be initialized
2) ProcessInput is where the samples are supplied to the Device MFT
3) METransformHaveOutput is how deviceMFT notifies the Device Transform Manager (DTM) in the OS to pick up samples in its queues
4) SetOutPutStreamState is where the state transition on a Device MFT will come in
*/
AbhinavMalviya58 commented 6 months ago

in my window i am click then blue rectangle disappears otherwise always on

what do you want to do so that the blue rectangle remains after clicking ?

ispaddy commented 6 months ago

Hi @AbhinavMalviya58 , the blue rectangle for face dection only disapears when I enabled MF_DEVICEMFT_DECODING_MEDIATYPE_NEEDED

ispaddy commented 5 months ago

Found a workaround to fix this issue, FYI

@@ -664,7 +664,7 @@ public:
 #endif
         )
     {
-        SetUINT32(MF_SD_VIDEO_SPHERICAL, TRUE);
+        //SetUINT32(MF_SD_VIDEO_SPHERICAL, TRUE);
     }
     STDMETHOD(AddMediaType)(
         _Inout_ DWORD *pos,