@@ -579,6 +579,8 @@ func (p *Packet) paddingSize() byte {
579579// MarshalPacketTo serializes the header and payload into bytes.
580580// Parts of pion code passes RTP header and payload separately, so this function
581581// is provided to help with that.
582+ //
583+ // Deprecated: this function is a temporary workaround and will be removed in pion/webrtc v5.
582584func MarshalPacketTo (buf []byte , header * Header , payload []byte ) (int , error ) {
583585 n , err := header .MarshalTo (buf )
584586 if err != nil {
@@ -591,6 +593,19 @@ func MarshalPacketTo(buf []byte, header *Header, payload []byte) (int, error) {
591593// PacketMarshalSize returns the size of the header and payload once marshaled.
592594// Parts of pion code passes RTP header and payload separately, so this function
593595// is provided to help with that.
596+ //
597+ // Deprecated: this function is a temporary workaround and will be removed in pion/webrtc v5.
594598func PacketMarshalSize (header * Header , payload []byte ) int {
595599 return header .MarshalSize () + len (payload ) + int (header .PaddingSize )
596600}
601+
602+ // HeaderAndPacketMarshalSize returns the size of the header and full packet once marshaled.
603+ // Parts of pion code passes RTP header and payload separately, so this function
604+ // is provided to help with that.
605+ //
606+ // Deprecated: this function is a temporary workaround and will be removed in pion/webrtc v5.
607+ func HeaderAndPacketMarshalSize (header * Header , payload []byte ) (headerSize int , packetSize int ) {
608+ headerSize = header .MarshalSize ()
609+
610+ return headerSize , headerSize + len (payload ) + int (header .PaddingSize )
611+ }
0 commit comments