public void ValidateRtpHeaderExtension(RtpHeaderExtension ext) { // Kind is mandatory. if (ext.Kind != MediaKind.Audio && ext.Kind != MediaKind.Video) { throw new Exception("invalid ext.kind"); } // Uri is mandatory. if (ext.Uri is null) { throw new Exception("missing ext.uri"); } // PreferredEncrypt is optional. If unset set it to false. if (!ext.PreferredEncrypt.HasValue) { ext.PreferredEncrypt = false; } // Direction is optional. If unset set it to sendrecv. if (!ext.Direction.HasValue) { ext.Direction = Direction.SendOnly; } }
bool MatchHeaderExtensions(RtpHeaderExtension aExt, RtpHeaderExtension bExt) { if (aExt.Kind != bExt.Kind) { return(false); } if (!aExt.Uri.Equals(bExt.Uri)) { return(false); } return(true); }