Skip to content

Commit

Permalink
SCTE-35 spec 2023 (11/30) updates
Browse files Browse the repository at this point in the history
  • Loading branch information
futzu authored Dec 21, 2023
1 parent 6347e38 commit d8992ce
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions threefive/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def __init__(self, bites=None):
self.program_splice_flag = None
self.duration_flag = None
self.splice_immediate_flag = None
self.event_id_compliance_flag = None
self.component_count = None
self.components = None
self.unique_program_id = None
Expand Down Expand Up @@ -237,7 +238,8 @@ def _decode_flags(self, bitbin):
self.program_splice_flag = bitbin.as_flag(1)
self.duration_flag = bitbin.as_flag(1)
self.splice_immediate_flag = bitbin.as_flag(1)
bitbin.forward(4)
self.event_id_compliance_flag = bitbin.as_flag(1)
bitbin.forward(3)

def _decode_unique_avail(self, bitbin):
self.unique_program_id = bitbin.as_int(16)
Expand Down Expand Up @@ -296,7 +298,8 @@ def _encode_flags(self, nbin):
self._chk_var(bool, nbin.add_flag, "program_splice_flag", 1)
self._chk_var(bool, nbin.add_flag, "duration_flag", 1)
self._chk_var(bool, nbin.add_flag, "splice_immediate_flag", 1)
nbin.forward(4)
self._chk_var(bool, nbin.add_flag, "event_id_compliance_flag", 1)
nbin.forward(3)

def _encode_components(self, nbin):
"""
Expand Down Expand Up @@ -332,6 +335,7 @@ def __init__(self):
super().__init__(None)
self.name = None
self.utc_splice_time = None
self.event_id_compliance_flag = None

def _decode_components(self, bitbin):
"""
Expand All @@ -345,6 +349,17 @@ def _decode_components(self, bitbin):
"utc_splice_time": bitbin.as_int(32),
}

def _decode_event(self, bitbin):
"""
SpliceEvent._decode_event parses
self.splice_event_id and self.splice_event_cancel_indicator
and the new event_id_compliance_flag.
"""
self.splice_event_id = bitbin.as_int(32)
self.splice_event_cancel_indicator = bitbin.as_flag(1)
event_id_compliance_flag = bitbin.as_flag(1)
bitbin.forward(6)

def decode(self, bitbin):
"""
SpliceEvent.decode
Expand All @@ -369,6 +384,7 @@ def __init__(self, bites=None):
self.name = "Splice Schedule"
self.splices = []


def decode(self):
"""
SpliceSchedule.decode
Expand Down

0 comments on commit d8992ce

Please sign in to comment.