File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,9 +120,32 @@ func (rp *RawPacket) InUse() int {
120120 return rp .inUse
121121}
122122
123+ // SetIsFree sets isFree attr
124+ func (rp * RawPacket ) SetIsFree (v bool ) {
125+ rp .isFree = v
126+ }
127+
128+ // SetBuffer set buffer
129+ func (rp * RawPacket ) SetBuffer (b []byte ) {
130+ rp .buffer = b
131+ }
132+
133+ // SetInUse sets real buffer size
134+ func (raw * RawPacket ) SetInUse (iu int ) {
135+ raw .inUse = iu
136+ }
137+
123138// *** RTP specific functions start here ***
124139
125140// DataPacket RTP packet type to define RTP specific functions
141+ //
142+ // if you want to copy incoming RTP packet as-is. For example
143+ // when you need to redirect RTP packet from WebRTC to plain RTP:
144+ // pkt := rtp.DataPacket{}
145+ // pkt.SetBuffer(buf.Bytes())
146+ // pkt.SetInUse(buf.Len())
147+ // pkt.SetIsFree(true)
148+ // session.WriteData(&pkt)
126149type DataPacket struct {
127150 RawPacket
128151 payloadLength int16
You can’t perform that action at this time.
0 commit comments