@@ -579,6 +579,8 @@ func (p *Packet) paddingSize() byte {
579
579
// MarshalPacketTo serializes the header and payload into bytes.
580
580
// Parts of pion code passes RTP header and payload separately, so this function
581
581
// is provided to help with that.
582
+ //
583
+ // Deprecated: this function is a temporary workaround and will be removed in pion/webrtc v5.
582
584
func MarshalPacketTo (buf []byte , header * Header , payload []byte ) (int , error ) {
583
585
n , err := header .MarshalTo (buf )
584
586
if err != nil {
@@ -591,6 +593,19 @@ func MarshalPacketTo(buf []byte, header *Header, payload []byte) (int, error) {
591
593
// PacketMarshalSize returns the size of the header and payload once marshaled.
592
594
// Parts of pion code passes RTP header and payload separately, so this function
593
595
// is provided to help with that.
596
+ //
597
+ // Deprecated: this function is a temporary workaround and will be removed in pion/webrtc v5.
594
598
func PacketMarshalSize (header * Header , payload []byte ) int {
595
599
return header .MarshalSize () + len (payload ) + int (header .PaddingSize )
596
600
}
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