How to control camera capture display in MediaFoundation?

I wonder which MediaFoundation API I can use to control brightness, contrast, hue and saturation, etc.? I find that IMFVideoProcessor :: SetProcAmpValues ​​can change these attributes, but these attributes change in the graphics card; I want to change them using a capture device or MediaFoundation interface in AVStream. thank!

+3
source share
1 answer

which will be the same as in DirectShow: get IMFMediaSource for your video capture device and then request the IAMVideoProcAmp interface:

 IMFMediaSource * pSource = NULL;
 ...
 IAMVideoProcAmp *pProcAmp = NULL;
 hr = pSource->QueryInterface(IID_PPV_ARGS(&pProcAmp));
 if (SUCCEEDED(hr))
 {
    long lMin, lMax, lStep, lDefault, lCaps;
    hr = pProcAmp->GetRange(
                      VideoProcAmp_Brightness, 
                      &lMin, 
                      &lMax, 
                      &lStep, 
                      &lDefault, 
                      &lCaps
    );

    if (SUCCEEDED(hr))
    {
       hr = pProcAmp->Set(
                       VideoProcAmp_Brightness, 
                       lMax, 
                       VideoProcAmp_Flags_Manual
       );
    }
 }
+3
source

All Articles