Skip to content

Support SMPTE 2022-7 temporal redundancy SDP#502

Open
thangldw wants to merge 2 commits into
sony:masterfrom
thangldw:fix/is05-temporal-redundancy
Open

Support SMPTE 2022-7 temporal redundancy SDP#502
thangldw wants to merge 2 commits into
sony:masterfrom
thangldw:fix/is05-temporal-redundancy

Conversation

@thangldw

Copy link
Copy Markdown

Summary

  • add structured SDP grammar for ssrc, ssrc-group, and duplication-delay
  • represent SSRC-level temporal redundancy explicitly in sdp_parameters, including SSRC IDs, CNAMEs, delay, and MID
  • generate the RFC 7104 single-media-description form from two identical IS-05 transport legs
  • parse the temporal form back into two receiver transport legs while preserving existing separate-source and separate-destination behavior
  • reject malformed SSRC attributes, unsupported leg counts, and non-identical temporal transport legs

Testing

  • exact IS-05 temporal redundancy example
  • SDP creation/parsing round trip
  • malformed grammar and inconsistent-leg negative cases
  • existing SMPTE 2022-7 variants
  • full suite: 2027 assertions in 161 test cases

This PR is independent of and complementary to #501, so the two remaining modes can be reviewed separately.

Refs #38

@garethsb garethsb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also looks pretty good, thank you. Just a few comments so far!

Comment thread Development/sdp/json.h Outdated
Comment on lines +185 to +186
const web::json::field_as_string ssrc_attribute{ U("ssrc_attribute") };
const web::json::field_as_value_or ssrc_attribute_value{ U("ssrc_attribute_value"), {} };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering whether it would be possible/nice in the JSON model to represent the "source attribute" exactly the same as a top-level attribute is represented but nested here?

I.e. something like:

{ sdp::fields::ssrc_id, id },
{ sdp::fields::attribute, value_of({
    { sdp::fields::name, U("cname") },
    { sdp::fields::value, cname }
}) }

@thangldw thangldw Jul 18, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Representing the SSRC source attribute as a nested name/value object reuses the same JSON shape as a top-level SDP attribute and avoids baking cname-specific fields into the model. I will replace the separate SSRC attribute name/value fields with an attribute object, then update the grammar, generation/parsing paths, and round-trip tests accordingly.

Comment thread Development/nmos/sdp_utils.cpp Outdated
Comment on lines +460 to +463
return sdp::group_semantics::duplication == sdp::group_semantics_type{ sdp::fields::semantics(value) }
&& 2 == sdp::fields::ssrc_ids(value).size()
? 2
: 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not return the actual number of ssrc_ids here, and if necessary bail out higher up if it's not a supported number (0 or 2)?

Suggested change
return sdp::group_semantics::duplication == sdp::group_semantics_type{ sdp::fields::semantics(value) }
&& 2 == sdp::fields::ssrc_ids(value).size()
? 2
: 0;
return sdp::group_semantics::duplication == sdp::group_semantics_type{ sdp::fields::semantics(value) }
? sdp::fields::ssrc_ids(value).size()
: 0;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. The detection code should preserve the actual SSRC cardinality, and the NMOS interpretation layer should own the supported-count decision. In combination with the later comment about the helper having only one call site, I will remove the helper, compute the actual SSRC ID array size at that call site, and keep the two-source requirement only where temporal redundancy is interpreted.

Comment on lines +1222 to +1224
const auto& ssrc_group_value = sdp::fields::value(*ssrc_group);
if (sdp::group_semantics::duplication != sdp::group_semantics_type{ sdp::fields::semantics(ssrc_group_value) }) continue;
if (2 != sdp::fields::ssrc_ids(ssrc_group_value).size()) continue;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This duplicates some of the logic of get_ssrc_duplication_count... but given that function isn't directly usable here, and that means get_ssrc_duplication_count is only used in one place, maybe better to drop that function and inline its code into the single call-site?

@thangldw thangldw Jul 18, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Since the helper has a single call site and the temporal-redundancy parser necessarily performs the same group lookup for additional data, keeping the helper does not buy enough reuse. I will remove it and inline the DUP SSRC-group lookup at the transport-parameter call site, while leaving the richer temporal-redundancy parsing logic in its existing layer.

@thangldw

Copy link
Copy Markdown
Author

The review updates are now pushed in commit 87f9ee2.

This update:

  • represents each SSRC source attribute as a nested name/value attribute object;
  • removes the single-use duplication-count helper and computes the actual SSRC ID cardinality at its call site;
  • keeps the two-source support decision in the temporal-redundancy interpretation path;
  • adds direct coverage for the nested JSON representation.

The focused temporal-redundancy tests pass with 18 assertions across 2 test cases, the existing separate-source/destination tests pass, and the full local suite passes with 2,030 assertions across 161 test cases. The temporary Apple Silicon Catch compatibility patch used by the local test build was fully reverted before committing.

The new GitHub Actions suite is currently marked action_required and appears to be waiting for repository approval.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants