func (p *TransportLayerNack) Unmarshal(rawPacket []byte) error {
	if len(rawPacket) < (headerLength + ssrcLength) {
		return errPacketTooShort
	}
	var h Header
	if err := h.Unmarshal(rawPacket); err != nil {
		return err
	}
	if len(rawPacket) < (headerLength + int(4*h.Length)) {
		return errPacketTooShort
	}
	if h.Type != TypeTransportSpecificFeedback || h.Count != FormatTLN {
		return errWrongType
	}
	p.SenderSSRC = binary.BigEndian.Uint32(rawPacket[headerLength:])
	p.MediaSSRC = binary.BigEndian.Uint32(rawPacket[headerLength+ssrcLength:])
	for i := headerLength + nackOffset; i < (headerLength + int(h.Length*4)); i += 4 {
		p.Nacks = append(p.Nacks, NackPair{
			binary.BigEndian.Uint16(rawPacket[i:]),
			PacketBitmap(binary.BigEndian.Uint16(rawPacket[i+2:])),
		})
	}
	return nil
}
Unmarshal decodes the TransportLayerNack from binary
package rtcp
import (
	"encoding/binary"
	"fmt"
	"math"
)
type PacketBitmap uint16
type NackPair struct {
	PacketID uint16
	LostPackets PacketBitmap
}
type TransportLayerNack struct {
	SenderSSRC uint32
	MediaSSRC uint32
	Nacks []NackPair
}
var _ Packet = (*TransportLayerNack)(nil)  
func (n *NackPair) PacketList() []uint16 {
	out := make([]uint16, 1, 17)
	out[0] = n.PacketID
	b := n.LostPackets
	for i := uint16(0); b != 0; i++ {
		if (b & (1 << i)) != 0 {
			b &^= (1 << i)
			out = append(out, n.PacketID+i+1)
		}
	}
	return out
}
const (
	tlnLength  = 2
	nackOffset = 8
)
func (p TransportLayerNack) Marshal() ([]byte, error) {
	if len(p.Nacks)+tlnLength > math.MaxUint8 {
		return nil, errTooManyReports
	}
	rawPacket := make([]byte, nackOffset+(len(p.Nacks)*4))
	binary.BigEndian.PutUint32(rawPacket, p.SenderSSRC)
	binary.BigEndian.PutUint32(rawPacket[4:], p.MediaSSRC)
	for i := 0; i < len(p.Nacks); i++ {
		binary.BigEndian.PutUint16(rawPacket[nackOffset+(4*i):], p.Nacks[i].PacketID)
		binary.BigEndian.PutUint16(rawPacket[nackOffset+(4*i)+2:], uint16(p.Nacks[i].LostPackets))
	}
	h := p.Header()
	hData, err := h.Marshal()
	if err != nil {
		return nil, err
	}
	return append(hData, rawPacket...), nil
}