Skip to content

Commit

Permalink
feat: ensure substream is updated with jovision_profile
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasNeugebauer committed Jan 20, 2025
1 parent d180ffd commit e83d9b9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions rosys/vision/rtsp_camera/rtsp_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(self,
self.ip: str | None = ip

self.substream = jovision_profile or substream
self._register_parameter('jovision_profile', self.get_substream, self.set_jovision_profile,
self._register_parameter('jovision_profile', self.get_jovision_profile, self.set_jovision_profile,
min_value=0, max_value=1, step=1, default_value=substream)
self._register_parameter('substream', self.get_substream, self.set_substream,
min_value=0, max_value=1, step=1, default_value=substream)
Expand All @@ -53,8 +53,7 @@ def to_dict(self) -> dict[str, Any]:
name: param.value for name, param in self._parameters.items()
}
if 'jovision_profile' in parameters:
parameters['substream'] = parameters['jovision_profile']
del parameters['jovision_profile']
del parameters['jovision_profile'] # DEPRECATED: 0.27.0
return super().to_dict() | parameters | {
'ip': self.ip,
}
Expand Down Expand Up @@ -126,6 +125,13 @@ async def get_fps(self) -> int | None:

return await self.device.get_fps()

@deprecated_function(remove_in_version='0.27.0', stacklevel=3)
def get_jovision_profile(self) -> int | None:
assert self.device is not None
self.parameters['substream'].value = profile

return self.get_substream()

@deprecated_function(remove_in_version='0.27.0', stacklevel=3)
def set_jovision_profile(self, profile: int) -> None:
assert self.device is not None
Expand Down

0 comments on commit e83d9b9

Please sign in to comment.