The getCapabilities() method returns the most optimistic view of the capabilities of the system for sending media of the given kind. It does not reserve any resources, ports, or other state but is meant to provide a way to discover the types of capabilities of the browser including which codecs or RTP extensions may be supported.
Docs: RTCRtpSender.getCapabilities(): https://w3c.github.io/webrtc-pc/#dom-rtcrtpsender-getcapabilities RTCRtpReceiver.getCapabilities(): https://w3c.github.io/webrtc-pc/#dom-rtcrtpreceiver-getcapabilities