Nimbin[12]?Web & Tools / Browser / webkit-caps-normalize.patch

Browser git · main

Minimal browser in C (mini and big variant)

browser c · first commit 2026-08-25 · last commit 2026-10-05 (4 days ago) · synced 3 days ago · upstream: github.com/nimbin2/Browser

C 95.8% Markdown 3.9%
git clone https://git.christianimmanuel.de/web-tools/Browser.gitwget https://git.christianimmanuel.de/web-tools/Browser/archive/Browser.tar.gz
webkit-caps-normalize.patch 827 B · 16 lines raw
--- a/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp
+++ b/Source/WebCore/platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp
@@ -298,7 +298,13 @@
 void GStreamerVideoCaptureSource::generatePresets()
 {
     Vector<VideoPreset> presets;
+    // A V4L2 device may list several sizes in one structure, for instance
+    // width=640, height={ 480, 360 }. Split them into one structure each,
+    // or every size listed that way is skipped below as not discrete - on
+    // a typical laptop camera that is every 4:3 mode.
     auto caps = m_capturer->caps();
+    if (caps)
+        caps = adoptGRef(gst_caps_normalize(gst_caps_copy(caps.get())));
     for (unsigned i = 0; i < gst_caps_get_size(caps.get()); i++) {
         GstStructure* str = gst_caps_get_structure(caps.get(), i);