Skip to content

Enum properties are silently missing from GET element properties — dead "GEnum" match arm #770

Description

@srperens

Description

PipelineManager::get_element_property in gst/pipeline/properties.rs dispatches on the property's GType name, and its enum arm matches the literal string "GEnum":

let type_name = pspec.value_type().name();

let value = match type_name.to_string().as_str() {
    "gchararray" => { ... }
    "gboolean" => { ... }
    ...
    "GEnum" => {
        // Get enum as string
        ...
    }
    _ => {
        return Err(PipelineError::InvalidProperty {
            ...
            reason: format!("Unsupported property type: {}", type_name),
        });
    }
};

An element's enum property reports its own GType name — GstVideoTestSrcPattern, GstDeinterlaceModes, GstRTSPLowerTrans — never "GEnum". So the arm is dead and every enum property falls through to the _ arm.

The pad version of the same function, a few hundred lines down in the same file, gets it right:

_ => {
    // Check if it's an enum type
    if pspec.value_type().is_a(glib::Type::ENUM) {

Expected Behavior

GET /api/flows/{flow_id}/elements/{element_id}/properties returns enum properties (as their nick string, matching the pad path), and .../properties/{name} for a single enum property returns its value.

Actual Behavior

get_element_property returns InvalidProperty { reason: "Unsupported property type: GstVideoTestSrcPattern" }. get_element_properties swallows that — it does if let Ok(value) = self.get_element_property(...) — so enum properties are silently absent from the response rather than reported as an error. A client reading back videotestsrc's pattern gets a map that simply does not contain it.

Steps to Reproduce

  1. Start a flow containing a videotestsrc.
  2. GET /api/flows/{flow_id}/elements/{element_id}/properties.
  3. pattern is missing from the returned map, while num-buffers, is-live and the rest are present.

Additional Context

Read-path only — there is no panic in it, which is why #724 deliberately left it alone (it would change what the API returns, so it wants its own PR and its own openapi/contract consideration). Filed so it does not get lost.

The fix is presumably to replace the "GEnum" arm with the value_type().is_a(glib::Type::ENUM) check the pad path already uses. Note the two paths currently disagree on the representation — the element path's dead arm was written to return enum_value.name() (e.g. GST_VIDEO_TEST_SRC_SNOW), the pad path returns enum_val.nick() (e.g. snow). Nicks are what the write path accepts, so they are the ones worth converging on.

Environment

  • OS: macOS 26.6.2 (arm64)
  • Strom version: 0.6.8
  • GStreamer version: 1.28.6

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions