3838#include " nmos/lldp_manager.h"
3939#endif
4040#include " nmos/media_type.h"
41+ #include " nmos/mxl.h"
4142#include " nmos/model.h"
4243#include " nmos/node_interfaces.h"
4344#include " nmos/node_resource.h"
@@ -119,6 +120,9 @@ namespace impl
119120 // video_type: media type of video flows, e.g. "video/raw" or "video/jxsv", see nmos::media_types
120121 const web::json::field_as_string_or video_type{ U (" video_type" ), U (" video/raw" ) };
121122
123+ // mxl_video_type: media type of MXL video flows and receivers, e.g. "video/v210" or "video/v210a", see nmos/mxl.h
124+ const web::json::field_as_string_or mxl_video_type{ U (" mxl_video_type" ), nmos::media_types::video_v210.name };
125+
122126 // channel_count: controls the number of channels in audio sources
123127 const web::json::field_as_integer_or channel_count{ U (" channel_count" ), 4 };
124128
@@ -412,9 +416,7 @@ void node_implementation_init(nmos::node_model& model, nmos::experimental::contr
412416 const auto seed_id = nmos::experimental::fields::seed_id (model.settings );
413417 const auto node_id = impl::make_id (seed_id, nmos::types::node);
414418 const auto device_id = impl::make_id (seed_id, nmos::types::device);
415- const nmos::id mxl_domain_id = model.settings .has_field (impl::fields::mxl_domain_id)
416- ? impl::fields::mxl_domain_id (model.settings )
417- : nmos::make_repeatable_id (seed_id, U (" /x-nmos/mxl/domain" ));
419+ const auto mxl_domain_id = impl::fields::mxl_domain_id (model.settings );
418420 const auto how_many = impl::fields::how_many (model.settings );
419421 const auto sender_ports = impl::parse_ports (impl::fields::senders (model.settings ));
420422 const auto rtp_sender_ports = boost::copy_range<std::vector<impl::port>>(sender_ports | boost::adaptors::filtered (impl::is_rtp_port));
@@ -433,6 +435,7 @@ void node_implementation_init(nmos::node_model& model, nmos::experimental::contr
433435 const auto sampling = sdp::sampling{ impl::fields::color_sampling (model.settings ) };
434436 const auto bit_depth = impl::fields::component_depth (model.settings );
435437 const auto video_type = nmos::media_type{ impl::fields::video_type (model.settings ) };
438+ const auto mxl_video_type = nmos::media_type{ impl::fields::mxl_video_type (model.settings ) };
436439 const auto channel_count = impl::fields::channel_count (model.settings );
437440 const auto smpte2022_7 = impl::fields::smpte2022_7 (model.settings );
438441
@@ -960,16 +963,14 @@ void node_implementation_init(nmos::node_model& model, nmos::experimental::contr
960963 frame_rate,
961964 frame_width, frame_height, interlace_mode,
962965 colorspace, transfer_characteristic, sampling, bit_depth,
963- video_type ,
966+ mxl_video_type ,
964967 model.settings
965968 );
966969 }
967970 else if (impl::ports::mxl_audio == port)
968971 {
969972 flow = nmos::make_raw_audio_flow (flow_id, source_id, device_id, 48000 , 32 , model.settings );
970- flow.data [nmos::fields::media_type] = value::string (U (" audio/float32" ));
971- // add optional grain_rate
972- flow.data [nmos::fields::grain_rate] = nmos::make_rational (frame_rate);
973+ flow.data [nmos::fields::media_type] = value::string (nmos::media_types::audio_float32.name );
973974 }
974975 else if (impl::ports::mxl_data == port)
975976 {
@@ -1016,46 +1017,29 @@ void node_implementation_init(nmos::node_model& model, nmos::experimental::contr
10161017 nmos::resource receiver;
10171018 if (impl::ports::mxl_video == port)
10181019 {
1019- receiver = nmos::make_receiver (receiver_id, device_id, nmos::transports::mxl, {}, nmos::formats::video, { video_type }, model.settings );
1020- if (nmos::media_types::video_raw == video_type)
1021- {
1022- const auto interlace_modes = nmos::interlace_modes::progressive != interlace_mode
1023- ? std::vector<utility::string_t >{ nmos::interlace_modes::interlaced_bff.name , nmos::interlace_modes::interlaced_tff.name , nmos::interlace_modes::interlaced_psf.name }
1024- : std::vector<utility::string_t >{ nmos::interlace_modes::progressive.name };
1025- receiver.data [nmos::fields::caps][nmos::fields::constraint_sets] = value_of ({
1026- value_of ({
1027- { nmos::caps::format::grain_rate, nmos::make_caps_rational_constraint ({ frame_rate }) },
1028- { nmos::caps::format::frame_width, nmos::make_caps_integer_constraint ({ frame_width }) },
1029- { nmos::caps::format::frame_height, nmos::make_caps_integer_constraint ({ frame_height }) },
1030- { nmos::caps::format::interlace_mode, nmos::make_caps_string_constraint (interlace_modes) },
1031- { nmos::caps::format::color_sampling, nmos::make_caps_string_constraint ({ sampling.name }) }
1032- })
1033- });
1034- }
1035- else if (nmos::media_types::video_jxsv == video_type)
1036- {
1037- const auto max_format_bit_rate = nmos::get_video_jxsv_bit_rate (frame_rate, frame_width, frame_height, max_bits_per_pixel);
1038- const auto max_transport_bit_rate = uint64_t (transport_bit_rate_factor * max_format_bit_rate / 1e3 + 0.5 ) * 1000 ;
1039-
1040- receiver.data [nmos::fields::caps][nmos::fields::constraint_sets] = value_of ({
1041- value_of ({
1042- { nmos::caps::format::profile, nmos::make_caps_string_constraint ({ profile.name }) },
1043- { nmos::caps::format::level, nmos::make_caps_string_constraint ({ level.name }) },
1044- { nmos::caps::format::sublevel, nmos::make_caps_string_constraint ({ nmos::sublevels::Sublev3bpp.name , nmos::sublevels::Sublev4bpp.name }) },
1045- { nmos::caps::format::bit_rate, nmos::make_caps_integer_constraint ({}, nmos::no_minimum<int64_t >(), (int64_t )max_format_bit_rate) },
1046- { nmos::caps::transport::bit_rate, nmos::make_caps_integer_constraint ({}, nmos::no_minimum<int64_t >(), (int64_t )max_transport_bit_rate) },
1047- { nmos::caps::transport::packet_transmission_mode, nmos::make_caps_string_constraint ({ nmos::packet_transmission_modes::codestream.name }) }
1048- })
1049- });
1050- }
1020+ receiver = nmos::make_receiver (receiver_id, device_id, nmos::transports::mxl, {}, nmos::formats::video, { mxl_video_type }, model.settings );
1021+ const auto interlace_modes = nmos::interlace_modes::progressive != interlace_mode
1022+ ? std::vector<utility::string_t >{ nmos::interlace_modes::interlaced_bff.name , nmos::interlace_modes::interlaced_tff.name , nmos::interlace_modes::interlaced_psf.name }
1023+ : std::vector<utility::string_t >{ nmos::interlace_modes::progressive.name };
1024+ receiver.data [nmos::fields::caps][nmos::fields::constraint_sets] = value_of ({
1025+ value_of ({
1026+ { nmos::caps::format::media_type, nmos::make_caps_string_constraint ({ mxl_video_type.name }) },
1027+ { nmos::caps::format::grain_rate, nmos::make_caps_rational_constraint ({ frame_rate }) },
1028+ { nmos::caps::format::frame_width, nmos::make_caps_integer_constraint ({ frame_width }) },
1029+ { nmos::caps::format::frame_height, nmos::make_caps_integer_constraint ({ frame_height }) },
1030+ { nmos::caps::format::interlace_mode, nmos::make_caps_string_constraint (interlace_modes) },
1031+ { nmos::caps::format::color_sampling, nmos::make_caps_string_constraint ({ sampling.name }) },
1032+ { nmos::caps::format::component_depth, nmos::make_caps_integer_constraint ({ bit_depth }) }
1033+ })
1034+ });
10511035 receiver.data [nmos::fields::version] = receiver.data [nmos::fields::caps][nmos::fields::version] = value (nmos::make_version ());
10521036 }
10531037 else if (impl::ports::mxl_audio == port)
10541038 {
1055- receiver = nmos::make_receiver (receiver_id, device_id, nmos::transports::mxl, {}, nmos::formats::audio, { nmos::media_type{ U ( " audio/float32 " ) } }, model.settings );
1039+ receiver = nmos::make_receiver (receiver_id, device_id, nmos::transports::mxl, {}, nmos::formats::audio, { nmos::media_types::audio_float32 }, model.settings );
10561040 receiver.data [nmos::fields::caps][nmos::fields::constraint_sets] = value_of ({
10571041 value_of ({
1058- { nmos::caps::format::media_type, nmos::make_caps_string_constraint ({ U ( " audio/float32 " ) }) },
1042+ { nmos::caps::format::media_type, nmos::make_caps_string_constraint ({ nmos::media_types::audio_float32. name }) },
10591043 { nmos::caps::format::channel_count, nmos::make_caps_integer_constraint ({}, 1 , channel_count) },
10601044 { nmos::caps::format::sample_rate, nmos::make_caps_rational_constraint ({ { 48000 , 1 } }) },
10611045 { nmos::caps::format::sample_depth, nmos::make_caps_integer_constraint ({ 32 }) }
0 commit comments