// we use. For now we will not set any FPS.
d_ptr->setCaps("image-capture-caps", d->resolution.captureResolution(), -1);
- setPreviewSize(d->resolution.previewResolution());
+ d_ptr->setPreviewSize(d->resolution.previewResolution());
- // TODO: ?
- // d_ptr->resetCaps("video-capture-caps");
+ // If we don't reset the caps then: if we switch from video to image then we fail
+ // the next time we restart the pipeline.
+ d_ptr->resetCaps("video-capture-caps");
}
void QtCamImageMode::start() {
return false;
}
- setFileName(fileName);
+ d_ptr->setFileName(fileName);
g_object_set(d_ptr->dev->cameraBin, "location", fileName.toUtf8().data(), NULL);
g_signal_emit_by_name(d_ptr->dev->cameraBin, "start-capture", NULL);
bool QtCamImageMode::setResolution(const QtCamImageResolution& resolution) {
d->resolution = resolution;
- if (!d_ptr->dev->q_ptr->isRunning() || !d_ptr->dev->q_ptr->isIdle()) {
+ if (!d_ptr->dev->q_ptr->isRunning()) {
+ // We will return true here because setting the resolution on a non-running pipeline
+ // doesn't make much sense (Probably the only use case is as a kind of optimization only).
+ // We will set it anyway when the pipeline gets started.
+ return true;
+ }
+
+ if (!d_ptr->dev->q_ptr->isIdle()) {
return false;
}