-
Notifications
You must be signed in to change notification settings - Fork 58
Closed as not planned
Description
current:
EncryptRTP(dst []byte, plaintext []byte, header *rtp.Header) ([]byte, error)
proposed:
EncryptRTP(dst []byte, packet *rtp.Packet) ([]byte, error)
pros:
- Simpler API when callers use
*rtp.Packet. - Avoids an extra
Unmarshalfor callers when usertp.Packet. For example:WriteRTP. - Avoids a memcpy of the payload prior to encryption.
- Removes the implicit assumption that
cap(dst) == cap(plaintext)will avoid an allocation.
cons:
- Worse API when callers use byte slices. Requires
Unmarshal, but net performance is still the same/better. - Removes the option to fill the packet headers after sending. I can't think of a case when this would be practical.
Metadata
Metadata
Assignees
Labels
No labels