From 3257e7f5d3cd4b0613b209f48d8113ae086208f7 Mon Sep 17 00:00:00 2001 From: Alun Fryer <133015887+afryer-ross@users.noreply.github.com> Date: Wed, 27 Mar 2024 10:10:38 -0400 Subject: [PATCH] Added schema for transport_param and constraints --- .../receiver_transport_constraints_ndi.json | 30 ++++++ .../receiver_transport_params_ndi_json.json | 98 +++++++++++++++++++ schema/sender_transport_constraints_ndi.json | 27 +++++ schema/sender_transport_params_ndi_json.json | 71 ++++++++++++++ 4 files changed, 226 insertions(+) create mode 100644 schema/receiver_transport_constraints_ndi.json create mode 100644 schema/receiver_transport_params_ndi_json.json create mode 100644 schema/sender_transport_constraints_ndi.json create mode 100644 schema/sender_transport_params_ndi_json.json diff --git a/schema/receiver_transport_constraints_ndi.json b/schema/receiver_transport_constraints_ndi.json new file mode 100644 index 0000000..5870282 --- /dev/null +++ b/schema/receiver_transport_constraints_ndi.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "description": "Used to express the dynamic constraints on NDI receiver transport parameters. These constraints may be set and changed at runtime. Every transport parameter supported must have an entry, even if it is only an empty object.", + "patternProperties": { + "^ext_[a-zA-Z0-9_]+$":{ + "$ref": "constraint-schema.json#/definitions/constraint" + } + }, + "properties": { + "machine_name": { + "$ref": "constraint-schema.json#/definitions/constraint" + }, + "source_name": { + "$ref": "constraint-schema.json#/definitions/constraint" + }, + "source_url": { + "$ref": "constraint-schema.json#/definitions/constraint" + }, + "source_ip": { + "$ref": "constraint-schema.json#/definitions/constraint" + }, + "source_port": { + "$ref": "constraint-schema.json#/definitions/constraint" + }, + "interface_ip": { + "$ref": "constraint-schema.json#/definitions/constraint" + } + } +} \ No newline at end of file diff --git a/schema/receiver_transport_params_ndi_json.json b/schema/receiver_transport_params_ndi_json.json new file mode 100644 index 0000000..a264fdd --- /dev/null +++ b/schema/receiver_transport_params_ndi_json.json @@ -0,0 +1,98 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Describes the transport parameters associated with the NDI transport. The constraints in this schema are minimum constraints, but may be further constrained at the constraints endpoint. NDI Receivers MUST support machine_name and source_name in the Receiver transport_params. Receivers MAY also support source_url, source_address and source_port.", + "title": "NDI Receiver Transport Parameters", + "type": "object", + "properties": { + "machine_name": { + "type": [ + "string", + "null" + ], + "description": "The device name of the Native NDI Sender that is to be connected, as utilized by the NDI SDK. A controller MUST specify machine_name when making a connection. A null value indicates that the Receiver has not yet been configured.", + "anyOf": [ + { + "format": "string" + }, { + "type": "null" + } + ] + }, + "source_name": { + "type": [ + "string", + "null" + ], + "description": "The name of the Native NDI Sender stream in the NDI domain that is to be connected. This property MUST NOT be concatenated with machine_name in the format machine_name (source_name). A controller MUST specify source_name when making a connection. A null value indicates that the Receiver has not yet been configured.", + "anyOf": [ + { + "format": "string" + }, { + "type": "null" + } + ] + }, + "source_url": { + "type": [ + "string", + "null" + ], + "description": "The URL of the NDI Native Sender as utilized by the NDI SDK. The contents are proprietary to the NDI SDK and SHOULD NOT be interpreted.If supported by the Receiver, a controller MAY specify source_url when making a connection if it is known, otherwise the controller MUST set it to null.", + "anyOf": [ + { + "format": "string" + }, { + "type": "null" + } + ] + }, + "source_ip": { + "type": [ + "string", + "null" + ], + "description": "The IP address that the sender is utilizing for the stream. If a receiver or controller specifies the source_address it MUST also specify source_port. If supported by the Receiver, a controller SHOULD specify source_address when making a connection if it is known, otherwise the controller MUST set it to null", + "anyOf": [ + { + "format": "ipv4" + }, { + "format": "ipv6" + }, { + "type": "null" + } + ] + }, + "source_port": { + "type": [ + "integer", + "null" + ], + "description": "The port number that the sender is utilizing for the stream. If a receiver or controller specifies the source_port it MUST also specify source_address. If supported by the Receiver, a controller SHOULD specify source_port when making a connection if it is known, otherwise the controller MUST set it to null.", + "anyOf": [{ + "minimum": 0, + "maximum": 65535 + }, { + "type": "null" + } + ] + }, + "interface_ip": { + "type": "string", + "description": "IP address of the network interface the receiver should use. The receiver should provide an enum in the constraints endpoint, which contain the available interface addresses. If set to auto the receiver must determine which interface to use for itself.", + "anyOf": [{ + "format": "ipv4" + }, { + "format": "ipv6" + }, { + "pattern": "^auto$" + } + ] + } + }, + "patternProperties": { + "^ext_[a-zA-Z0-9_]+$": { + "$ref": "receiver_transport_params_ext.json" + } + }, + "additionalProperties": false + } \ No newline at end of file diff --git a/schema/sender_transport_constraints_ndi.json b/schema/sender_transport_constraints_ndi.json new file mode 100644 index 0000000..55059f4 --- /dev/null +++ b/schema/sender_transport_constraints_ndi.json @@ -0,0 +1,27 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "description": "Used to express the dynamic constraints on NDI sender transport parameters. These constraints may be set and changed at run time. Every transport parameter supported must have an entry, even if it is only an empty object.", + "patternProperties": { + "^ext_[a-zA-Z0-9_]+$":{ + "$ref": "constraint-schema.json#/definitions/constraint" + } + }, + "properties": { + "machine_name": { + "$ref": "constraint-schema.json#/definitions/constraint" + }, + "source_name": { + "$ref": "constraint-schema.json#/definitions/constraint" + }, + "source_url": { + "$ref": "constraint-schema.json#/definitions/constraint" + }, + "source_ip": { + "$ref": "constraint-schema.json#/definitions/constraint" + }, + "source_port": { + "$ref": "constraint-schema.json#/definitions/constraint" + } + } +} \ No newline at end of file diff --git a/schema/sender_transport_params_ndi_json.json b/schema/sender_transport_params_ndi_json.json new file mode 100644 index 0000000..b630421 --- /dev/null +++ b/schema/sender_transport_params_ndi_json.json @@ -0,0 +1,71 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Describes the transport parameters associated with the NDI transport. The constraints in this schema are minimum constraints, but may be further constrained at the constraints endpoint. NDI Senders MUST specify machine_name and source_name in the Sender transport_params. Senders MAY also specify source_url, source_address or source_port", + "title": "NDI Sender Transport Parameters", + "type": "object", + "properties": { + "machine_name": { + "type": [ + "string" + ], + "description": "The device name of the Native NDI Sender as utilized by the NDI SDK. The Sender MUST specify the machine_name. Senders MUST constrain this parameter with appropriate values. Controllers updating this parameter MUST specify a machine_name which is in the Sender contraints or auto to allow the Sender to determine the machine_name.", + "anyOf": [{ + "pattern": "^auto$" + },{ + "format": "string" + } + ] + }, + "source_name": { + "type": [ + "string" + ], + "description": "The name of the Native NDI Sender stream in the NDI domain. This property MUST NOT be concatenated with machine_name in the format machine_name (source_name). The Sender MUST specify the source_name. A controller MAY modify this parameter within the supported constraints of the Sender." + }, + "source_url": { + "type": [ + "string", + "null" + ], + "description": "The URL of the Native NDI Sender as utilized by the NDI SDK. The contents are proprietary to the NDI SDK and SHOULD NOT be interpreted. If unspecified, it MUST be set to null. Senders MUST constrain this parameter with appropriate values. Controllers updating this parameter MUST specify a source_url which is in the Sender contraints or auto to allow the Sender to determine the source_url.", + "anyOf": [{ + "pattern": "^auto$" + },{ + "format": "string" + },{ + "type": "null" + } + ] + }, + "source_ip": { + "type": [ + "string" + ], + "description": "The IP address that the sender is utilizing for the stream. If a sender or controller specifies the source_address it MUST also specify source_port. Controllers updating this parameter MUST specify a source_address which is in the Sender contraints or auto to allow the Sender to determine the source_address.", + "anyOf": [{ + "pattern": "^auto$" + }, { + "format": "ipv4" + }, { + "format": "ipv6" + } + ] + }, + "source_port": { + "type": [ + "integer", + "string" + ], + "description": "The port number that the sender is utilizing for the stream. If a sender or controller specifies the source_port it MUST also specify source_address. Controllers updating this parameter MUST specify a source_port which is in the Sender contraints or auto to allow the Sender to determine the source_port.", + "minimum": 0, + "maximum": 65535, + "pattern": "^auto$" + } + }, + "patternProperties": { + "^ext_[a-zA-Z0-9_]+$": { + "$ref": "sender_transport_params_ext.json" + } + }, + "additionalProperties": false + } \ No newline at end of file