@@ -7,13 +7,13 @@ use rtc::interceptor::Registry;
77use rtc:: media_stream:: MediaStreamTrack ;
88use rtc:: peer_connection:: configuration:: RTCConfigurationBuilder ;
99use rtc:: peer_connection:: configuration:: interceptor_registry:: register_default_interceptors;
10- use rtc:: peer_connection:: configuration:: media_engine:: { MIME_TYPE_VP8 , MediaEngine } ;
10+ use rtc:: peer_connection:: configuration:: media_engine:: { MIME_TYPE_HEVC , MediaEngine } ;
1111use rtc:: peer_connection:: sdp:: RTCSessionDescription ;
1212use rtc:: peer_connection:: transport:: RTCIceServer ;
1313use rtc:: rtcp:: payload_feedbacks:: picture_loss_indication:: PictureLossIndication ;
1414use rtc:: rtp_transceiver:: rtp_sender:: {
15- RTCRtpCodec , RTCRtpCodecParameters , RTCRtpCodingParameters , RTCRtpEncodingParameters ,
16- RTCRtpHeaderExtensionCapability , RtpCodecKind ,
15+ RTCRtpCodec , RTCRtpCodingParameters , RTCRtpEncodingParameters , RTCRtpHeaderExtensionCapability ,
16+ RtpCodecKind ,
1717} ;
1818use rtc:: rtp_transceiver:: { RTCRtpTransceiverDirection , RTCRtpTransceiverInit } ;
1919use std:: collections:: HashMap ;
@@ -190,20 +190,7 @@ async fn async_main() -> Result<()> {
190190
191191 let mut media_engine = MediaEngine :: default ( ) ;
192192
193- // Enable VP8 codec for video (matching the sansio RTC simulcast example)
194- let video_codec = RTCRtpCodecParameters {
195- rtp_codec : RTCRtpCodec {
196- mime_type : MIME_TYPE_VP8 . to_owned ( ) ,
197- clock_rate : 90000 ,
198- channels : 0 ,
199- sdp_fmtp_line : "" . to_owned ( ) ,
200- rtcp_feedback : vec ! [ ] ,
201- } ,
202- payload_type : 96 ,
203- ..Default :: default ( )
204- } ;
205-
206- media_engine. register_codec ( video_codec. clone ( ) , RtpCodecKind :: Video ) ?;
193+ media_engine. register_default_codecs ( ) ?;
207194
208195 // Enable extension headers needed for simulcast
209196 for uri in [
@@ -243,15 +230,36 @@ async fn async_main() -> Result<()> {
243230 format ! ( "video_{rid}" ) ,
244231 format ! ( "video_{rid}" ) ,
245232 RtpCodecKind :: Video ,
246- vec ! [ RTCRtpEncodingParameters {
247- rtp_coding_parameters: RTCRtpCodingParameters {
248- rid: rid. to_string( ) ,
249- ssrc: Some ( ssrc) ,
233+ vec ! [
234+ /*RTCRtpEncodingParameters {
235+ rtp_coding_parameters: RTCRtpCodingParameters {
236+ ssrc: Some(ssrc),
237+ ..Default::default()
238+ },
239+ codec: RTCRtpCodec {
240+ mime_type: MIME_TYPE_VP8.to_owned(),
241+ clock_rate: 90000,
242+ channels: 0,
243+ sdp_fmtp_line: "".to_owned(),
244+ rtcp_feedback: vec![],
245+ },
246+ ..Default::default()
247+ },*/
248+ RTCRtpEncodingParameters {
249+ rtp_coding_parameters: RTCRtpCodingParameters {
250+ ssrc: Some ( ssrc) ,
251+ ..Default :: default ( )
252+ } ,
253+ codec: RTCRtpCodec {
254+ mime_type: MIME_TYPE_HEVC . to_owned( ) ,
255+ clock_rate: 90000 ,
256+ channels: 0 ,
257+ sdp_fmtp_line: "" . to_owned( ) ,
258+ rtcp_feedback: vec![ ] ,
259+ } ,
250260 ..Default :: default ( )
251261 } ,
252- codec: video_codec. rtp_codec. clone( ) ,
253- ..Default :: default ( )
254- } ] ,
262+ ] ,
255263 ) ) ) ;
256264 output_track_map. insert ( rid. to_owned ( ) , ( Arc :: clone ( & track) , ssrc) ) ;
257265 tracks_to_add. push ( track) ;
0 commit comments