Skip to content
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

Updates for v0.9.2 #142

Closed
wants to merge 18 commits into from
Closed
2 changes: 1 addition & 1 deletion src/main/python/camdkit/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def _get_complete_dynamic_clip():
ptp=SynchronizationPTP(
offset=0.0,
domain=1,
master="00:11:22:33:44:55"
leader="00:11:22:33:44:55"
),
offsets=SynchronizationOffsets(1.0,2.0,3.0)
),)
Expand Down
4 changes: 2 additions & 2 deletions src/main/python/camdkit/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@ class SynchronizationPTP:
"""Data structure for PTP synchronization"""

domain: typing.Optional[int] = None
master: typing.Optional[str] = None
leader: typing.Optional[str] = None
offset: typing.Optional[float] = None

def validate(self):
return all([isinstance(self.master, str),
return all([isinstance(self.leader, str),
isinstance(self.offset, float),
isinstance(self.domain, int)])

Expand Down
16 changes: 7 additions & 9 deletions src/main/python/camdkit/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,7 @@ class SourceId(UUIDURNParameter):
units = None

class SourceNumber(NonNegativeIntegerParameter):
"""Number that identifies the index of the stream from a source from which
data is being transported. This is most important in the case where a source
is producing multiple streams of samples.
"""Source Number is a user-configurable value between 1 and 200, unique within an OpenTrackIO network, that is used to generate the multicast IP address for a specific Source from a specific Producer. This ensures that Producers and Consumers can send and receive data for a specific Source Number without requiring prior knowledge of the network topology, or without knowing the specific IP address of a Producer or Consumer. It also ensures that a single Producer can transmit multiple Sources to different Consumers. The Source Number is used in the 4th octet of the multicast IP address.
"""

canonical_name = "sourceNumber"
Expand Down Expand Up @@ -571,9 +569,9 @@ class TimingSynchronization(Parameter):
present: Is the synchronization source present (a synchronization
source can be present but not locked if frame rates differ for
example)
ptp: If the synchronization source is a PTP master, then this object
ptp: If the synchronization source is a PTP leader, then this object
contains:
- "master": The MAC address of the PTP master
- "leader": The MAC address of the PTP leader
- "offset": The timing offset in seconds from the sample timestamp to
the PTP timestamp
- "domain": The PTP domain number
Expand All @@ -584,7 +582,7 @@ class TimingSynchronization(Parameter):
tracking samples
- "videoIn": The tracking device has an external video signal that is
triggering the capture of tracking samples
- "ptp": The tracking device is locked to a PTP master
- "ptp": The tracking device is locked to a PTP leader
- "ntp": The tracking device is locked to an NTP server
"""

Expand All @@ -609,9 +607,9 @@ def validate(value) -> bool:
return False
if value.ptp != None:
# Validate MAC address
if value.ptp.master != None and not (isinstance(value.ptp.master,str) and
if value.ptp.leader != None and not (isinstance(value.ptp.leader,str) and
re.match("[0-9a-f]{2}([-:]?)[0-9a-f]{2}(\\1[0-9a-f]{2}){4}$",
value.ptp.master.lower())):
value.ptp.leader.lower())):
return False
if value.ptp.offset != None and not isinstance(value.ptp.offset, float):
return False
Expand Down Expand Up @@ -686,7 +684,7 @@ def make_json_schema() -> dict:
"type": "object",
"additionalProperties": False,
"properties": {
"master": { "type": "string", "pattern": "^([A-F0-9]{2}:){5}[A-F0-9]{2}$" },
"leader": { "type": "string", "pattern": "^([A-F0-9]{2}:){5}[A-F0-9]{2}$" },
"offset": { "type": "number" },
"domain": { "type": "integer", "minimum": 0, "maximum": 127 }
}
Expand Down
Loading
Loading