Relativistic treatment of the decay constants of light and heavy mesons