Commit Graph

76 Commits

Author SHA1 Message Date
cf2553033f fix missing printf specifiers
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.
2025-06-01 20:28:51 +00:00
Andrey Skvortsov
5f2b7136ca main: replace sprintf with safer snprintf 2025-05-31 10:09:51 +00:00
Andrey Skvortsov
529e7841ab process_pipeline: replace sprintf with snprintf
to avoid potential buffer overflows
2025-05-31 10:09:51 +00:00
Andrey Skvortsov
f64782d9a5 main: fix memleak, when reading g_settings 2025-05-31 10:09:51 +00:00
Andrey Skvortsov
17228b1afa Add possibility to use hardware volume buttons to take a picture
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.
2025-05-31 10:05:58 +00:00
Andrey Skvortsov
4db24ddc5e Automatically rotate image based on accelerometer values
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.
2025-05-19 13:42:21 +03:00
Andrey Skvortsov
6a7d2ec85e video: reset button icon to inactive after video processing
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.
2025-04-08 22:51:27 +00:00
Pavel Machek
13264d6b1c ui: display exposure/gain settings 2024-09-07 22:52:30 +02:00
Pavel Machek
9e4b760b77 ui: Add button with camera status. 2024-09-07 22:52:30 +02:00
Pavel Machek
b5dbc416b5 ae: start using minimum values for controls, too 2024-09-07 22:52:30 +02:00
Pavel Machek
7c59259f27 dgain: Introduce digital gain 2024-09-03 13:12:23 +02:00
Kristian Vos
8f37625309 Allow manually changing the focus using controls 2024-08-05 00:32:21 +00:00
Kristian Vos
64f93cd8f2 Run clang-format on a few files 2024-08-05 00:32:21 +00:00
Kristian Vos
3280c1d113 Refactor camera control functions to use MPControl, store fd in MPControl 2024-08-05 00:32:21 +00:00
Kristian Vos
b1c46f7800 Re-enable flash, refactor to use libmegapixels 2024-07-24 13:57:54 +02:00
Martijn Braam
a84e2c797c Update for new libmegapixels_find_config signature 2024-07-16 01:12:44 +02:00
Martijn Braam
141cd8167b Fix the repository url in the about dialog 2024-07-15 19:25:49 +02:00
Martijn Braam
ccf0314b62 Make the video recording button an icon 2024-07-15 18:03:35 +02:00
Kristian Vos
8b525210bc Fix QR-code/symbol not rendering on top of QR-code correctly 2024-07-10 13:45:59 +02:00
Kristian Vos
ac80896c0c Improve gain/exposure controls 2024-05-11 13:59:48 +02:00
Pavel Machek
f0d8834b4a Pipe for scripts<->application communication, write UYVY files
Got pipe to work between movie subprocess and main code. We use it to
display progress from the scripts. Write "gstreamer raw" files, that
can be worked with easily from gstreamer.
2024-05-06 13:50:44 +02:00
Pavel Machek
1c9202c4cf Add support for short movies
Short movies can now be recorded (~30 seconds, depending on disk
space), with audio. New button is added, for that, depending on state
it shows "Rec" (you can record), "Stop" (you are recording) and "Busy"
(movie is being converted).
2024-04-30 18:09:42 +00:00
Kristian Vos
98108a7f74 Fix and improve switch camera and its error handling 2024-04-26 15:04:11 +02:00
Martijn Braam
421c4afdfa Show user-visible error when no camera is available. 2024-04-13 01:53:42 +02:00
Martijn Braam
8ca9028d45 Change app-id to me.gapixels.Megapixels 2023-12-02 12:30:06 +01:00
Martijn Braam
b2e8b04d26 Fix GTK4 deprecations in main.c 2023-11-26 14:32:44 +01:00
Martijn Braam
a6de61f475 Implement whitebalance 2023-08-16 14:45:57 +02:00
Martijn Braam
16dfb9ba19 Close the AAA loop 2023-07-21 14:06:32 +02:00
Martijn Braam
f26f81e3f1 Refactor controls more 2023-07-21 13:19:26 +02:00
Martijn Braam
e97ce527b0 Pause frame processing when window is not active 2023-07-20 18:27:17 +02:00
Martijn Braam
6e8293116b Process pipeline refactoring 2023-07-20 17:40:00 +02:00
Martijn Braam
d51a2fb263 Refactor controls 2023-07-20 16:36:58 +02:00
Martijn Braam
c4969cec6c Continue refactoring of global state 2023-07-20 11:39:30 +02:00
Martijn Braam
0170544013 WIP 2023-07-16 23:18:14 +02:00
Martijn Braam
2f48f31b6a Set a nonzero burst length 2023-07-12 16:20:42 +02:00
Martijn Braam
78cccdd596 Pass the correct buffer size through the pipeline again 2023-07-12 15:30:03 +02:00
Martijn Braam
3ee314a68d Add libmegapixels 2023-07-11 23:43:23 +02:00
xad6
e75eb375de detect rotation directly via X or Wayland
Fixes #44

This commit changes the way that screen rotation is detected. Instead of
using Mutter's DBus interface, we now listen directly for X and Wayland
events indicating the screen has been rotated (RRScreenChangeNotify and
wl_output::geometry events). This has the advantage of working outside
of Phosh.
2022-11-21 20:10:46 +01:00
Guido Günther
9cb23ee076 Allow to toggle shutter sound on/off (MR 24) 2022-10-20 12:28:39 +02:00
Guido Günther
0dbb567445 Use libfeedback to emit shutter sound (MR 24)
This makes it simpler to notice that a picture was taken
2022-10-20 12:28:19 +02:00
Guido Günther
f77e28924e main: Untabify (MR 24)
Don't mix tab and spaces. This makes untabifying after changes simpler.
2022-10-12 11:00:05 +02:00
Martijn Braam
ee26b8e6f7 Add postprocessor setting dropdown (MR 18) 2022-06-24 15:38:56 +02:00
Martijn Braam
46b07c6c4d Move postprocessor script to a gsetting (MR 18) 2022-06-24 14:38:11 +02:00
Yassine Oudjana
a4c2c1ec1f Move mode types and functions to a new object (MR 13)
Rename MPCameraMode to a more generic MPMode and move it along
with related functions to a new object in preparation for using
it in the device object.
2022-06-21 17:30:16 +02:00
Martijn Braam
899748df46 Change burst length depending on gain
The burst_length is now calculated before taking the first picture
by increasing the number of frames when the sensor gain is raised.
2022-06-21 16:29:23 +02:00
Pablo Correa Gómez
b86fb80ed8 Update website URL in About dialog 2022-01-16 15:49:45 +01:00
Pablo Correa Gómez
e29b00f068 Set parent window in About dialog
Fixes dialog text not always fitting in screen. Additionally,
the dialog is now centered instead of appearing at the bottom
of the screen.
2022-01-16 15:49:43 +01:00
Benjamin Schaaf
e494302cdc Disable flash by default
The current flash implementation isn't great so should be disabled by
default for now.
2021-12-13 22:58:53 +11:00
Benjamin Schaaf
e1d9e49f06 Fix formatting 2021-12-13 22:43:12 +11:00
Benjamin Schaaf
c1701921e5 Fix GVariant leak when display config is changed, ie. device is rotated 2021-12-13 22:35:31 +11:00