@@ -218,10 +218,20 @@ func (r *RTPReceiver) startReceive(parameters RTPReceiveParameters) error { //no
218218 return fmt .Errorf ("%w: %d" , errRTPReceiverWithSSRCTrackStreamNotFound , parameters .Encodings [i ].SSRC )
219219 }
220220
221+ rtxPayloadType := PayloadType (0 )
222+ rtxParam := findRTXCodecParameters (globalParams .Codecs [0 ].PayloadType , globalParams .Codecs )
223+ if rtxParam != nil {
224+ rtxPayloadType = rtxParam .PayloadType
225+ }
226+
221227 streams .streamInfo = createStreamInfo (
222228 "" ,
223229 parameters .Encodings [i ].SSRC ,
224- 0 , 0 , 0 , 0 , 0 ,
230+ parameters .Encodings [i ].RTX .SSRC ,
231+ parameters .Encodings [i ].FEC .SSRC ,
232+ globalParams .Codecs [0 ].PayloadType ,
233+ rtxPayloadType ,
234+ findFECPayloadType (globalParams .Codecs ),
225235 codec ,
226236 globalParams .HeaderExtensions ,
227237 )
@@ -233,7 +243,17 @@ func (r *RTPReceiver) startReceive(parameters RTPReceiveParameters) error { //no
233243 }
234244
235245 if rtxSsrc := parameters .Encodings [i ].RTX .SSRC ; rtxSsrc != 0 {
236- streamInfo := createStreamInfo ("" , rtxSsrc , 0 , 0 , 0 , 0 , 0 , codec , globalParams .HeaderExtensions )
246+ streamInfo := createStreamInfo (
247+ "" ,
248+ rtxSsrc ,
249+ 0 ,
250+ 0 ,
251+ rtxPayloadType ,
252+ 0 ,
253+ 0 ,
254+ rtxParam .RTPCodecCapability ,
255+ globalParams .HeaderExtensions ,
256+ )
237257 rtpReadStream , rtpInterceptor , rtcpReadStream , rtcpInterceptor , err := r .transport .streamsForSSRC (
238258 rtxSsrc ,
239259 * streamInfo ,
0 commit comments