|
|
@ -70,7 +70,7 @@ public: |
|
|
|
return gp_result_as_string(result); |
|
|
|
return gp_result_as_string(result); |
|
|
|
} |
|
|
|
} |
|
|
|
friend std::ostream & operator<<(std::ostream & ostream, |
|
|
|
friend std::ostream & operator<<(std::ostream & ostream, |
|
|
|
GPhoto2Exception & e) |
|
|
|
const GPhoto2Exception & e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return ostream << e.method << ": " << e.what(); |
|
|
|
return ostream << e.method << ": " << e.what(); |
|
|
|
} |
|
|
|
} |
|
|
@ -336,7 +336,7 @@ void DigitalCameraCapture::initContext() |
|
|
|
CR(gp_camera_autodetect(allDevices, context)); |
|
|
|
CR(gp_camera_autodetect(allDevices, context)); |
|
|
|
CR(numDevices = gp_list_count(allDevices)); |
|
|
|
CR(numDevices = gp_list_count(allDevices)); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (GPhoto2Exception & e) |
|
|
|
catch (const GPhoto2Exception & e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
numDevices = 0; |
|
|
|
numDevices = 0; |
|
|
|
} |
|
|
|
} |
|
|
@ -389,7 +389,7 @@ DigitalCameraCapture::~DigitalCameraCapture() |
|
|
|
gp_context_unref(context); |
|
|
|
gp_context_unref(context); |
|
|
|
context = NULL; |
|
|
|
context = NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (GPhoto2Exception & e) |
|
|
|
catch (const GPhoto2Exception & e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
message(ERROR, "destruction error", e); |
|
|
|
message(ERROR, "destruction error", e); |
|
|
|
} |
|
|
|
} |
|
|
@ -442,7 +442,7 @@ bool DigitalCameraCapture::open(int index) |
|
|
|
opened = true; |
|
|
|
opened = true; |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (GPhoto2Exception & e) |
|
|
|
catch (const GPhoto2Exception & e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
message(WARNING, "opening device failed", e); |
|
|
|
message(WARNING, "opening device failed", e); |
|
|
|
return false; |
|
|
|
return false; |
|
|
@ -491,7 +491,7 @@ void DigitalCameraCapture::close() |
|
|
|
rootWidget = NULL; |
|
|
|
rootWidget = NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
catch (GPhoto2Exception & e) |
|
|
|
catch (const GPhoto2Exception & e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
message(ERROR, "cannot close device properly", e); |
|
|
|
message(ERROR, "cannot close device properly", e); |
|
|
|
} |
|
|
|
} |
|
|
@ -664,7 +664,7 @@ double DigitalCameraCapture::getProperty(int propertyId) const |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
catch (GPhoto2Exception & e) |
|
|
|
catch (const GPhoto2Exception & e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
char buf[128] = ""; |
|
|
|
char buf[128] = ""; |
|
|
|
sprintf(buf, "cannot get property: %d", propertyId); |
|
|
|
sprintf(buf, "cannot get property: %d", propertyId); |
|
|
@ -807,7 +807,7 @@ bool DigitalCameraCapture::setProperty(int propertyId, double value) |
|
|
|
CR(gp_widget_set_changed(widget, 0)); |
|
|
|
CR(gp_widget_set_changed(widget, 0)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
catch (GPhoto2Exception & e) |
|
|
|
catch (const GPhoto2Exception & e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
char buf[128] = ""; |
|
|
|
char buf[128] = ""; |
|
|
|
sprintf(buf, "cannot set property: %d to %f", propertyId, value); |
|
|
|
sprintf(buf, "cannot set property: %d to %f", propertyId, value); |
|
|
@ -849,7 +849,7 @@ bool DigitalCameraCapture::grabFrame() |
|
|
|
capturedFrames++; |
|
|
|
capturedFrames++; |
|
|
|
grabbedFrames.push_back(file); |
|
|
|
grabbedFrames.push_back(file); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (GPhoto2Exception & e) |
|
|
|
catch (const GPhoto2Exception & e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (file) |
|
|
|
if (file) |
|
|
|
gp_file_unref(file); |
|
|
|
gp_file_unref(file); |
|
|
@ -873,7 +873,7 @@ bool DigitalCameraCapture::retrieveFrame(int, OutputArray outputFrame) |
|
|
|
readFrameFromFile(file, outputFrame); |
|
|
|
readFrameFromFile(file, outputFrame); |
|
|
|
CR(gp_file_unref(file)); |
|
|
|
CR(gp_file_unref(file)); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (GPhoto2Exception & e) |
|
|
|
catch (const GPhoto2Exception & e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
message(WARNING, "cannot read file grabbed from device", e); |
|
|
|
message(WARNING, "cannot read file grabbed from device", e); |
|
|
|
return false; |
|
|
|
return false; |
|
|
@ -914,7 +914,7 @@ int DigitalCameraCapture::findDevice(const char * deviceName) const |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
catch (GPhoto2Exception & e) |
|
|
|
catch (const GPhoto2Exception & e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
; // pass
|
|
|
|
; // pass
|
|
|
|
} |
|
|
|
} |
|
|
@ -980,7 +980,7 @@ CameraWidget * DigitalCameraCapture::findWidgetByName( |
|
|
|
} |
|
|
|
} |
|
|
|
return (it != end) ? it->second : NULL; |
|
|
|
return (it != end) ? it->second : NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (GPhoto2Exception & e) |
|
|
|
catch (const GPhoto2Exception & e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
message(WARNING, "error while searching for widget", e); |
|
|
|
message(WARNING, "error while searching for widget", e); |
|
|
|
} |
|
|
|
} |
|
|
|