lqml/examples/camera
2024-05-23 10:28:06 +02:00
..
build-android add new example 'camera', showing how to use QML Camera on mobile (plus a web-server) 2022-11-06 20:55:58 +01:00
cpp revisions 2024-05-23 10:28:06 +02:00
lisp example 'camera`: add note about possible orientation issues; revision; 2022-11-09 09:42:29 +01:00
platforms add new example 'camera', showing how to use QML Camera on mobile (plus a web-server) 2022-11-06 20:55:58 +01:00
qml revision of example 'camera', add click sound 2022-11-10 10:47:37 +01:00
.gitignore add new example 'camera', showing how to use QML Camera on mobile (plus a web-server) 2022-11-06 20:55:58 +01:00
app.asd revisions 2023-03-18 19:59:08 +01:00
app.pro revisions for SailfishOS 2023-10-18 21:02:46 +02:00
make.lisp revisions 2023-12-12 20:43:12 +01:00
readme.md revision of example 'camera', add click sound 2022-11-10 10:47:37 +01:00
run.lisp example 'camera': fix orientation of both video and saved images 2022-11-08 16:55:09 +01:00

Prepare

Please copy the app template files first:

$ cd ..
$ ./copy.sh camera

Info

This shows how to use the QML Camera item. Only very basic usage is covered here -- of course you can set many parameters, if you want to dive into all the details (see Qt Assistant).

Additionally, a basic web-server is integrated, in order to watch/download the images (mobile device) on the desktop computer. On every new image taken, the index.html is updated.

To display the images on the desktop, enter the following link, using the IP of the mobile device (assuming both desktop and mobile are in the same WiFi):

http://192.168.1.x:1701/

1701 is the default port of :s-http-server (from Quicklisp), which was chosen here because it's both relatively small and works well on mobile.

This example needs a small Qt extension for rotating images. That's necessary here because different devices may have different orientation handling (namely iOS), so the saved images would be displayed with the wrong orientation in the desktop browser.

Note

While testing on different devices (phone/tablet), I discovered that they may behave differently regarding the saved image orientation, even if running the same OS. So, to adapt to your device's behavior, you need to check if it needs image rotation, and adapt function updateImageRotation() (QML) and qt:rotate-image (Lisp).

The current settings worked for me on both an android phone and an iPhone (both older models).

Run

lqml run.lisp

Optionally pass -slime to start a Swank server, and connect from Emacs with M-x slime-connect.

During development you can pass -auto, which will reload all QML files after you made a change to any of them and saved it. For re-initialization after reloading, file lisp/qml-reload/on-reloaded will be loaded.

Closing the window quits the app. If you try to kill it with ctrl-c, you need an additional ctrl-d to exit from ECL. To quit from Slime, do (qq) which is short for (qquit).