File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -120,9 +120,32 @@ func (rp *RawPacket) InUse() int {
120
120
return rp .inUse
121
121
}
122
122
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
+
123
138
// *** RTP specific functions start here ***
124
139
125
140
// 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)
126
149
type DataPacket struct {
127
150
RawPacket
128
151
payloadLength int16
You can’t perform that action at this time.
0 commit comments