Fixed property names in cap_dshow #1993
This commit is contained in:
parent
6ca618277c
commit
c492dc6a83
@ -1091,8 +1091,6 @@ videoInput::videoInput(){
|
||||
formatTypes[VI_SECAM_K1] = AnalogVideo_SECAM_K1;
|
||||
formatTypes[VI_SECAM_L] = AnalogVideo_SECAM_L;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -2254,7 +2252,6 @@ int videoInput::getCameraPropertyFromCV(int cv_property){
|
||||
|
||||
// see CameraControlProperty in strmif.h
|
||||
switch (cv_property) {
|
||||
|
||||
case CV_CAP_PROP_PAN:
|
||||
return CameraControl_Pan;
|
||||
|
||||
@ -3075,7 +3072,7 @@ HRESULT videoInput::routeCrossbar(ICaptureGraphBuilder2 **ppBuild, IBaseFilter *
|
||||
}
|
||||
Crossbar->Route(pOIndex,pIndex);
|
||||
}else{
|
||||
if(verbose)printf("SETUP: Didn't find specified Physical Connection type. Using Defualt. \n");
|
||||
if(verbose) printf("SETUP: Didn't find specified Physical Connection type. Using Defualt. \n");
|
||||
}
|
||||
|
||||
//we only free the crossbar when we close or restart the device
|
||||
@ -3087,7 +3084,7 @@ HRESULT videoInput::routeCrossbar(ICaptureGraphBuilder2 **ppBuild, IBaseFilter *
|
||||
if(pXBar1)pXBar1 = NULL;
|
||||
|
||||
}else{
|
||||
if(verbose)printf("SETUP: You are a webcam or snazzy firewire cam! No Crossbar needed\n");
|
||||
if(verbose) printf("SETUP: You are a webcam or snazzy firewire cam! No Crossbar needed\n");
|
||||
return hr;
|
||||
}
|
||||
|
||||
@ -3110,8 +3107,6 @@ public:
|
||||
virtual IplImage* retrieveFrame(int);
|
||||
virtual int getCaptureDomain() { return CV_CAP_DSHOW; } // Return the type of the capture object: CV_CAP_VFW, etc...
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
void init();
|
||||
|
||||
@ -3217,60 +3212,29 @@ double CvCaptureCAM_DShow::getProperty( int property_id )
|
||||
switch( property_id )
|
||||
{
|
||||
case CV_CAP_PROP_BRIGHTNESS:
|
||||
if ( VI.getVideoSettingFilter(index,VI.getVideoPropertyFromCV(CV_CAP_PROP_BRIGHTNESS),min_value,max_value,stepping_delta,current_value,flags,defaultValue) ) return (double)current_value;
|
||||
|
||||
case CV_CAP_PROP_CONTRAST:
|
||||
if (VI.getVideoSettingFilter(index,VI.getVideoPropertyFromCV(CV_CAP_PROP_CONTRAST),min_value,max_value,stepping_delta,current_value,flags,defaultValue) ) return (double)current_value;
|
||||
|
||||
case CV_CAP_PROP_HUE:
|
||||
if (VI.getVideoSettingFilter(index,VI.getVideoPropertyFromCV(CV_CAP_PROP_HUE),min_value,max_value,stepping_delta,current_value,flags,defaultValue) ) return (double)current_value;
|
||||
|
||||
case CV_CAP_PROP_SATURATION:
|
||||
if (VI.getVideoSettingFilter(index,VI.getVideoPropertyFromCV(CV_CAP_PROP_SATURATION),min_value,max_value,stepping_delta,current_value,flags,defaultValue) ) return (double)current_value;
|
||||
|
||||
case CV_CAP_PROP_SHARPNESS:
|
||||
if (VI.getVideoSettingFilter(index,VI.getVideoPropertyFromCV(CV_CAP_PROP_SHARPNESS),min_value,max_value,stepping_delta,current_value,flags,defaultValue) ) return (double)current_value;
|
||||
|
||||
case CV_CAP_PROP_GAMMA:
|
||||
if (VI.getVideoSettingFilter(index,VI.getVideoPropertyFromCV(CV_CAP_PROP_GAMMA),min_value,max_value,stepping_delta,current_value,flags,defaultValue) ) return (double)current_value;
|
||||
|
||||
case CV_CAP_PROP_MONOCROME:
|
||||
if (VI.getVideoSettingFilter(index,VI.getVideoPropertyFromCV(CV_CAP_PROP_MONOCROME),min_value,max_value,stepping_delta,current_value,flags,defaultValue) ) return (double)current_value;
|
||||
|
||||
case CV_CAP_PROP_WHITE_BALANCE_BLUE_U:
|
||||
if (VI.getVideoSettingFilter(index,VI.getVideoPropertyFromCV(CV_CAP_PROP_WHITE_BALANCE_BLUE_U),min_value,max_value,stepping_delta,current_value,flags,defaultValue) ) return (double)current_value;
|
||||
|
||||
case CV_CAP_PROP_BACKLIGHT:
|
||||
if (VI.getVideoSettingFilter(index,VI.getVideoPropertyFromCV(CV_CAP_PROP_BACKLIGHT),min_value,max_value,stepping_delta,current_value,flags,defaultValue) ) return (double)current_value;
|
||||
|
||||
case CV_CAP_PROP_GAIN:
|
||||
if (VI.getVideoSettingFilter(index,VI.getVideoPropertyFromCV(CV_CAP_PROP_GAIN),min_value,max_value,stepping_delta,current_value,flags,defaultValue) ) return (double)current_value;
|
||||
if (VI.getVideoSettingFilter(index,VI.getVideoPropertyFromCV(property_id),min_value,max_value,stepping_delta,current_value,flags,defaultValue) ) return (double)current_value;
|
||||
}
|
||||
|
||||
// camera properties
|
||||
switch( property_id )
|
||||
{
|
||||
|
||||
case CV_CAP_PROP_BACKLIGHT:
|
||||
if (VI.getVideoSettingCamera(index,VI.getCameraPropertyFromCV(CV_CAP_PROP_BACKLIGHT),min_value,max_value,stepping_delta,current_value,flags,defaultValue) ) return (double)current_value;
|
||||
|
||||
case CV_CAP_PROP_PAN:
|
||||
if (VI.getVideoSettingCamera(index,VI.getCameraPropertyFromCV(CV_CAP_PROP_PAN),min_value,max_value,stepping_delta,current_value,flags,defaultValue) ) return (double)current_value;
|
||||
|
||||
case CV_CAP_PROP_TILT:
|
||||
if (VI.getVideoSettingCamera(index,VI.getCameraPropertyFromCV(CV_CAP_PROP_TILT),min_value,max_value,stepping_delta,current_value,flags,defaultValue) ) return (double)current_value;
|
||||
|
||||
case CV_CAP_PROP_ROLL:
|
||||
if (VI.getVideoSettingCamera(index,VI.getCameraPropertyFromCV(CV_CAP_PROP_ROLL),min_value,max_value,stepping_delta,current_value,flags,defaultValue) ) return (double)current_value;
|
||||
|
||||
case CV_CAP_PROP_ZOOM:
|
||||
if (VI.getVideoSettingCamera(index,VI.getCameraPropertyFromCV(CV_CAP_PROP_BACKLIGHT),min_value,max_value,stepping_delta,current_value,flags,defaultValue) ) return (double)current_value;
|
||||
|
||||
case CV_CAP_PROP_EXPOSURE:
|
||||
case CV_CAP_PROP_IRIS:
|
||||
if (VI.getVideoSettingCamera(index,VI.getCameraPropertyFromCV(CV_CAP_PROP_IRIS),min_value,max_value,stepping_delta,current_value,flags,defaultValue) ) return (double)current_value;
|
||||
|
||||
case CV_CAP_PROP_FOCUS:
|
||||
if (VI.getVideoSettingCamera(index,VI.getCameraPropertyFromCV(CV_CAP_PROP_FOCUS),min_value,max_value,stepping_delta,current_value,flags,defaultValue) ) return (double)current_value;
|
||||
if (VI.getVideoSettingCamera(index,VI.getCameraPropertyFromCV(property_id),min_value,max_value,stepping_delta,current_value,flags,defaultValue) ) return (double)current_value;
|
||||
|
||||
}
|
||||
|
||||
@ -3341,67 +3305,32 @@ bool CvCaptureCAM_DShow::setProperty( int property_id, double value )
|
||||
//video Filter properties
|
||||
switch( property_id )
|
||||
{
|
||||
|
||||
case CV_CAP_PROP_BRIGHTNESS:
|
||||
return VI.setVideoSettingFilter(index,VI.getVideoPropertyFromCV(CV_CAP_PROP_BRIGHTNESS),(long)value);
|
||||
|
||||
case CV_CAP_PROP_CONTRAST:
|
||||
return VI.setVideoSettingFilter(index,VI.getVideoPropertyFromCV(CV_CAP_PROP_CONTRAST),(long)value);
|
||||
|
||||
case CV_CAP_PROP_HUE:
|
||||
return VI.setVideoSettingFilter(index,VI.getVideoPropertyFromCV(CV_CAP_PROP_HUE),(long)value);
|
||||
|
||||
case CV_CAP_PROP_SATURATION:
|
||||
return VI.setVideoSettingFilter(index,VI.getVideoPropertyFromCV(CV_CAP_PROP_SATURATION),(long)value);
|
||||
|
||||
case CV_CAP_PROP_SHARPNESS:
|
||||
return VI.setVideoSettingFilter(index,VI.getVideoPropertyFromCV(CV_CAP_PROP_SHARPNESS),(long)value);
|
||||
|
||||
case CV_CAP_PROP_GAMMA:
|
||||
return VI.setVideoSettingFilter(index,VI.getVideoPropertyFromCV(CV_CAP_PROP_GAMMA),(long)value);
|
||||
|
||||
case CV_CAP_PROP_MONOCROME:
|
||||
return VI.setVideoSettingFilter(index,VI.getVideoPropertyFromCV(CV_CAP_PROP_MONOCROME),(long)value);
|
||||
|
||||
case CV_CAP_PROP_WHITE_BALANCE_BLUE_U:
|
||||
return VI.setVideoSettingFilter(index,VI.getVideoPropertyFromCV(CV_CAP_PROP_WHITE_BALANCE_BLUE_U),(long)value);
|
||||
|
||||
case CV_CAP_PROP_BACKLIGHT:
|
||||
return VI.setVideoSettingFilter(index,VI.getVideoPropertyFromCV(CV_CAP_PROP_BACKLIGHT),(long)value);
|
||||
|
||||
case CV_CAP_PROP_GAIN:
|
||||
return VI.setVideoSettingFilter(index,VI.getVideoPropertyFromCV(CV_CAP_PROP_GAIN),(long)value);
|
||||
|
||||
default:
|
||||
;
|
||||
return VI.setVideoSettingFilter(index,VI.getVideoPropertyFromCV(property_id),(long)value);
|
||||
}
|
||||
|
||||
//camera properties
|
||||
switch( property_id )
|
||||
{
|
||||
case CV_CAP_PROP_PAN:
|
||||
return VI.setVideoSettingCamera(index,VI.getCameraPropertyFromCV(CV_CAP_PROP_PAN),(long)value);
|
||||
|
||||
case CV_CAP_PROP_TILT:
|
||||
return VI.setVideoSettingCamera(index,VI.getCameraPropertyFromCV(CV_CAP_PROP_TILT),(long)value);
|
||||
|
||||
case CV_CAP_PROP_ROLL:
|
||||
return VI.setVideoSettingCamera(index,VI.getCameraPropertyFromCV(CV_CAP_PROP_ROLL),(long)value);
|
||||
|
||||
case CV_CAP_PROP_ZOOM:
|
||||
return VI.setVideoSettingCamera(index,VI.getCameraPropertyFromCV(CV_CAP_PROP_ZOOM),(long)value);
|
||||
|
||||
case CV_CAP_PROP_EXPOSURE:
|
||||
return VI.setVideoSettingCamera(index,VI.getCameraPropertyFromCV(CV_CAP_PROP_EXPOSURE),(long)value);
|
||||
|
||||
case CV_CAP_PROP_IRIS:
|
||||
return VI.setVideoSettingCamera(index,VI.getCameraPropertyFromCV(CV_CAP_PROP_IRIS),(long)value);
|
||||
|
||||
case CV_CAP_PROP_FOCUS:
|
||||
return VI.setVideoSettingCamera(index,VI.getCameraPropertyFromCV(CV_CAP_PROP_FOCUS),(long)value);
|
||||
return VI.setVideoSettingCamera(index,VI.getCameraPropertyFromCV(property_id),(long)value);
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -3410,8 +3339,16 @@ CvCapture* cvCreateCameraCapture_DShow( int index )
|
||||
{
|
||||
CvCaptureCAM_DShow* capture = new CvCaptureCAM_DShow;
|
||||
|
||||
try
|
||||
{
|
||||
if( capture->open( index ))
|
||||
return capture;
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
delete capture;
|
||||
throw;
|
||||
}
|
||||
|
||||
delete capture;
|
||||
return 0;
|
||||
|
@ -41,6 +41,8 @@ const cv::Size sznHD = cv::Size(640, 360);
|
||||
const cv::Size szqHD = cv::Size(960, 540);
|
||||
const cv::Size sz720p = cv::Size(1280, 720);
|
||||
const cv::Size sz1080p = cv::Size(1920, 1080);
|
||||
const cv::Size sz2160p = cv::Size(3840, 2160);//UHDTV1 4K
|
||||
const cv::Size sz4320p = cv::Size(7680, 4320);//UHDTV2 8K
|
||||
|
||||
const cv::Size sz2K = cv::Size(2048, 2048);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user