This better describes what the function should do.
We will check the "ready-for-capture" property on video source
if we don't have a wrapper instead of returning false.
}
}
- bool isWrapperReady() {
- if (!wrapperVideoSource) {
+ bool isReadyForCapture() {
+ GstElement *src = videoSource;
+ if (wrapperVideoSource) {
+ src = wrapperVideoSource;
+ }
+
+ if (!src) {
return false;
}
gboolean ready = FALSE;
- g_object_get(wrapperVideoSource, "ready-for-capture", &ready, NULL);
+ g_object_get(src, "ready-for-capture", &ready, NULL);
return ready == TRUE;
}
}
bool QtCamImageMode::canCapture() {
- return QtCamMode::canCapture() && d_ptr->dev->isWrapperReady();
+ return QtCamMode::canCapture() && d_ptr->dev->isReadyForCapture();
}
void QtCamImageMode::applySettings() {