untangledco / streaming

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

scte35: support decoding private_command type commands #29

Closed ollytom closed 1 week ago

ollytom commented 1 month ago

This should be relatively easier than splice_schedule commands, since we only need to decode a uint32. The rest is just stored as raw bytes:

type PrivateCommand struct {
    ID   uint32
    Data []byte
}

A function named decodePrivateCommand can go in command.go, under encodePrivateCommand. A corresponding test function can go in command_test.go with a similar implementation to the test function described in #28.