IAMVideoProcAmp Interface
Top  Previous  Next

Description

Provides programmatic control over the following camera properties: black level, gain, gamma, white balance.


Methods

HRESULT Get ( long Property
, long *pValue, long *Flags )
Retrieves the value of a specific camera control property.  

HRESULT Set ( long
Property, long lValue, long Flags );
Sets the value of a specific camera control property.  

HRESULT GetRange ( long
Property, long *pMin, long *pMax, long *pSteppingDelta, long *pDefault, long *pFlags );
Retrieves values associated with the range of a specified camera property.  


Parameters

Property  
[in] Value that specifies the camera property. Use one of the following values:  
        
VideoProcAmp_Brightness - to set and retrieve the camera's black level setting.  
VideoProcAmp_Gain - to control the camera's gain.  
VideoProcAmp_Gamma - to control the camera's gamma setting.  
VideoProcAmp_WhiteBalance - to control the camera's white balance.  
 
pValue / lValue  
[in/out] New value or pointer to the value of the specified property.  
pValue  
[in] New value of the specified property.  
pMin  
[out] Pointer to the minimum range for the specified property.  
pMax  
[out] Pointer to the maximum range for the specified property.  
pSteppingDelta  
[out] Pointer to the step size for the specified property.  
pDefault  
[out] Pointer to the default value of the specified property.  
Flags / pFlags  
[in/out] Value or pointer to the value indicating whether the camera property is automatic or manual:  
VideoProcAmp_Flags_Auto - sets the property's automatic flag.  
VideoProcAmp_Flags_Manual - sets the property's manual flag.  
 
Return Values

S_OK  
Success  
E_FAIL  
Failure.  
E_INVALIDARG  
Invalid argument.  
 

Example


This C++ code request a pointer to IAMVideoProcAmp interface from the video capture filter, initiates the automatic gain control and sets the black level value to 64:

IAMVideoProcAmp *pVideoProcAmp;
HRESULT hr;
hr = pFilter->QueryInterface(IID_IAMVideoProcAmp, (void **)&pVideoProcAmp);
if(hr==S_OK)
{
   hr=pVideoProcAmp->Set(VideoProcAmp_Gain,0,VideoProcAmp_Flags_Auto);
   hr=pVideoProcAmp->Set(VideoProcAmp_Brightess,64,VideoProcAmp_Flags_Manual);
}
 
 
Remarks

IAMVideoProcAmp is a standard DirectShow interface. Refer to Microsoft DirectX SDK documentation for more details.