summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2021-01-19 23:40:16 +0100
committerGitHub <noreply@github.com>2021-01-19 23:40:16 +0100
commit9192dc8ae5b9d1a38a108633e9e33fddb4d5187e (patch)
treecc046623117d6490297f033db0bbd090504613b0 /src
parentTranslated using Weblate (Finnish) (diff)
parentSupport webcams that report [min,max] frame rates (diff)
downloadnheko-9192dc8ae5b9d1a38a108633e9e33fddb4d5187e.tar.xz
Merge pull request #385 from trilene/master
Support webcams that report [min,max] frame rates
Diffstat (limited to 'src')
-rw-r--r--src/WebRTCSession.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/WebRTCSession.cpp b/src/WebRTCSession.cpp
index 094a2906..d306007d 100644
--- a/src/WebRTCSession.cpp
+++ b/src/WebRTCSession.cpp
@@ -184,7 +184,16 @@ addDevice(GstDevice *device)
                                   gst_structure_get_value(structure, "framerate");
                                 if (auto fr = getFrameRate(value); fr)
                                         addFrameRate(caps.frameRates, *fr);
-                                else if (GST_VALUE_HOLDS_LIST(value)) {
+                                else if (GST_VALUE_HOLDS_FRACTION_RANGE(value)) {
+                                        const GValue *minRate =
+                                          gst_value_get_fraction_range_min(value);
+                                        if (auto fr = getFrameRate(minRate); fr)
+                                                addFrameRate(caps.frameRates, *fr);
+                                        const GValue *maxRate =
+                                          gst_value_get_fraction_range_max(value);
+                                        if (auto fr = getFrameRate(maxRate); fr)
+                                                addFrameRate(caps.frameRates, *fr);
+                                } else if (GST_VALUE_HOLDS_LIST(value)) {
                                         guint nRates = gst_value_list_get_size(value);
                                         for (guint j = 0; j < nRates; ++j) {
                                                 const GValue *rate =