Skip to content

Commit 1a65466

Browse files
authored
Merge pull request #481 from Eyevinn/fix/vision-mixer-properties
Add framerate and GL passthrough properties to vision mixer
2 parents 8007abe + 3f25f6d commit 1a65466

10 files changed

Lines changed: 320 additions & 184 deletions

File tree

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ members = ["types", "backend", "frontend", "mcp-server"]
44
default-members = ["backend"]
55

66
[workspace.package]
7-
version = "0.4.6"
7+
version = "0.4.7"
88
edition = "2021"
99
license = "MIT OR Apache-2.0"
1010
authors = ["Per Enstedt <[email protected]>"]

backend/src/blocks/builtin/videoformat.rs

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ use crate::gpu::video_convert_mode;
1818
use gstreamer as gst;
1919
use std::collections::HashMap;
2020
use strom_types::{
21-
block::*, common_video_pixel_format_enum_values, common_video_resolution_enum_values,
22-
element::ElementPadRef, PropertyValue, *,
21+
block::*, common_video_framerate_enum_values, common_video_pixel_format_enum_values,
22+
common_video_resolution_enum_values, element::ElementPadRef, PropertyValue, *,
2323
};
2424
use tracing::info;
2525

@@ -73,14 +73,19 @@ impl BlockBuilder for VideoFormatBuilder {
7373
}
7474
}
7575

76-
// Add framerate if specified
76+
// Add framerate if specified (supports both fraction "25/1" and legacy decimal "25" formats)
7777
if let Some(fps) = framerate {
78-
// Convert decimal framerates to proper fractions
79-
let framerate_fraction = match fps {
80-
"23.976" => "24000/1001".to_string(),
81-
"29.97" => "30000/1001".to_string(),
82-
"59.94" => "60000/1001".to_string(),
83-
_ => format!("{}/1", fps),
78+
let framerate_fraction = if fps.contains('/') {
79+
// Already in fraction format (e.g. "25/1", "30000/1001")
80+
fps.to_string()
81+
} else {
82+
// Legacy decimal format — convert to fraction
83+
match fps {
84+
"23.976" => "24000/1001".to_string(),
85+
"29.97" => "30000/1001".to_string(),
86+
"59.94" => "60000/1001".to_string(),
87+
_ => format!("{}/1", fps),
88+
}
8489
};
8590
caps_fields.push(format!("framerate={}", framerate_fraction));
8691
}
@@ -193,20 +198,7 @@ fn videoformat_definition() -> BlockDefinition {
193198
label: "Framerate".to_string(),
194199
description: "Framerate in fps - creates videorate element. Leave empty to pass through.".to_string(),
195200
property_type: PropertyType::Enum {
196-
values: vec![
197-
EnumValue { value: "".to_string(), label: Some("-".to_string()) },
198-
EnumValue { value: "10".to_string(), label: Some("10 fps".to_string()) },
199-
EnumValue { value: "15".to_string(), label: Some("15 fps".to_string()) },
200-
EnumValue { value: "23.976".to_string(), label: Some("23.976 fps (24000/1001)".to_string()) },
201-
EnumValue { value: "24".to_string(), label: Some("24 fps".to_string()) },
202-
EnumValue { value: "25".to_string(), label: Some("25 fps".to_string()) },
203-
EnumValue { value: "29.97".to_string(), label: Some("29.97 fps (30000/1001)".to_string()) },
204-
EnumValue { value: "30".to_string(), label: Some("30 fps".to_string()) },
205-
EnumValue { value: "50".to_string(), label: Some("50 fps".to_string()) },
206-
EnumValue { value: "59.94".to_string(), label: Some("59.94 fps (60000/1001)".to_string()) },
207-
EnumValue { value: "60".to_string(), label: Some("60 fps".to_string()) },
208-
EnumValue { value: "120".to_string(), label: Some("120 fps".to_string()) },
209-
],
201+
values: common_video_framerate_enum_values(true),
210202
},
211203
default_value: Some(PropertyValue::String("".to_string())),
212204
mapping: PropertyMapping {

0 commit comments

Comments
 (0)