summaryrefslogtreecommitdiff
path: root/src/multimedia/doc/snippets/multimedia-snippets
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@theqtcompany.com>2014-12-12 12:00:06 +0100
committerYoann Lopes <yoann.lopes@theqtcompany.com>2015-01-13 13:34:41 +0100
commitfe21ee675e72f7cb3936db6aa01862cfd322ce50 (patch)
tree8d2caa1d13b79cff554a7fbb8b98051c0695d683 /src/multimedia/doc/snippets/multimedia-snippets
parentc31d8cddd0a2e1f1ee622bc9ea07d038191ceea2 (diff)
downloadqtmultimedia-fe21ee675e72f7cb3936db6aa01862cfd322ce50.tar.gz
New camera viewfinder settings API.
There already was a control interface for the viewfinder settings but no real public C++ API and a partial QML API. This patch adds a new C++ API and improves the QML API. Supported viewfinder settings are resolution, minimumFrameRate, maximumFrameRate and pixelFormat. The camera can be queried for the supported values for each of these settings. A new control interface was created to match the new API. Change-Id: I289fea038fe46277a5516c956a64280da09ed985 Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
Diffstat (limited to 'src/multimedia/doc/snippets/multimedia-snippets')
-rw-r--r--src/multimedia/doc/snippets/multimedia-snippets/camera.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/multimedia/doc/snippets/multimedia-snippets/camera.cpp b/src/multimedia/doc/snippets/multimedia-snippets/camera.cpp
index 64fd254f4..705a74a73 100644
--- a/src/multimedia/doc/snippets/multimedia-snippets/camera.cpp
+++ b/src/multimedia/doc/snippets/multimedia-snippets/camera.cpp
@@ -36,6 +36,7 @@
#include "qcamera.h"
#include "qcamerainfo.h"
#include "qcameraviewfinder.h"
+#include "qcameraviewfindersettings.h"
#include "qmediarecorder.h"
#include "qcameraimagecapture.h"
#include "qcameraimageprocessing.h"
@@ -273,3 +274,15 @@ void camerafocus()
}
//! [Camera focus zones]
}
+
+void camera_viewfindersettings()
+{
+ //! [Camera viewfinder settings]
+ QCameraViewfinderSettings viewfinderSettings;
+ viewfinderSettings.setResolution(640, 480);
+ viewfinderSettings.setMinimumFrameRate(15.0);
+ viewfinderSettings.setMaximumFrameRate(30.0);
+
+ camera->setViewfinderSettings(viewfinderSettings);
+ //! [Camera viewfinder settings]
+}