GST: Add ability to rotate picture
All checks were successful
PostmarketOS Build / Prepare (push) Successful in 14s
PostmarketOS Build / Build for aarch64 (push) Successful in 2m12s
PostmarketOS Build / Build for x86_64 (push) Successful in 52s

Signed-off-by: Vasiliy Doylov <nekocwd@mainlining.org>
This commit is contained in:
Vasiliy Doylov 2025-07-09 18:18:37 +03:00
parent f273162252
commit 406db77d75
Signed by: NekoCWD
GPG key ID: B7BE22D44474A582
2 changed files with 4 additions and 1 deletions

View file

@ -15,6 +15,7 @@ Mostly made for PostmarketOS phones
- `CAM_CAPS` = auto max caps by default - String - `CAM_CAPS` = auto max caps by default - String
- `ONLY_FORMAT` = null - String, filter pixel formats to show only one (e.g `RGB`) - `ONLY_FORMAT` = null - String, filter pixel formats to show only one (e.g `RGB`)
- `CAM_PROVIDER` = `pipewiredeviceprovider` - String, camera provider name (e.g `libcameraprovider`) - `CAM_PROVIDER` = `pipewiredeviceprovider` - String, camera provider name (e.g `libcameraprovider`)
- `ROTATE` = `0` - Int, Rotation
## Project TODO: ## Project TODO:
- [ ] Fix cam/mode switching? (I can't reproduce errors) - [ ] Fix cam/mode switching? (I can't reproduce errors)

View file

@ -51,6 +51,7 @@ public class EyeNeko.Gstreamer : Object {
private Elements.Downscale downscale = new Elements.Downscale (); private Elements.Downscale downscale = new Elements.Downscale ();
private Gst.Element camera_convert_caps = Gst.ElementFactory.make ("capsfilter"); private Gst.Element camera_convert_caps = Gst.ElementFactory.make ("capsfilter");
public Elements.QrScaner qr_scaner = new Elements.QrScaner (); public Elements.QrScaner qr_scaner = new Elements.QrScaner ();
private Gst.Element rotate = Gst.ElementFactory.make ("glvideoflip");
// Other Fields // Other Fields
public Camera current_camera = null; public Camera current_camera = null;
@ -199,12 +200,13 @@ public class EyeNeko.Gstreamer : Object {
qr_scaner, qr_scaner,
Gst.ElementFactory.make ("videoconvert"), Gst.ElementFactory.make ("videoconvert"),
Gst.ElementFactory.make ("glupload"), Gst.ElementFactory.make ("glupload"),
rotate,
color_correction_matrix, color_correction_matrix,
Gst.ElementFactory.make ("gldownload") Gst.ElementFactory.make ("gldownload")
)); ));
camerabin.set_property ("image-filter", Gst.ElementFactory.make ("videoconvert")); camerabin.set_property ("image-filter", Gst.ElementFactory.make ("videoconvert"));
rotate.set ("method", int.parse (Env.get_variable_or ("ROTATE", "0")));
camerabin.set_property ("video-filter", camerabin.set_property ("video-filter",
pipe_elements ("Video Processing", pipe_elements ("Video Processing",
Gst.ElementFactory.make ("videoconvert"), Gst.ElementFactory.make ("videoconvert"),