Home
WebRTC module

NegotiatedCodec

Result of codec negotiation between a remote SDP offer and the local FFmpeg codec inventory.

NegotiatedCodec

#include <icy/webrtc/codecnegotiator.h>
struct NegotiatedCodec

Defined in src/webrtc/include/icy/webrtc/codecnegotiator.h:81

Result of codec negotiation between a remote SDP offer and the local FFmpeg codec inventory.

List of all members

NameKindOwner
rtpNamevariableDeclared here
ffmpegNamevariableDeclared here
payloadTypevariableDeclared here
clockRatevariableDeclared here
fmtpvariableDeclared here
toVideoCodecfunctionDeclared here
toWebRtcVideoCodecfunctionDeclared here
toAudioCodecfunctionDeclared here
toWebRtcAudioCodecfunctionDeclared here

Public Attributes

ReturnNameDescription
std::stringrtpNameRTP codec name (e.g. "H264", "VP8", "opus")
std::stringffmpegNameFFmpeg encoder name (e.g. "libx264", "libvpx", "libopus")
intpayloadTypeRTP payload type from SDP.
uint32_tclockRateRTP clock rate (90000 for video, 48000 for opus)
std::stringfmtpFormat parameters (e.g. "profile-level-id=42e01f")

rtpName

std::string rtpName

Defined in src/webrtc/include/icy/webrtc/codecnegotiator.h:83

RTP codec name (e.g. "H264", "VP8", "opus")


ffmpegName

std::string ffmpegName

Defined in src/webrtc/include/icy/webrtc/codecnegotiator.h:84

FFmpeg encoder name (e.g. "libx264", "libvpx", "libopus")


payloadType

int payloadType = 0

Defined in src/webrtc/include/icy/webrtc/codecnegotiator.h:85

RTP payload type from SDP.


clockRate

uint32_t clockRate = 0

Defined in src/webrtc/include/icy/webrtc/codecnegotiator.h:86

RTP clock rate (90000 for video, 48000 for opus)


fmtp

std::string fmtp

Defined in src/webrtc/include/icy/webrtc/codecnegotiator.h:87

Format parameters (e.g. "profile-level-id=42e01f")

Public Methods

ReturnNameDescription
av::VideoCodectoVideoCodec constCreate an av::VideoCodec from this negotiation result. Width, height, fps default to 0 (caller should set these).
av::VideoCodectoWebRtcVideoCodec constCreate an av::VideoCodec configured for WebRTC browser playback. Sets low-latency options: ultrafast preset, zerolatency tune, constrained baseline profile for H.264, and appropriate defaults for VP8/VP9/AV1.
av::AudioCodectoAudioCodec constCreate an av::AudioCodec from this negotiation result. Channels default to 2, sampleRate to the RTP clock rate.
av::AudioCodectoWebRtcAudioCodec constCreate an av::AudioCodec configured for WebRTC browser playback. Forces 48000 Hz for Opus, sets appropriate options.

toVideoCodec

const

av::VideoCodec toVideoCodec(int width = 0, int height = 0, double fps = 0.0) const

Defined in src/webrtc/include/icy/webrtc/codecnegotiator.h:91

Create an av::VideoCodec from this negotiation result. Width, height, fps default to 0 (caller should set these).


toWebRtcVideoCodec

const

av::VideoCodec toWebRtcVideoCodec(int width = 0, int height = 0, double fps = 0.0) const

Defined in src/webrtc/include/icy/webrtc/codecnegotiator.h:98

Create an av::VideoCodec configured for WebRTC browser playback. Sets low-latency options: ultrafast preset, zerolatency tune, constrained baseline profile for H.264, and appropriate defaults for VP8/VP9/AV1.


toAudioCodec

const

av::AudioCodec toAudioCodec(int channels = 2, int sampleRate = 0) const

Defined in src/webrtc/include/icy/webrtc/codecnegotiator.h:103

Create an av::AudioCodec from this negotiation result. Channels default to 2, sampleRate to the RTP clock rate.


toWebRtcAudioCodec

const

av::AudioCodec toWebRtcAudioCodec(int channels = 2) const

Defined in src/webrtc/include/icy/webrtc/codecnegotiator.h:108

Create an av::AudioCodec configured for WebRTC browser playback. Forces 48000 Hz for Opus, sets appropriate options.