|
|
|
@ -532,7 +532,7 @@ class videoInput{ |
|
|
|
|
//Tells you when a new frame has arrived - you should call this if you have specified setAutoReconnectOnFreeze to true
|
|
|
|
|
bool isFrameNew(int deviceID); |
|
|
|
|
|
|
|
|
|
bool isDeviceSetup(int deviceID); |
|
|
|
|
bool isDeviceSetup(int deviceID) const; |
|
|
|
|
|
|
|
|
|
//Returns the pixels - flipRedAndBlue toggles RGB/BGR flipping - and you can flip the image too
|
|
|
|
|
unsigned char * getPixels(int deviceID, bool flipRedAndBlue = true, bool flipImage = false); |
|
|
|
@ -557,11 +557,11 @@ class videoInput{ |
|
|
|
|
//bool setVideoSettingCam(int deviceID, long Property, long lValue, long Flags = NULL, bool useDefaultValue = false);
|
|
|
|
|
|
|
|
|
|
//get width, height and number of pixels
|
|
|
|
|
int getWidth(int deviceID); |
|
|
|
|
int getHeight(int deviceID); |
|
|
|
|
int getSize(int deviceID); |
|
|
|
|
int getFourcc(int deviceID); |
|
|
|
|
double getFPS(int deviceID); |
|
|
|
|
int getWidth(int deviceID) const; |
|
|
|
|
int getHeight(int deviceID) const; |
|
|
|
|
int getSize(int deviceID) const; |
|
|
|
|
int getFourcc(int deviceID) const; |
|
|
|
|
double getFPS(int deviceID) const; |
|
|
|
|
|
|
|
|
|
//completely stops and frees a device
|
|
|
|
|
void stopDevice(int deviceID); |
|
|
|
@ -585,7 +585,7 @@ class videoInput{ |
|
|
|
|
int getDeviceCount(); |
|
|
|
|
void getMediaSubtypeAsString(GUID type, char * typeAsString); |
|
|
|
|
GUID *getMediaSubtypeFromFourcc(int fourcc); |
|
|
|
|
int getFourccFromMediaSubtype(GUID type); |
|
|
|
|
int getFourccFromMediaSubtype(GUID type) const; |
|
|
|
|
|
|
|
|
|
void getVideoPropertyAsString(int prop, char * propertyAsString); |
|
|
|
|
void getCameraPropertyAsString(int prop, char * propertyAsString); |
|
|
|
@ -1422,8 +1422,8 @@ int videoInput::listDevices(bool silent){ |
|
|
|
|
//
|
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
int videoInput::getWidth(int id){ |
|
|
|
|
|
|
|
|
|
int videoInput::getWidth(int id) const |
|
|
|
|
{ |
|
|
|
|
if(isDeviceSetup(id)) |
|
|
|
|
{ |
|
|
|
|
return VDList[id] ->width; |
|
|
|
@ -1439,8 +1439,8 @@ int videoInput::getWidth(int id){ |
|
|
|
|
//
|
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
int videoInput::getHeight(int id){ |
|
|
|
|
|
|
|
|
|
int videoInput::getHeight(int id) const |
|
|
|
|
{ |
|
|
|
|
if(isDeviceSetup(id)) |
|
|
|
|
{ |
|
|
|
|
return VDList[id] ->height; |
|
|
|
@ -1454,8 +1454,8 @@ int videoInput::getHeight(int id){ |
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
|
int videoInput::getFourcc(int id){ |
|
|
|
|
|
|
|
|
|
int videoInput::getFourcc(int id) const |
|
|
|
|
{ |
|
|
|
|
if(isDeviceSetup(id)) |
|
|
|
|
{ |
|
|
|
|
return getFourccFromMediaSubtype(VDList[id]->videoType); |
|
|
|
@ -1465,8 +1465,8 @@ int videoInput::getFourcc(int id){ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
double videoInput::getFPS(int id){ |
|
|
|
|
|
|
|
|
|
double videoInput::getFPS(int id) const |
|
|
|
|
{ |
|
|
|
|
if(isDeviceSetup(id)) |
|
|
|
|
{ |
|
|
|
|
double frameTime= VDList[id]->requestedFrameTime; |
|
|
|
@ -1485,8 +1485,8 @@ double videoInput::getFPS(int id){ |
|
|
|
|
//
|
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
int videoInput::getSize(int id){ |
|
|
|
|
|
|
|
|
|
int videoInput::getSize(int id) const |
|
|
|
|
{ |
|
|
|
|
if(isDeviceSetup(id)) |
|
|
|
|
{ |
|
|
|
|
return VDList[id] ->videoSize; |
|
|
|
@ -1618,11 +1618,10 @@ bool videoInput::isFrameNew(int id){ |
|
|
|
|
//
|
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
bool videoInput::isDeviceSetup(int id){ |
|
|
|
|
|
|
|
|
|
bool videoInput::isDeviceSetup(int id) const |
|
|
|
|
{ |
|
|
|
|
if(id>=0 && id<devicesFound && VDList[id]->readyToCapture)return true; |
|
|
|
|
else return false; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2209,7 +2208,8 @@ void videoInput::getMediaSubtypeAsString(GUID type, char * typeAsString){ |
|
|
|
|
memcpy(typeAsString, tmpStr, sizeof(char)*8); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int videoInput::getFourccFromMediaSubtype(GUID type) { |
|
|
|
|
int videoInput::getFourccFromMediaSubtype(GUID type) const |
|
|
|
|
{ |
|
|
|
|
return type.Data1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -3154,7 +3154,7 @@ VideoCapture_DShow::~VideoCapture_DShow() |
|
|
|
|
CoUninitialize(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
double VideoCapture_DShow::getProperty(int propIdx) |
|
|
|
|
double VideoCapture_DShow::getProperty(int propIdx) const |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
long min_value, max_value, stepping_delta, current_value, flags, defaultValue; |
|
|
|
|