-void QtCamMode::setCaps(const char *property, const QSize& resolution,
- const QPair<int, int> frameRate) {
-
- if (!d_ptr->dev->cameraBin) {
- return;
- }
-
- // TODO: allow proceeding without specifying a frame rate (maybe we can calculate it ?)
- if (frameRate.first <= 0 || frameRate.second <= 0) {
- return;
- }
-
- if (resolution.width() <= 0 || resolution.width() <= 0) {
- return;
- }
-
- QString capsString = QString(CAPS)
- .arg(resolution.width()).arg(resolution.height())
- .arg(frameRate.first).arg(frameRate.second);
-
- GstCaps *caps = gst_caps_from_string(capsString.toAscii());
-
- g_object_set(d_ptr->dev->cameraBin, property, caps, NULL);
-
- gst_caps_unref(caps);
-}
-
-void QtCamMode::setPreviewSize(const QSize& size) {
- if (!d_ptr->dev->cameraBin) {
- return;
- }
-
- if (size.width() <= 0 && size.height() <= 0) {
- g_object_set(d_ptr->dev->cameraBin, "preview-caps", NULL, "post-previews", FALSE, NULL);
- }
- else {
- QString preview = QString(PREVIEW_CAPS).arg(size.width()).arg(size.height());
-
- GstCaps *caps = gst_caps_from_string(preview.toAscii());
-
- g_object_set(d_ptr->dev->cameraBin, "preview-caps", caps, "post-previews", TRUE, NULL);
-
- gst_caps_unref(caps);
- }
-}
-
-void QtCamMode::setFileName(const QString& fileName) {
- d_ptr->doneHandler->fileName = fileName;