@@ -200,6 +200,8 @@ func (r *RTPReceiver) startReceive(parameters RTPReceiveParameters) error { //no
200200		codec  =  globalParams .Codecs [0 ].RTPCodecCapability 
201201	}
202202
203+ 	fmt .Printf ("RTPReceiver: %v\n " , globalParams .Codecs )
204+ 
203205	for  i  :=  range  parameters .Encodings  {
204206		if  parameters .Encodings [i ].RID  !=  ""  {
205207			// RID based tracks will be set up in receiveForRid 
@@ -218,10 +220,20 @@ func (r *RTPReceiver) startReceive(parameters RTPReceiveParameters) error { //no
218220			return  fmt .Errorf ("%w: %d" , errRTPReceiverWithSSRCTrackStreamNotFound , parameters .Encodings [i ].SSRC )
219221		}
220222
223+ 		rtxPayloadType  :=  PayloadType (0 )
224+ 		rtxParam  :=  findRTXCodecParameters (globalParams .Codecs [0 ].PayloadType , globalParams .Codecs )
225+ 		if  rtxParam  !=  nil  {
226+ 			rtxPayloadType  =  rtxParam .PayloadType 
227+ 		}
228+ 
221229		streams .streamInfo  =  createStreamInfo (
222230			"" ,
223231			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 ),
225237			codec ,
226238			globalParams .HeaderExtensions ,
227239		)
@@ -233,7 +245,17 @@ func (r *RTPReceiver) startReceive(parameters RTPReceiveParameters) error { //no
233245		}
234246
235247		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+ 			)
237259			rtpReadStream , rtpInterceptor , rtcpReadStream , rtcpInterceptor , err  :=  r .transport .streamsForSSRC (
238260				rtxSsrc ,
239261				* streamInfo ,
0 commit comments