untangledco / streaming

Media streaming and broadcast systems in Go
https://twitch.tv/untangledco
ISC License
82 stars 5 forks source link

scte35: create constants for all segmentation descriptor types #3

Closed ollytom closed 3 months ago

ollytom commented 3 months ago

The values are documented in SCTE 35 section SCTE 35 section 10.3.3.1. Right now we have magic values floating around. See in particular:

crc_32.go:95:   0x30476DC0,
splice_descriptor.go:152:       case 0x34, 0x30, 0x32, 0x36, 0x38, 0x3a, 0x44, 0x46:
splice_descriptor.go:206:       case 0x34, 0x30, 0x32, 0x36, 0x38, 0x3a, 0x44, 0x46:
splice_info.go:17:  SAPNone                     = 0x30

These should be constants named, for example, ProviderAdStart or so.

ollytom commented 3 months ago

Remaining parts of our package using integer literals instead of named constant segmentation descriptor types are at:

scte35_test.go:148:                     Type:     33,
scte35_test.go:161:                     Type:     48,