Skip to content

Commit

Permalink
assert bitrate value
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlt8 committed Sep 11, 2023
1 parent 8b4def2 commit e913bae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/wyzecam/tutk/tutk_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ def __init__(
:param bitrate: the bit rate, in KB/s to target in the h264/h265 encoder.
"""
super().__init__(10052)
assert 0 <= bitrate <= 255, "bitrate value must be 1-255"
self.frame_size = frame_size + 1
self.bitrate = bitrate
self.fps = fps
Expand Down Expand Up @@ -583,7 +584,7 @@ def __init__(self, value: int = 0):
self.bitrate = value

def encode(self) -> bytes:
return encode(self.code, bytes([self.bitrate, 0, 0, 0, 0]))
return encode(self.code, bytes([self.bitrate, 0, 0, 0, 0, 0]))


class K10052HorizontalFlip(TutkWyzeProtocolMessage):
Expand Down

0 comments on commit e913bae

Please sign in to comment.