RAVENNAKIT
Loading...
Searching...
No Matches
rav::sdp Namespace Reference

Classes

struct  ConnectionInfoField
 A type representing the connection information (c=*) of an SDP session description. More...
struct  Format
 Holds the information of an RTP map. More...
class  Group
 Represents a group of media descriptions in an SDP message. More...
class  MediaClockSource
 The media clock source for a stream determines the timebase used to advance the RTP timestamps included in RTP packets. More...
struct  OriginField
 A type which represents the origin field (o=*) of an SDP session description. More...
struct  RavennaClockDomain
 Defines a clock source and domain. More...
class  ReferenceClock
 Specifies the reference clock as specified in RFC 7273 and AES67. More...
class  SourceFilter
struct  TimeActiveField
 A type representing the time field (t=*) of an SDP session description. More...
struct  MediaDescription
 A type representing a media description (m=*) as part of an SDP session description. More...
struct  SessionDescription
 A struct that represents an SDP session description as defined in RFC 8866. More...

Enumerations

enum class  NetwType { undefined , internet }
enum class  AddrType { undefined , ipv4 , ipv6 , both }
enum class  MediaDirection { sendrecv , sendonly , recvonly , inactive }
enum class  FilterMode { undefined , exclude , include }

Functions

tl::expected< ConnectionInfoField, std::string > parse_connection_info (std::string_view line)
 Parses a connection info field from a string.
std::string to_string (const ConnectionInfoField &field)
 Converts the connection info to a string.
tl::expected< void, std::string > validate (const ConnectionInfoField &field)
 Validates the connection info.
tl::expected< Format, std::string > parse_format (std::string_view line)
 Parses a format from a string.
std::optional< Format > make_audio_format (const AudioFormat &input_format)
std::optional< AudioFormat > make_audio_format (const Format &input_format)
std::string to_string (const Format &input_format)
 Converts a Format to an SDP compatible string.
tl::expected< Group, std::string > parse_group (std::string_view line)
 Parses a group line from an SDP message.
std::string to_string (const Group &input)
std::string to_string (const MediaClockSource &mode)
 Converts the media clock source to a string.
const char * to_string (MediaClockSource::ClockMode mode)
 Converts the clock mode to a string.
tl::expected< void, std::string > validate (const MediaClockSource &clock_source)
 Validates the media clock source.
tl::expected< MediaClockSource, std::string > parse_media_clock_source (std::string_view line)
 Create a MediaClockSource from a string from an SDP.
tl::expected< OriginField, std::string > parse_origin (std::string_view line)
 Parses an origin field from a string.
std::string to_string (const OriginField &field)
 Converts the origin field to a string.
tl::expected< void, std::string > validate (const OriginField &field)
 Validates the members of this struct.
tl::expected< RavennaClockDomain, std::string > parse_ravenna_clock_domain (std::string_view line)
 Parses a new instance of this structure from a string.
const char * to_string (RavennaClockDomain::SyncSource source)
std::string to_string (const RavennaClockDomain &ravenna_clock_domain)
tl::expected< void, std::string > validate (const RavennaClockDomain &ravenna_clock_domain)
 Validates the values of this structure.
const char * to_string (ReferenceClock::ClockSource source)
const char * to_string (ReferenceClock::PtpVersion version)
std::string to_string (const ReferenceClock &reference_clock)
 Converts the reference clock to a string.
tl::expected< ReferenceClock, std::string > parse_reference_clock (std::string_view line)
 Parses a reference clock from a string.
tl::expected< void, std::string > validate (const ReferenceClock &reference_clock)
 Validates the state of this object.
std::string to_string (const SourceFilter &filter)
 Converts the source filter to a string.
tl::expected< SourceFilter, std::string > parse_source_filter (std::string_view line)
 Parses a connection info field from a string.
tl::expected< void, std::string > validate (const SourceFilter &filter)
 Validates the source filter.
tl::expected< TimeActiveField, std::string > parse_time_active (std::string_view line)
 Parses a time field from a string.
std::string to_string (const TimeActiveField &time_active_field)
 Converts the time field to an SDP compatible string.
tl::expected< void, std::string > validate (const TimeActiveField &time_active_field)
 Validates the values of this structure.
const char * to_string (const NetwType &type)
const char * to_string (const AddrType &type)
const char * to_string (const MediaDirection &direction)
const char * to_string (const FilterMode &filter_mode)
tl::expected< void, std::string > validate (const MediaDescription &media)
 Validates the media description.
std::string to_string (const MediaDescription &media_description, const char *newline=k_sdp_crlf)
 Converts the media description to a string.
tl::expected< MediaDescription, std::string > parse_media_description (std::string_view line)
 Parses a media description from a string (i.e.
tl::expected< int, std::string > parse_version (std::string_view line)
tl::expected< SessionDescription, std::string > parse_session_description (const std::string &sdp_text)
 Parses an SDP session description from a string.
std::optional< std::string > to_string (const SessionDescription &session_description, const char *newline=k_sdp_crlf)
 Converts the session description to a string.

Variables

constexpr auto k_sdp_ptime = "ptime"
constexpr auto k_sdp_max_ptime = "maxptime"
constexpr auto k_sdp_rtp_map = "rtpmap"
constexpr auto k_sdp_sendrecv = "sendrecv"
constexpr auto k_sdp_sendonly = "sendonly"
constexpr auto k_sdp_recvonly = "recvonly"
constexpr auto k_sdp_inactive = "recvonly"
constexpr auto k_sdp_ts_refclk = "ts-refclk"
constexpr auto k_sdp_sync_time = "sync-time"
constexpr auto k_sdp_group = "group"
constexpr auto k_sdp_clock_deviation = "clock-deviation"
constexpr auto k_sdp_mid = "mid"
constexpr auto k_sdp_inet = "IN"
constexpr auto k_sdp_ipv4 = "IP4"
constexpr auto k_sdp_ipv6 = "IP6"
constexpr auto k_sdp_wildcard = "*"
constexpr auto k_sdp_crlf = "\r\n"

Enumeration Type Documentation

◆ AddrType

enum class rav::sdp::AddrType
strong
Enumerator
undefined 
ipv4 
ipv6 
both 

Definition at line 30 of file sdp_types.hpp.

◆ FilterMode

enum class rav::sdp::FilterMode
strong
Enumerator
undefined 
exclude 
include 

Definition at line 32 of file sdp_types.hpp.

◆ MediaDirection

enum class rav::sdp::MediaDirection
strong
Enumerator
sendrecv 
sendonly 
recvonly 
inactive 

Definition at line 31 of file sdp_types.hpp.

◆ NetwType

enum class rav::sdp::NetwType
strong
Enumerator
undefined 
internet 

Definition at line 29 of file sdp_types.hpp.

Function Documentation

◆ make_audio_format() [1/2]

std::optional< Format > rav::sdp::make_audio_format ( const AudioFormat & input_format)
nodiscard
Returns
The format as audio_format, or nullopt if the format is not supported or cannot be converted.

◆ make_audio_format() [2/2]

std::optional< AudioFormat > rav::sdp::make_audio_format ( const Format & input_format)
nodiscard
Returns
The format as audio_format, or nullopt if the format is not supported or cannot be converted.

◆ parse_connection_info()

tl::expected< ConnectionInfoField, std::string > rav::sdp::parse_connection_info ( std::string_view line)

Parses a connection info field from a string.

Parameters
lineThe string to parse.
Returns
A result object containing either the newly parsed value, or an error string.

◆ parse_format()

tl::expected< Format, std::string > rav::sdp::parse_format ( std::string_view line)
nodiscard

Parses a format from a string.

Parameters
lineThe string to parse.
Returns
A result indicating success or failure. When parsing fails, the error message will contain a description of what went wrong.

◆ parse_group()

tl::expected< Group, std::string > rav::sdp::parse_group ( std::string_view line)
nodiscard

Parses a group line from an SDP message.

Parameters
lineThe line to parse.
Returns
A tl::expected object containing the parsed group or an error message.

◆ parse_media_clock_source()

tl::expected< MediaClockSource, std::string > rav::sdp::parse_media_clock_source ( std::string_view line)
nodiscard

Create a MediaClockSource from a string from an SDP.

Parameters
lineThe input text.
Returns
The MediaClockSource, or an error.

◆ parse_media_description()

tl::expected< MediaDescription, std::string > rav::sdp::parse_media_description ( std::string_view line)

Parses a media description from a string (i.e.

the line starting with m=*). Does not parse the connection into or attributes.

Parameters
lineThe string to parse.
Returns
A result indicating success or failure. When parsing fails, the error message will contain a description of the error.

◆ parse_origin()

tl::expected< OriginField, std::string > rav::sdp::parse_origin ( std::string_view line)
nodiscard

Parses an origin field from a string.

Parameters
lineThe string to parse.
Returns
A result indicating success or failure. When parsing fails, the error message will contain a description of the error.

◆ parse_ravenna_clock_domain()

tl::expected< RavennaClockDomain, std::string > rav::sdp::parse_ravenna_clock_domain ( std::string_view line)
nodiscard

Parses a new instance of this structure from a string.

Parameters
lineThe string to parse.
Returns
A parse result.

◆ parse_reference_clock()

tl::expected< ReferenceClock, std::string > rav::sdp::parse_reference_clock ( std::string_view line)
nodiscard

Parses a reference clock from a string.

Parameters
lineThe string to parse.
Returns
A parse result.

◆ parse_session_description()

tl::expected< SessionDescription, std::string > rav::sdp::parse_session_description ( const std::string & sdp_text)
nodiscard

Parses an SDP session description from a string.

Parameters
sdp_textThe SDP text to parse.
Returns
A result indicating whether the parsing was successful or not. The error will be a message explaining what went wrong.

◆ parse_source_filter()

tl::expected< SourceFilter, std::string > rav::sdp::parse_source_filter ( std::string_view line)

Parses a connection info field from a string.

Parameters
lineThe string to parse.
Returns
A pair containing the parse result and the connection info. When parsing fails, the connection info will be a default-constructed object.

◆ parse_time_active()

tl::expected< TimeActiveField, std::string > rav::sdp::parse_time_active ( std::string_view line)
nodiscard

Parses a time field from a string.

Parameters
lineThe string to parse.
Returns
A pair containing the parse result and the time field.

◆ parse_version()

tl::expected< int, std::string > rav::sdp::parse_version ( std::string_view line)
nodiscard

◆ to_string() [1/19]

const char * rav::sdp::to_string ( const AddrType & type)

◆ to_string() [2/19]

std::string rav::sdp::to_string ( const ConnectionInfoField & field)

Converts the connection info to a string.

Returns
The connection info as a string.

◆ to_string() [3/19]

const char * rav::sdp::to_string ( const FilterMode & filter_mode)

◆ to_string() [4/19]

std::string rav::sdp::to_string ( const Format & input_format)
nodiscard

Converts a Format to an SDP compatible string.

Parameters
input_formatThe input format.
Returns
The encoded string.

◆ to_string() [5/19]

std::string rav::sdp::to_string ( const Group & input)
nodiscard
Returns
The group encoded as string.

◆ to_string() [6/19]

std::string rav::sdp::to_string ( const MediaClockSource & mode)
nodiscard

Converts the media clock source to a string.

Returns
The media clock source as a string.

◆ to_string() [7/19]

std::string rav::sdp::to_string ( const MediaDescription & media_description,
const char * newline = k_sdp_crlf )
nodiscard

Converts the media description to a string.

Returns
The media description as a string.

◆ to_string() [8/19]

const char * rav::sdp::to_string ( const MediaDirection & direction)

◆ to_string() [9/19]

const char * rav::sdp::to_string ( const NetwType & type)

◆ to_string() [10/19]

std::string rav::sdp::to_string ( const OriginField & field)
nodiscard

Converts the origin field to a string.

◆ to_string() [11/19]

std::string rav::sdp::to_string ( const RavennaClockDomain & ravenna_clock_domain)
nodiscard
Parameters
ravenna_clock_domainThe ravenna clock domain.
Returns
The string representation of this structure.

◆ to_string() [12/19]

std::string rav::sdp::to_string ( const ReferenceClock & reference_clock)
nodiscard

Converts the reference clock to a string.

Returns
The reference clock as a string.

◆ to_string() [13/19]

std::optional< std::string > rav::sdp::to_string ( const SessionDescription & session_description,
const char * newline = k_sdp_crlf )
nodiscard

Converts the session description to a string.

Returns
The session description as a string.

◆ to_string() [14/19]

std::string rav::sdp::to_string ( const SourceFilter & filter)
nodiscard

Converts the source filter to a string.

Returns
The source filter as a string.

◆ to_string() [15/19]

std::string rav::sdp::to_string ( const TimeActiveField & time_active_field)
nodiscard

Converts the time field to an SDP compatible string.

Returns
The time field as a string.

◆ to_string() [16/19]

const char * rav::sdp::to_string ( MediaClockSource::ClockMode mode)
nodiscard

Converts the clock mode to a string.

Parameters
modeThe clock mode to convert.
Returns
The clock mode as a string.

◆ to_string() [17/19]

const char * rav::sdp::to_string ( RavennaClockDomain::SyncSource source)
nodiscard
Parameters
sourceThe sync source to convert.
Returns
A string representation of the sync source.

◆ to_string() [18/19]

const char * rav::sdp::to_string ( ReferenceClock::ClockSource source)
nodiscard
Parameters
sourceThe clock source to convert.
Returns
A string representation of the clock source.

◆ to_string() [19/19]

const char * rav::sdp::to_string ( ReferenceClock::PtpVersion version)
nodiscard
Parameters
versionThe PTP version to convert.
Returns
A string representation of the PTP version.

◆ validate() [1/8]

tl::expected< void, std::string > rav::sdp::validate ( const ConnectionInfoField & field)
nodiscard

Validates the connection info.

Returns
An error message if the connection info is invalid.

◆ validate() [2/8]

tl::expected< void, std::string > rav::sdp::validate ( const MediaClockSource & clock_source)
nodiscard

Validates the media clock source.

Exceptions
rav::Exceptionif the media clock source is invalid.

◆ validate() [3/8]

tl::expected< void, std::string > rav::sdp::validate ( const MediaDescription & media)
nodiscard

Validates the media description.

Returns
An error message if the media description is invalid.

◆ validate() [4/8]

tl::expected< void, std::string > rav::sdp::validate ( const OriginField & field)
nodiscard

Validates the members of this struct.

Returns
A result indicating success or failure. When validation fails, the error message will contain a description of the error.

◆ validate() [5/8]

tl::expected< void, std::string > rav::sdp::validate ( const RavennaClockDomain & ravenna_clock_domain)
nodiscard

Validates the values of this structure.

Returns
An error message if the values are invalid.

◆ validate() [6/8]

tl::expected< void, std::string > rav::sdp::validate ( const ReferenceClock & reference_clock)
nodiscard

Validates the state of this object.

Returns
An error message if the state is invalid.

◆ validate() [7/8]

tl::expected< void, std::string > rav::sdp::validate ( const SourceFilter & filter)
nodiscard

Validates the source filter.

Returns
An error message if the source filter is invalid.

◆ validate() [8/8]

tl::expected< void, std::string > rav::sdp::validate ( const TimeActiveField & time_active_field)
nodiscard

Validates the values of this structure.

Returns
A result indicating success or failure. When validation fails, the error message will contain a description.

Variable Documentation

◆ k_sdp_clock_deviation

auto rav::sdp::k_sdp_clock_deviation = "clock-deviation"
constexpr

Definition at line 39 of file sdp_constants.hpp.

◆ k_sdp_crlf

auto rav::sdp::k_sdp_crlf = "\r\n"
constexpr

Definition at line 45 of file sdp_constants.hpp.

◆ k_sdp_group

auto rav::sdp::k_sdp_group = "group"
constexpr

Definition at line 38 of file sdp_constants.hpp.

◆ k_sdp_inactive

auto rav::sdp::k_sdp_inactive = "recvonly"
constexpr

Definition at line 35 of file sdp_constants.hpp.

◆ k_sdp_inet

auto rav::sdp::k_sdp_inet = "IN"
constexpr

Definition at line 41 of file sdp_constants.hpp.

◆ k_sdp_ipv4

auto rav::sdp::k_sdp_ipv4 = "IP4"
constexpr

Definition at line 42 of file sdp_constants.hpp.

◆ k_sdp_ipv6

auto rav::sdp::k_sdp_ipv6 = "IP6"
constexpr

Definition at line 43 of file sdp_constants.hpp.

◆ k_sdp_max_ptime

auto rav::sdp::k_sdp_max_ptime = "maxptime"
constexpr

Definition at line 30 of file sdp_constants.hpp.

◆ k_sdp_mid

auto rav::sdp::k_sdp_mid = "mid"
constexpr

Definition at line 40 of file sdp_constants.hpp.

◆ k_sdp_ptime

auto rav::sdp::k_sdp_ptime = "ptime"
constexpr

Definition at line 29 of file sdp_constants.hpp.

◆ k_sdp_recvonly

auto rav::sdp::k_sdp_recvonly = "recvonly"
constexpr

Definition at line 34 of file sdp_constants.hpp.

◆ k_sdp_rtp_map

auto rav::sdp::k_sdp_rtp_map = "rtpmap"
constexpr

Definition at line 31 of file sdp_constants.hpp.

◆ k_sdp_sendonly

auto rav::sdp::k_sdp_sendonly = "sendonly"
constexpr

Definition at line 33 of file sdp_constants.hpp.

◆ k_sdp_sendrecv

auto rav::sdp::k_sdp_sendrecv = "sendrecv"
constexpr

Definition at line 32 of file sdp_constants.hpp.

◆ k_sdp_sync_time

auto rav::sdp::k_sdp_sync_time = "sync-time"
constexpr

Definition at line 37 of file sdp_constants.hpp.

◆ k_sdp_ts_refclk

auto rav::sdp::k_sdp_ts_refclk = "ts-refclk"
constexpr

Definition at line 36 of file sdp_constants.hpp.

◆ k_sdp_wildcard

auto rav::sdp::k_sdp_wildcard = "*"
constexpr

Definition at line 44 of file sdp_constants.hpp.