-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsection.go
More file actions
49 lines (46 loc) · 1.35 KB
/
section.go
File metadata and controls
49 lines (46 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package cuei
// InfoSection is the splice info section of the SCTE 35 cue.
type InfoSection struct {
Name string
TableID string
SectionSyntaxIndicator bool
Private bool
Reserved string
SectionLength uint64
ProtocolVersion uint8
EncryptedPacket bool
EncryptionAlgorithm uint8
PtsAdjustment float64
CwIndex string
Tier string
SpliceCommandLength uint64
SpliceCommandType uint8
DescriptorLoopLength uint64
}
// Decode splice info section values.
func (infosec *InfoSection) Decode(bitn *Bitn) bool {
infosec.Name = "Splice Info Section"
infosec.TableID = bitn.AsHex(8)
if infosec.TableID != "0xfc" {
return false
}
infosec.SectionSyntaxIndicator = bitn.AsBool()
if infosec.SectionSyntaxIndicator {
return false
}
infosec.Private = bitn.AsBool()
infosec.Reserved = bitn.AsHex(2)
infosec.SectionLength = bitn.AsUInt64(12)
infosec.ProtocolVersion = bitn.AsUInt8(8)
if infosec.ProtocolVersion != 0 {
return false
}
infosec.EncryptedPacket = bitn.AsBool()
infosec.EncryptionAlgorithm = bitn.AsUInt8(6)
infosec.PtsAdjustment = bitn.As90k(33)
infosec.CwIndex = bitn.AsHex(8)
infosec.Tier = bitn.AsHex(12)
infosec.SpliceCommandLength = bitn.AsUInt64(12)
infosec.SpliceCommandType = bitn.AsUInt8(8)
return true
}