Commit Briefs
delete dummy ptp package
We can create it when we want to create it. Think this was accidentally added by me, sorry!
Advertise zero dependencies
Because it’s a distinguishing feature of the project!
scte35: support decoding private commands
Resolves: https://github.com/untangledco/streaming/issues/29
pcap: export Encode, Decode functions
Use Go's io.Reader and io.Writer so that we don't have to keep everything in memory, and it works in a way that Go programmers are familiar with.
m3u8: clarify purpose of some sample playlists
Big Buck Bunny is the classic test sample for a lot of video dev work. tos.m3u8 is here because it is a valid playlist containing lots of comments and empty lines. Unusual, but still a valid playlist; hoping it will help catch bugs in our parser's handling of comments and whitespace.
sdp: only apply TTL field to ipv4 connections
As per section 5.7 of RFC 8866: "IP6" multicast does not use TTL scoping, and hence the TTL value MUST NOT be present for "IP6" multicast. Amends comment to clarify it only applies to IPv4 packets.
sdp: resolve remaining validation, documentation TODOs
No real changes, just notes. Always encode a valid timestamp when session start time is unset but an end time is set. Document the TTL in ConnInfo is a specific property of multicast traffic. No need to impose more structure on session Attributes when the data is pretty free-form anyway (similar to http.Header). Safely round times in session repeat schedules to ensure we never write invalid decimal places.
sdp: parse IP addresses as netip.Addr
Using Addr, we don't have to keep track of the address type ourselves. We also get a guarantee that the values are actually valid IP addresses.
sdp: make the empty Origin Username useful
One less thing for users to worry about, and we'll always encode a valid value.
pcap: support only current savefile version
Reduces the stuff our package exposes. As a bonus we actually return an error if somehow we try to decode a file we may not be able to safely such as older, newer or invalid versions.
pcap: ignore unused global header fields
From pcap-savefile(5) for both the fields: > SHOULD be filled with 0 by pcap file writers, and MUST be ignored by > pcap file readers.
pcap: name testing data directory the usual name
While here name pcap file based on its actual contents.
pcap: test for expected values
Checking just the number of elements in a slice, then eyeballing printed output is prone to human error.
pcap: rename parser.go to pcap
There's no mention of any parsers, and we only have one file containing both encoding and decoding pcap data.
pcap: drop superfluous endianness payload encode
Because it's just a slice of bytes, endianness does not apply.
pcap: decode magic number once
Otherwise we're dealing with it twice when binary.Read does what we need already.
pcap: use data slice length to set length in header
One less thing to keep in sync.
pcap: store packet timestamp as a time.Time
Easier to work with.