-
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
IS-11 support #271
base: master
Are you sure you want to change the base?
IS-11 support #271
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, Nikita. I've just scanned the code, starting to understand it. Looks very good, just jotted a few comments as I went...
|
||
try | ||
{ | ||
validate_sdp_parameters(receiver, sdp_params); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be configurable by the user as well, I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Made validate_receiver_resources()
a configurable callback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly to https://github.com/sony/nmos-cpp/pull/271/files#r1028471346, I wonder if we want a make_streamcompatibility_receiver_validator
function that takes the SDP parser and validator to prevent the user having to write this whole function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added make_streamcompatibility_receiver_validator
that takes nmos::transport_file_parser
and it has some restrictions:
- this function is expected to parse and validate the transport file at once. Not sure if it can be split into two arguments because I can't imagine a validator that is unaware of the internal details of the transport file format.
- functions of this type take
gate
butparse_rtp_transport_file
(the only function of this type?) doesn't actually use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- functions of this type take
gate
butparse_rtp_transport_file
(the only function of this type?) doesn't actually use it.
Hmm, yeah, I guess that seemed like a good idea at the time... 5bc3962 😄
We don't like making incompatible changes if we can help it, but if the gate
parameter is causing problems, we should revisit.
- this function is expected to parse and validate the transport file at once.
OK, I'll review to understand what you mean!
…move Flow Compatibility API helper functions into details namespace
…raint Set is a subset of another one
# Conflicts: # Development/cmake/NmosCppLibraries.cmake # Development/nmos-cpp-node/config.json # Development/nmos/json_schema.cpp # Development/nmos/json_schema.h # Development/nmos/node_server.cpp # Development/nmos/node_server.h # Development/nmos/settings.h
# Conflicts: # Development/cmake/NmosCppLibraries.cmake # Development/cmake/NmosCppTest.cmake # Development/nmos-cpp-node/config.json # Development/nmos-cpp-node/node_implementation.cpp # Development/nmos/json_fields.h # Development/nmos/json_schema.cpp # Development/nmos/json_schema.h # Development/nmos/model.h # Development/nmos/node_resources.cpp # Development/nmos/node_server.cpp # Development/nmos/node_server.h # Development/nmos/settings.h
Add is10 support
Co-authored-by: Simon Lo <[email protected]>
Co-authored-by: Simon Lo <[email protected]>
streamcompatibility_api.support(U("/") + nmos::patterns::senderType.pattern + U("/") + nmos::patterns::resourceId.pattern + U("/constraints/active/?"), methods::PUT, [&model, validator, active_constraints_handler, effective_edid_setter, &gate_](http_request req, http_response res, const string_t&, const route_parameters& parameters) | ||
{ | ||
nmos::api_gate gate(gate_, req, parameters); | ||
return nmos::details::extract_json(req, gate).then([&model, req, res, parameters, &validator, &active_constraints_handler, &effective_edid_setter, gate](value data) mutable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return nmos::details::extract_json(req, gate).then([&model, req, res, parameters, &validator, &active_constraints_handler, &effective_edid_setter, gate](value data) mutable | |
return nmos::details::extract_json(req, gate).then([&model, req, res, parameters, validator, active_constraints_handler, effective_edid_setter, gate](value data) mutable |
if (active_constraints_handler) | ||
{ | ||
if (!active_constraints_handler(*streamcompatibility_sender, data, intersection)) | ||
{ | ||
can_adhere = false; | ||
|
||
slog::log<slog::severities::warning>(gate, SLOG_FLF) << "Active Constraints update is requested for " << id_type << " but this sender can't adhere to these Constraints"; | ||
set_error_reply(res, status_codes::UnprocessableEntity); | ||
} | ||
} | ||
|
||
if (can_adhere) | ||
{ | ||
details::set_active_constraints(model, resourceId, nmos::fields::constraint_sets(data), intersection, effective_edid_setter); | ||
set_reply(res, status_codes::OK, data); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't 500 be returned if active_constraints_handler
is null?
active_constraints_handler(*streamcompatibility_sender, active_constraints, intersection); | ||
details::set_active_constraints(model, resourceId, nmos::fields::constraint_sets(active_constraints), intersection, effective_edid_setter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't active_constraints_handler
be checked for null before use? If it is null, should it return 500?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the active_constraints_handler
is actually required for the Reset the Active Constraints
, just set_active_constraints
of the resource to reset its intersection_of_caps_and_constraints
and the endpoint_active_constraints
.
Hello everyone!
This PR adds Stream Compatibility Management API (AMWA-TV/is-11@e98d156) implementation and IS-11 support.
Could you please review it and describe what's needed to change to be merged?