fixup! GST: Add caps selector
WIP Signed-off-by: Vasiliy Doylov <nekocwd@mainlining.org>
This commit is contained in:
parent
bb7fa950c1
commit
c98a61d6b7
2 changed files with 1 additions and 14 deletions
|
@ -32,8 +32,6 @@ public class EyeNeko.Gstreamer : Object {
|
||||||
available_caps.remove_all ();
|
available_caps.remove_all ();
|
||||||
for (uint i = 0; i < caps.get_size (); i++) {
|
for (uint i = 0; i < caps.get_size (); i++) {
|
||||||
var cap = new FriendlyCaps.with_struct (caps.get_structure (i));
|
var cap = new FriendlyCaps.with_struct (caps.get_structure (i));
|
||||||
if (cap.pixelformat != "RGB" || available_caps.n_items > uint.parse (Env.get_variable_or ("FMT_N", "10")))
|
|
||||||
continue;
|
|
||||||
available_caps.append (cap);
|
available_caps.append (cap);
|
||||||
best_caps = (best_caps == null || cap.is_res_better (best_caps)) ? cap : best_caps;
|
best_caps = (best_caps == null || cap.is_res_better (best_caps)) ? cap : best_caps;
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,8 +95,8 @@ public class EyeNeko.Window : Adw.ApplicationWindow {
|
||||||
child = new Gtk.ListView (Gstreamer.instance.caps_selecton_model, factory) {
|
child = new Gtk.ListView (Gstreamer.instance.caps_selecton_model, factory) {
|
||||||
css_classes = { "caps-list" },
|
css_classes = { "caps-list" },
|
||||||
},
|
},
|
||||||
propagate_natural_height = true,
|
|
||||||
propagate_natural_width = true,
|
propagate_natural_width = true,
|
||||||
|
height_request = 300,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
video_caps_btn.set_popover (popover);
|
video_caps_btn.set_popover (popover);
|
||||||
|
@ -137,16 +137,5 @@ public class EyeNeko.Window : Adw.ApplicationWindow {
|
||||||
Gstreamer.instance.start_stream_from (null);
|
Gstreamer.instance.start_stream_from (null);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
var ts = new TimeoutSource.seconds (5);
|
|
||||||
ts.set_callback (() => {
|
|
||||||
for (var i = 0; i < Gstreamer.instance.available_caps.n_items; i++) {
|
|
||||||
message ("%s", ((FriendlyCaps) Gstreamer.instance.available_caps.get_item (i)).to_string ());
|
|
||||||
}
|
|
||||||
message ("==== %u items ====", Gstreamer.instance.available_caps.n_items);
|
|
||||||
popover.popup ();
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
ts.attach ();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue