File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -877,5 +877,21 @@ fn customize_sent_sdp(sdp: &gst_sdp::SDPMessage) -> Result<gst_sdp::SDPMessage>
877
877
} ) ;
878
878
} ) ;
879
879
880
+ // Some SDP from RTSP cameras end up with a "a=recvonly" that breaks the webrtcbin when the browser responds, so we are removing them here
881
+ new_sdp. medias_mut ( ) . for_each ( |media| {
882
+ let mut attributes_to_remove = media
883
+ . attributes ( )
884
+ . enumerate ( )
885
+ . filter_map ( |( attribute_idx, attribute) | {
886
+ matches ! ( attribute. key( ) , "recvonly" ) . then_some ( attribute_idx)
887
+ } )
888
+ . collect :: < Vec < usize > > ( ) ;
889
+ attributes_to_remove. reverse ( ) ;
890
+
891
+ for attribute_idx in attributes_to_remove {
892
+ let _ = media. remove_attribute ( attribute_idx as u32 ) ;
893
+ }
894
+ } ) ;
895
+
880
896
Ok ( new_sdp)
881
897
}
You can’t perform that action at this time.
0 commit comments