VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Gv::Sdp Class Reference

A parser for a Session Description Protocol block, with a MIME type of "application/sdp". More...

#include <gvsdp.h>

Public Types

typedef std::multimap
< std::string, std::string > 
Map
 

Public Member Functions

 Sdp (const std::vector< std::string > &sdp_lines)
 Constructor taking a list of text lines.
 
std::string originator () const
 Returns the session originator ("o=").
 
std::string name () const
 Returns the session name ("s=").
 
Map attributes () const
 Returns the session attributes as a multimap ("a=key:value").
 
std::string attributes (const std::string &sep) const
 Returns the session attributes as a sep-separated string.
 
size_t timeCount () const
 Returns the number of timeValue()s.
 
time_t timeValue (size_t index=0U)
 Returns the index-th time value.
 
size_t mediaCount () const
 Returns the number of mediaType()s.
 
std::string mediaType (size_t index=0U) const
 Returns the type of the index-th media ("m=").
 
std::string mediaTitle (size_t index=0U) const
 Returns the title of the index-th media ("i=").
 
std::string mediaConnection (size_t index=0U) const
 Returns the connection of the index-th media ("c=").
 
Map mediaAttributes (size_t index=0U) const
 Returns the attributes of the index-th media as a multimap ("a=").
 
std::string mediaAttributes (size_t index, const std::string &sep) const
 Returns the attributes of the index-th media as a string.
 
std::string mediaAttribute (size_t index, const std::string &key) const
 Returns the specified attribute of the index-th media ("a=key"). More...
 
std::string mediaAttribute (size_t index, const std::string &key, const std::string &default_) const
 Returns the specified attribute of the index-th media ("a=key"). More...
 
std::string fmtp () const
 A convenience method that returns the value of the "fmtp" attribute of the first video "RTP/AVP" medium. More...
 

Detailed Description

A parser for a Session Description Protocol block, with a MIME type of "application/sdp".

This is used by RTSP, but is also relevant to other session setup protocols such as SIP.

The SDP block contains information in one "session" section, one or more "timing" sections, and zero or more "media" sections. Each section is a list of key-value pairs, with non-unique keys, and where the key is a single letter. The "a" values are "attributes", having an attribute name and an optional attribute value with a colon separator.

See Also
RFC 4566

Definition at line 48 of file gvsdp.h.

Member Function Documentation

std::string Gv::Sdp::fmtp ( ) const

A convenience method that returns the value of the "fmtp" attribute of the first video "RTP/AVP" medium.

Returns the empty string on error.

Definition at line 192 of file gvsdp.cpp.

std::string Gv::Sdp::mediaAttribute ( size_t  index,
const std::string &  key 
) const

Returns the specified attribute of the index-th media ("a=key").

Throws if no such key.

Definition at line 120 of file gvsdp.cpp.

std::string Gv::Sdp::mediaAttribute ( size_t  index,
const std::string &  key,
const std::string &  default_ 
) const

Returns the specified attribute of the index-th media ("a=key").

Returns the default if no such key.

Definition at line 125 of file gvsdp.cpp.


The documentation for this class was generated from the following files: