SMPTE / ris-osvp-metadata-camdkit

Implements the SMPTE RIS OSVP camera metadata model
BSD 3-Clause "New" or "Revised" License
33 stars 6 forks source link

protocol and protocol version: making them less generic, and expressing a dependency #107

Open JGoldstone opened 1 day ago

JGoldstone commented 1 day ago

As the project is still camdkit, and not OpenTrackIOKit, one can imagine others building a different application with new application-specific metadata of their own added on top of core camdkit metadata perhaps used in OpenTrackIO, perhaps not.

The comment for ProtocolVersion in model.py reads "Free string that describes the version of the OpenTrackIO protocol that this sample employs." Through what was probably a copy-and-paste error, the same string is used to describe the Protocol property too.

I suggest two things:

  1. Rename protocol to trackingProtocol and protocolVersion to trackingProtocolVersion. That way if, say, someone re-used components of camdkit in a new protocol for monitoring which physical assets were in use at any one time for fine-grained client accounting, we would have 'trackingProtocol' and 'assetMonitoringProtocol' instead of the more awkward 'protocol' and 'assetMonitoringProtocol', the latter sounding like a special case of the more general former.
  2. Change the comment for TrackingProtocol to be "Free string that describes the tracking protocol used to create this sample" and change the comment for TrackingProtocolVersion to be "Free string that describes the version of the tracking protocol, named in TrackingProtocol, used to create this sample".

That said, one issue raised here is that the presence of trackingProtocolVersion really necessitates the presence of trackingProtocol to be useful, and we don't have a way to express that one property requires another. A way around this would be to change trackingProtocol from being a free string to being a tuple of two free strings, the first being the name of the tracking protocol and the second the version of the tracking protocol.

jamesmosys commented 1 day ago

What about keeping protocol and protocolVersion but updating the description to make it more generic? E.g. "In the case of a protocol, this is a free string by which it is uniquely identified" and "In the case of a protocol, this is a free string which uniquely identifies its version". To the second point I think for readability and parseability it is easier to keep them separate, but I am not set on this!

JGoldstone commented 1 day ago

On reflection I think that the better thing is to change the definition of protocol to be a tuple of two strings, the first indicating the name of the protocol and the second the version. That avoids the whole issue of "what does it mean if the version is there, but not the name?". I will try and prototype and PR this after a mid-morning (NJ time) appointment here.