fixes these warnings:
> ../src/main.c: In function 'capture_completed':
> ../src/main.c:321:9: error: format not a string literal and no format arguments -Werror=format-security
> 321 | snprintf(last_path, sizeof(last_path), args->fname);
> | ^~~~~~~~
> ../src/process_pipeline.c: In function 'setup_capture':
> ../src/process_pipeline.c:165:9: error: format not a string literal and no format arguments [-Werror=format-security]
> 165 | snprintf(burst_dir, sizeof(burst_dir), tempdir);
> | ^~~~~~~~
otherwise, `args->fname` and `tempdir` themself would be interpreted
as the specifier.
When stdout is empty and end is zero. There are several incorrect read and write
access.
Valgrind reported following:
```
==70402== Invalid write of size 1
==70402== at 0x11F626: post_process_finished (process_pipeline.c:1266)
==70402== by 0x53D7C32: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402== by 0x53D88D2: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402== by 0x53D6627: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402== by 0x53D7C32: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402== by 0x53D7C6C: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402== by 0x55D5344: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.8400.1)
==70402== by 0x55D7576: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.8400.1)
==70402== by 0x55D7CDF: g_main_context_iteration (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.8400.1)
==70402== by 0x5407EDC: g_application_run (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402== by 0x11BB5F: main (main.c:1551)
==70402== Address 0xb84651f is 1 bytes before a block of size 16 alloc'd
==70402== at 0x484BDD0: realloc (vg_replace_malloc.c:1801)
==70402== by 0x55DE761: g_realloc (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.8400.1)
==70402== by 0x53AE250: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402== by 0x53AE3C0: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402== by 0x53B6CFC: g_output_stream_write (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402== by 0x53B6E48: g_output_stream_write_all (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402== by 0x53D65EA: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402== by 0x53D7C32: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402== by 0x53D88D2: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402== by 0x53B7D8A: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402== by 0x53D7C32: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402== by 0x53D88D2: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402==
==70402== Invalid read of size 1
==70402== at 0x11F642: post_process_finished (process_pipeline.c:1270)
==70402== by 0x53D7C32: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402== by 0x53D88D2: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402== by 0x53D6627: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402== by 0x53D7C32: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402== by 0x53D7C6C: ??? (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402== by 0x55D5344: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.8400.1)
==70402== by 0x55D7576: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.8400.1)
==70402== by 0x55D7CDF: g_main_context_iteration (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.8400.1)
==70402== by 0x5407EDC: g_application_run (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.8400.1)
==70402== by 0x11BB5F: main (main.c:1551)
```
```
==70481== 7,680 bytes in 2 blocks are definitely lost in loss record 64,498 of 64,727
==70481== at 0x4844818: malloc (vg_replace_malloc.c:446)
==70481== by 0x11EDA5: save_jpeg (process_pipeline.c:1016)
==70481== by 0x11F090: process_image_for_capture_yuv (process_pipeline.c:1078)
==70481== by 0x11F5BC: process_image_for_capture (process_pipeline.c:1249)
==70481== by 0x11FAB3: process_image (process_pipeline.c:1393)
```
On many mobile operating systems it's possible to take picture using
hardware volume buttons.
It's easier to hold the phone and take pictures this way. Additionally
it makes possible to use selfie stick (at least with jack plug).
To be able to handle volume buttons global system shortcuts, that
controls audio level has to be disabled.
gdk_toplevel_inhibit_system_shortcuts tells compositor to block system
keyboard shortcuts, when the camera app has focus. In all other cases
system shortcuts are working like before even if camera app is running
in background.
Device orientation is provided by net.hadess.SensorProxy
iio-proxy-service. If there is no accelerometer on target platform,
then window orientation from X11/wayland is used as before.
In current state after video is processed and saved button has
video-recording icon, that is confusing.
The change handles exit code of movie.sh script and depending on that
notifies UI to set video-inactive icon. video-recording icon is set,
when the user press button to activate video recording.
if photo was taken before, then temporary directory in tmpfs was clean
and removed after all files were processed. Internal burst_dir
variable contains old value for directory, that doesn't exist anymore.
Let's create new temporary directory, when video recording is started.
If there was no picture capture or camera switch after application start, then
state_proc.configuration is uninitialized. If video capture is started
in this case, then segmentation fault happens.
Thread 8 "megapixels-pr" received signal SIGSEGV, Segmentation fault.
1085 if (state_proc.configuration->make != NULL &&
(gdb) p state_proc.configuration
$1 = (libmegapixels_devconfig *) 0x0
state.configuration is set in update_state(), but set only after
init_controls(). After update_process_pipeline() is
called from init_controls() pipeline_change flag is reset and changes
after init_controls() (including state.configuration) are not applied to
state_proc. Removing update_process_pipeline from init_controls()
makes all settings to be applied at the end of update_state().
init_controls() is called only from update_state().