-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix SDP validating against media_type constraint #241
Conversation
Good catch! I'll think about a unit test as I'm working on this code right now. |
@N-Nagorny, I have written a basic test case. Please would you consider pulling the two commits in https://github.com/garethsb/nmos-cpp/tree/sdp-media-type-constraint-fix and pushing to your PR branch? |
It made me realise an issue around constraints that can't be checked... For example, if the SDP data doesn't include This is possibly an issue in BCP-004-01 too for Controllers, at least I don't think it's clear. "Controllers MAY ignore individual Parameter Constraints whose unique identifiers they do not recognize" maybe needs to go on to say "or for which they cannot determine the value of the parameter"? |
I updated the PR branch. It seems reasonable to me to accept such SDP because it opens opportunity to try. If a vendor cares about strict rules, they populate the SDP and Receiver Caps with more detail to have it rejected for sure. |
If that's true just for some parameters we could do e.g. < { nmos::caps::transport::packet_time, [](CAPS_ARGS) { return nmos::match_number_constraint(sdp.packet_time, con); } },
< { nmos::caps::transport::max_packet_time, [](CAPS_ARGS) { return nmos::match_number_constraint(sdp.max_packet_time, con); } },
< { nmos::caps::transport::st2110_21_sender_type, [](CAPS_ARGS) { if (auto video = get_video(&format)) return nmos::match_string_constraint(video->tp.name, con); else if (auto mux = get_mux(&format)) return nmos::match_string_constraint(mux->tp.name, con); else return false; } }
---
> { nmos::caps::transport::packet_time, [](CAPS_ARGS) { return 0 == sdp.packet_time || nmos::match_number_constraint(sdp.packet_time, con); } },
> { nmos::caps::transport::max_packet_time, [](CAPS_ARGS) { return 0 == sdp.max_packet_time || nmos::match_number_constraint(sdp.max_packet_time, con); } },
> { nmos::caps::transport::st2110_21_sender_type, [](CAPS_ARGS) { if (auto video = get_video(&format)) return video->tp.name.empty() || nmos::match_string_constraint(video->tp.name, con); else if (auto mux = get_mux(&format)) return mux->tp.name.empty() || nmos::match_string_constraint(mux->tp.name, con); else return false; } } But if we want to do this for all parameters, we could modify the |
I've added one additional fix (and a test case) for a bug introduced in the SDP refactor, #225.
was erroneously roundtripped to
The |
I realise that the important difference between various parameter constraints is whether or not the target parameter is required to be indicated in the SDP data or not. I suggest we look at them all in that light, and make a decision before we finalize this PR. |
Of the implemented Receiver capabilities for
I think that analysis means:
|
f7b19fc
to
e6f1b40
Compare
6a75063
to
9d00c35
Compare
* for build and dependencies, e.g. sony#197, sony#198, sony#207, sony#211, sony#215, sony#229, sony#230, sony#235, sony#243 * for SDP parser/generator, e.g. sony#201, sony#205, sony#219, sony#241, sony#242, sony#244 * for RQL, e.g. sony#224 * for CI tests, e.g. sony#218, sony#231, sony#239, sony#250
nmos::media_type
represents IANA media types,sdp::media_type
represents https://tools.ietf.org/html/rfc4566#section-8.2.1. This PR makesmatch_sdp_parameters_constraint_set()
comparing apples to apples.