@@ -37,7 +37,6 @@ impl CodecInfo {
3737 CodecType :: PCMA => ( "PCMA" . to_string ( ) , None ) ,
3838 CodecType :: G722 => ( "G722" . to_string ( ) , None ) ,
3939 CodecType :: G729 => ( "G729" . to_string ( ) , None ) ,
40- #[ cfg( feature = "opus" ) ]
4140 CodecType :: Opus => (
4241 "opus" . to_string ( ) ,
4342 Some ( "minptime=10;useinbandfec=1" . to_string ( ) ) ,
@@ -174,20 +173,16 @@ impl MediaNegotiator {
174173 let static_codec = if let Ok ( codec) = CodecType :: try_from ( pt) {
175174 let ( rate, chans) = match codec {
176175 CodecType :: PCMU | CodecType :: PCMA | CodecType :: G722 | CodecType :: G729 => ( 8000 , 1 ) ,
177- #[ cfg( feature = "opus" ) ]
178176 CodecType :: Opus => ( 48000 , 2 ) ,
179177 _ => return None ,
180178 } ;
181179 Some ( ( codec, rate, chans) )
182180 } else {
183- #[ cfg( feature = "opus" ) ]
184181 if ( pt == 96 || pt == 111 ) && section. kind == MediaKind :: Audio {
185182 Some ( ( CodecType :: Opus , 48000 , 2 ) )
186183 } else {
187184 None
188185 }
189- #[ cfg( not( feature = "opus" ) ) ]
190- None
191186 } ;
192187
193188 static_codec. map ( |( codec, rate, chans) | CodecInfo {
@@ -339,7 +334,6 @@ impl MediaNegotiator {
339334 /// Build default codec list for RTP endpoints
340335 pub fn default_rtp_codecs ( ) -> Vec < CodecType > {
341336 vec ! [
342- #[ cfg( feature = "opus" ) ]
343337 CodecType :: Opus ,
344338 CodecType :: G729 ,
345339 CodecType :: G722 ,
@@ -352,7 +346,6 @@ impl MediaNegotiator {
352346 /// Build default codec list for WebRTC endpoints
353347 pub fn default_webrtc_codecs ( ) -> Vec < CodecType > {
354348 vec ! [
355- #[ cfg( feature = "opus" ) ]
356349 CodecType :: Opus ,
357350 CodecType :: G722 ,
358351 CodecType :: PCMU ,
@@ -376,7 +369,6 @@ impl MediaNegotiator {
376369 CodecType :: PCMA => "PCMA" ,
377370 CodecType :: G722 => "G722" ,
378371 CodecType :: G729 => "G729" ,
379- #[ cfg( feature = "opus" ) ]
380372 CodecType :: Opus => "opus" ,
381373 CodecType :: TelephoneEvent => "telephone-event" ,
382374 } ;
@@ -472,7 +464,6 @@ impl MediaNegotiator {
472464 } ) ,
473465 _ => {
474466 let preferred_rate = match audio. as_ref ( ) . map ( |codec| codec. codec ) {
475- #[ cfg( feature = "opus" ) ]
476467 Some ( CodecType :: Opus ) => 48000 ,
477468 _ => 8000 ,
478469 } ;
@@ -1528,7 +1519,6 @@ a=rtpmap:0 PCMU/8000\r\n";
15281519 assert_eq ! ( dtmf[ 0 ] . clock_rate, 8000 ) ;
15291520 }
15301521
1531- #[ cfg( feature = "opus" ) ]
15321522 #[ test]
15331523 fn test_callee_offer_appends_dtmf_in_final_audio_clock_order ( ) {
15341524 let caller_sdp = "v=0\r \n \
@@ -1555,7 +1545,6 @@ a=rtpmap:0 PCMU/8000\r\n";
15551545 assert_eq ! ( dtmf[ 1 ] . clock_rate, 48000 ) ;
15561546 }
15571547
1558- #[ cfg( feature = "opus" ) ]
15591548 #[ test]
15601549 fn test_caller_answer_filters_dtmf_by_final_audio_clock_rate ( ) {
15611550 let caller_sdp = "v=0\r \n \
@@ -2244,7 +2233,6 @@ a=rtpmap:8 PCMA/8000\r\n";
22442233 ) ;
22452234 }
22462235
2247- #[ cfg( feature = "opus" ) ]
22482236 #[ test]
22492237 fn test_rewrite_sdp_codec_list_uses_dtmf_clock_rate ( ) {
22502238 let caller_sdp = "v=0\r \n \
0 commit comments