@@ -32,7 +32,7 @@ public class VideoStream : MediaStream
32
32
protected static ILogger logger = Log . Logger ;
33
33
protected RtpVideoFramer RtpVideoFramer ;
34
34
35
- private SDPAudioVideoMediaFormat sendingFormat ;
35
+ private VideoFormat sendingFormat ;
36
36
private bool sendingFormatFound = false ;
37
37
38
38
/// <summary>
@@ -304,28 +304,28 @@ public void SendVideo(uint durationRtpUnits, byte[] sample)
304
304
{
305
305
if ( ! sendingFormatFound )
306
306
{
307
- sendingFormat = GetSendingFormat ( ) ;
307
+ sendingFormat = GetSendingFormat ( ) . ToVideoFormat ( ) ;
308
308
sendingFormatFound = true ;
309
309
}
310
310
311
- int payloadID = Convert . ToInt32 ( sendingFormat . ID ) ;
311
+ int payloadID = sendingFormat . FormatID ;
312
312
313
- switch ( sendingFormat . Name ( ) )
313
+ switch ( sendingFormat . Codec )
314
314
{
315
- case " VP8" :
315
+ case VideoCodecsEnum . VP8 :
316
316
SendVp8Frame ( durationRtpUnits , payloadID , sample ) ;
317
317
break ;
318
- case " H264" :
318
+ case VideoCodecsEnum . H264 :
319
319
SendH264Frame ( durationRtpUnits , payloadID , sample ) ;
320
320
break ;
321
- case " H265" :
321
+ case VideoCodecsEnum . H265 :
322
322
SendH265Frame ( durationRtpUnits , payloadID , sample ) ;
323
323
break ;
324
- case " JPEG" :
324
+ case VideoCodecsEnum . JPEG :
325
325
SendMJPEGFrame ( durationRtpUnits , payloadID , sample ) ;
326
326
break ;
327
327
default :
328
- throw new ApplicationException ( $ "Unsupported video format selected { sendingFormat . Name ( ) } .") ;
328
+ throw new ApplicationException ( $ "Unsupported video format selected { sendingFormat . FormatName } .") ;
329
329
}
330
330
}
331
331
0 commit comments