Skip to content

Commit

Permalink
Add schema files for transport_params
Browse files Browse the repository at this point in the history
  • Loading branch information
afryer-ross authored Mar 27, 2024
1 parent 51919ba commit 315225f
Show file tree
Hide file tree
Showing 4 changed files with 226 additions and 0 deletions.
30 changes: 30 additions & 0 deletions schema/receiver_transport_constraints_ndi.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
98 changes: 98 additions & 0 deletions schema/receiver_transport_params_ndi_json.json
Original file line number Diff line number Diff line change
@@ -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
}
27 changes: 27 additions & 0 deletions schema/sender_transport_constraints_ndi.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
71 changes: 71 additions & 0 deletions schema/sender_transport_params_ndi_json.json
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 315225f

Please sign in to comment.