import { SdkVideoCodecCapability } from '../signalingprotocol/SignalingProtocol'; import { Eq } from '../utils/Types'; /** * `VideoCodecCapability` represents a higher level type to wrap `RTCRtpCodec` * and the codec name used in the SDP, while also namespacing static create functions * for codecs supported in the SDK. * * Note that `codecName` is different then `codecCapability.mimeType` */ export default class VideoCodecCapability implements Eq { readonly codecName: string; readonly codecCapability: RTCRtpCodec; constructor(codecName: string, codecCapability: RTCRtpCodec); equals(other: this): boolean; /** * Returns whether the codec capability fmtp line matches. This will not * attempt to match H.264 profile levels (e.g. 5.2, 3.1), see internal comments for * more detailed information. This function takes care of checking for an * expected payload type as well. * * This function is meant to only be used internally. */ fmtpLineMatches(line: string, expectedPayloadType: number): boolean; /** * Helper function to clean up the FMTP line by removing unnecessary parameters * and normalizing certain codec-specific attributes. */ private cleanupFmtpLine; /** * Returns the configuration of VP8 supported by the SDK */ static vp8(): VideoCodecCapability; /** * Returns the configuration of H.264 Baseline Profile supported by the SDK. * * This profile is more likely to use hardware for encode on most browsers * then constrained baseline profile. */ static h264BaselineProfile(): VideoCodecCapability; /** * Returns the configuration of H.264 CBP supported by the SDK. * * This profile is required in all WebRTC implementations and typically * uses software for the encode for stability. Hardware decode is common. */ static h264ConstrainedBaselineProfile(): VideoCodecCapability; /** * Returns the configuration of H.264 Main Profile supported by the SDK * * This profile is more likely to use hardware for encode on most browsers * then constrained baseline profile. It may have modest quality/bitrate improvements * over baseline/constrained baseline profile. */ static h264MainProfile(): VideoCodecCapability; /** * Returns the configuration of H.264 High Profile supported by the SDK. * * Currently most browsers do not have software fallback for high profile * which may impact stability. Its usage should be done with caution. * * On MacOS, until https://bugs.chromium.org/p/chromium/issues/detail?id=1520287 is * resolved, receivers will fail to allocate the decoder for this profile if the sender switches away and back * to this codec (e.g. fallback for a Firefox receiver, and then recovery when the Firefox * receiver leaves). * * If you expect a decent amount of iOS safari traffic, you should include `h264ConstrainedHighProfile` in your * preferences as well. It will be forwarded as High profile to receivers that negotiated High but not Constrained * High */ static h264HighProfile(): VideoCodecCapability; /** * Returns the configuration of H.264 Constrained High Profile supported by the SDK * * This is currently only used on Safari. The same notes on H.264 High Profile apply to this * codec. */ static h264ConstrainedHighProfile(): VideoCodecCapability; /** * Returns the configuration of H.264 recommended by the SDK for maximum compatability. */ static h264(): VideoCodecCapability; /** * Returns the configuration of VP9 profile 0 supported by the SDK. * Profile 0 is for use with 8-bit source content. */ static vp9Profile0(): VideoCodecCapability; /** * Returns the configuration of AV1 recommended by the SDK */ static vp9(): VideoCodecCapability; /** * Returns the configuration of AV1 main profile used by the SDK */ static av1Main(): VideoCodecCapability; /** * Returns the configuration of AV1 recommended by the SDK */ static av1(): VideoCodecCapability; /** * Returns the configuration of codec corresponding to the signaled capability */ static fromSignaled(capability: SdkVideoCodecCapability): VideoCodecCapability | undefined; }