Env: Add ONLY_FORMAT
to filter out all formats except one
Signed-off-by: Vasiliy Doylov <nekocwd@mainlining.org>
This commit is contained in:
parent
639c05e446
commit
e3d22a9f54
2 changed files with 9 additions and 1 deletions
|
@ -13,6 +13,8 @@ Mostly made for PostmarketOS phones
|
|||
- `AUDIO_ENABLED` = `true` - Bool, is audio record enabled (`false` to disable)
|
||||
- `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`)
|
||||
|
||||
## Project TODO:
|
||||
- [ ] Fix cam/mode switching? (I can't reproduce errors)
|
||||
- [ ] Simplify customization
|
||||
|
|
|
@ -130,7 +130,13 @@ public class EyeNeko.Gstreamer : Object {
|
|||
|
||||
construct {
|
||||
var srt = new Gtk.SortListModel (available_caps, new Gtk.CustomSorter ((a, b) => FriendlyCaps.sort_func ((FriendlyCaps) a, (FriendlyCaps) b)));
|
||||
caps_selecton_model.set_model (srt);
|
||||
var fmt = Environment.get_variable ("ONLY_FORMAT");
|
||||
if (fmt != null) {
|
||||
var filter = new Gtk.FilterListModel (srt, new Gtk.CustomFilter ((obj) => ((FriendlyCaps) obj).pixelformat == fmt));
|
||||
caps_selecton_model.set_model (filter);
|
||||
} else
|
||||
caps_selecton_model.set_model (srt);
|
||||
|
||||
caps_selecton_model.notify["selected-item"].connect (() => start_stream_from (current_camera));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue