Open kixelated opened 5 years ago
ditto for the WriteRTP
and ReadRTP
methods. Should combine Header, []byte
into Packet
everywhere.
I am against this. In my case RTP/RTCP packets are generated by other parts of the system, and I use pion/srtp
to encrypt generated packets. The same case is for receiving, I need to decrypt them to []byte
and pass elsewhere for processing.
current:
proposed:
pros:
*rtp.Packet
.Unmarshal
for callers when usertp.Packet
. For example:WriteRTP
.cap(dst) == cap(plaintext)
will avoid an allocation.cons:
Unmarshal
, but net performance is still the same/better.