Skip to content

Commit 0e376f2

Browse files
shienaj20001970
andcommitted
Display format fps by checking dictionary keys
Co-authored-by: Jason Kuo <[email protected]>
1 parent 2ce7c5a commit 0e376f2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

misc/camera_feed/camerafeed.gd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,11 @@ func _update_format_list() -> void:
106106
for format in formats:
107107
var resolution := str(format["width"]) + "x" + str(format["height"])
108108
var item := "%s - %s" % [format["format"], resolution]
109-
if OS.get_name() == "Windows":
109+
110+
if format.has("frame_denominator") and format.has("frame_numerator"):
110111
item += " : %s / %s" % [format["frame_numerator"], format["frame_denominator"]]
112+
elif format.has("framerate_denominator") and format.has("framerate_numerator"):
113+
item += " : %s / %s" % [format["framerate_numerator"], format["framerate_denominator"]]
111114
format_list.add_item(item)
112115

113116
# Auto-select first format.

0 commit comments

Comments
 (0)