@@ -200,6 +200,8 @@ func (r *RTPReceiver) startReceive(parameters RTPReceiveParameters) error { //no
200
200
codec = globalParams .Codecs [0 ].RTPCodecCapability
201
201
}
202
202
203
+ fmt .Printf ("RTPReceiver: %v\n " , globalParams .Codecs )
204
+
203
205
for i := range parameters .Encodings {
204
206
if parameters .Encodings [i ].RID != "" {
205
207
// RID based tracks will be set up in receiveForRid
@@ -218,10 +220,20 @@ func (r *RTPReceiver) startReceive(parameters RTPReceiveParameters) error { //no
218
220
return fmt .Errorf ("%w: %d" , errRTPReceiverWithSSRCTrackStreamNotFound , parameters .Encodings [i ].SSRC )
219
221
}
220
222
223
+ rtxPayloadType := PayloadType (0 )
224
+ rtxParam := findRTXCodecParameters (globalParams .Codecs [0 ].PayloadType , globalParams .Codecs )
225
+ if rtxParam != nil {
226
+ rtxPayloadType = rtxParam .PayloadType
227
+ }
228
+
221
229
streams .streamInfo = createStreamInfo (
222
230
"" ,
223
231
parameters .Encodings [i ].SSRC ,
224
- 0 , 0 , 0 , 0 , 0 ,
232
+ parameters .Encodings [i ].RTX .SSRC ,
233
+ parameters .Encodings [i ].FEC .SSRC ,
234
+ globalParams .Codecs [0 ].PayloadType ,
235
+ rtxPayloadType ,
236
+ findFECPayloadType (globalParams .Codecs ),
225
237
codec ,
226
238
globalParams .HeaderExtensions ,
227
239
)
@@ -233,7 +245,17 @@ func (r *RTPReceiver) startReceive(parameters RTPReceiveParameters) error { //no
233
245
}
234
246
235
247
if rtxSsrc := parameters .Encodings [i ].RTX .SSRC ; rtxSsrc != 0 {
236
- streamInfo := createStreamInfo ("" , rtxSsrc , 0 , 0 , 0 , 0 , 0 , codec , globalParams .HeaderExtensions )
248
+ streamInfo := createStreamInfo (
249
+ "" ,
250
+ rtxSsrc ,
251
+ 0 ,
252
+ 0 ,
253
+ rtxPayloadType ,
254
+ 0 ,
255
+ 0 ,
256
+ rtxParam .RTPCodecCapability ,
257
+ globalParams .HeaderExtensions ,
258
+ )
237
259
rtpReadStream , rtpInterceptor , rtcpReadStream , rtcpInterceptor , err := r .transport .streamsForSSRC (
238
260
rtxSsrc ,
239
261
* streamInfo ,
0 commit comments