GST: Add ability to use other device providers
All checks were successful
PostmarketOS Build / Prepare (push) Successful in 25s
PostmarketOS Build / Build for x86_64 (push) Successful in 1m12s
PostmarketOS Build / Build for aarch64 (push) Successful in 1m20s

Signed-off-by: Vasiliy Doylov <nekocwd@mainlining.org>
This commit is contained in:
Vasiliy Doylov 2025-07-09 15:53:39 +03:00
parent 7710438ba2
commit e03d344d48
Signed by: NekoCWD
GPG key ID: B7BE22D44474A582
2 changed files with 2 additions and 1 deletions

View file

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

View file

@ -82,7 +82,7 @@ public class EyeNeko.Gstreamer : Object {
public static Camera[] get_all () {
if (cameras == null) {
cameras = new Camera[0];
var pwprovider = Gst.DeviceProviderFactory.get_by_name ("pipewiredeviceprovider");
var pwprovider = Gst.DeviceProviderFactory.get_by_name (Env.get_variable_or ("CAM_PROVIDER", "pipewiredeviceprovider"));
pwprovider.start ();
foreach (var device in pwprovider.get_devices ()) {
if (device.has_classes ("Video/Source")) {