gstreamermm 1.10.0

Public Member Functions | Protected Attributes | List of all members
Gst::SDP::Media Class Reference

The contents of the SDP "m=" field with all related fields. More...

`#include <gstreamermm/sdpmessage.h>`

## Public Member Functions
| Media ()
| Media (const Media& other)
| Media (Media&& other)
virtual | ~Media ()
GstSDPMedia* | gobj ()
const GstSDPMedia* | gobj () const
Glib::ustring | as_text () const
| Convert the contents of media to a text string. More...
Glib::ustring | get_media () const
| Get the media description of media. More...
Result | set_media (const Glib::ustring& med)
| Set the media description of media to med. More...
guint | get_port () const
| Get the port number for media. More...
guint | get_num_ports () const
| Get the number of ports for media. More...
Result | set_port_info (guint port, guint num_ports)
| Set the port information in media. More...
Glib::ustring | get_proto () const
| Get the transport protocol of media. More...
Result | set_proto (const Glib::ustring& proto)
| Set the media transport protocol of media to proto. More...
guint | formats_len () const
| Get the number of formats in media. More...
Glib::ustring | get_format (guint idx) const
| Get the format information at position idx in media. More...
Result | insert_format (gint idx, const Glib::ustring& format)
| Insert the format information to media at idx. More...
Result | replace_format (guint idx, const Glib::ustring& format)
| Replace the format information in media at idx with format. More...
Result | remove_format (guint idx)
| Remove the format information in media at idx. More...
Result | add_format (const Glib::ustring& format)
| Add the format information to media. More...
Glib::ustring | get_information () const
| Get the information of media. More...
Result | set_information (const Glib::ustring& information)
| Set the media information of media to information. More...
guint | connections_len () const
| Get the number of connection fields in media. More...
Result | remove_connection (guint idx)
| Remove the connection information in media at idx. More...
Result | add_connection (const Glib::ustring& nettype, const Glib::ustring& addrtype, const Glib::ustring& address, guint ttl, guint addr_number)
| Add the given connection parameters to media. More...
guint | bandwidths_len () const
| Get the number of bandwidth fields in media. More...
Result | remove_bandwidth (guint idx)
| Remove the bandwidth information in media at idx. More...
Result | add_bandwidth (const Glib::ustring& bwtype, guint bandwith)
| Add the bandwidth information with bwtype and bandwith to media. More...
Gst::SDP::Key | get_key () const
| Get the encryption information from media. More...
Result | set_key (const Glib::ustring& key, const Glib::ustring& data)
| Adds the encryption information to media. More...
guint | attributes_len () const
| Get the number of attribute fields in media. More...
Glib::ustring | get_attribute_val (const Glib::ustring& key) const
| Get the first attribute value for key in media. More...
Glib::ustring | get_attribute_val (const Glib::ustring& key, guint nth) const
| Get the nth attribute value for key in media. More...
Result | remove_attribute (guint idx)
| Remove the attribute in media at idx. More...
Result | add_attribute (const Glib::ustring& key, const Glib::ustring& value)
| Add the attribute with key and value to media. More...
Glib::RefPtr< Gst::Caps > | get_caps_from_media (int pt) const
| Mapping of caps from SDP fields: More...
Result | attributes_to_caps (const Glib::RefPtr< Gst::Caps >& caps) const
| Mapping of attributes of Gst::SDPMedia to Gst::Caps. More...

## Protected Attributes
GstSDPMedia* | gobject_ = nullptr

## Detailed Description

The contents of the SDP "m=" field with all related fields.

## Constructor & Destructor Documentation

## ◆ Media() [1/3]

Gst::SDP::Media::Media | ( |  | ) |

## ◆ Media() [2/3]

Gst::SDP::Media::Media | ( | const Media& | other | ) |

## ◆ Media() [3/3]

Gst::SDP::Media::Media | ( | Media&& | other | ) |

## ◆ ~Media()

virtual Gst::SDP::Media::~Media | ( |  | ) |
| virtual

## Member Function Documentation

## ◆ add_attribute()

Result Gst::SDP::Media::add_attribute | ( | const Glib::ustring & | key,
|  | const Glib::ustring & | value
| ) |  |

Add the attribute with key and value to media.

Parameters

  key | A key.
  value | A value.

Returns
  Gst::SDP_OK.

## ◆ add_bandwidth()

Result Gst::SDP::Media::add_bandwidth | ( | const Glib::ustring & | bwtype,
|  | guint | bandwith
| ) |  |

Add the bandwidth information with bwtype and bandwith to media.

Parameters

  bwtype | The bandwidth modifier type.
  bandwith | The bandwidth in kilobits per second.

Returns
  Gst::SDP_OK.

## ◆ add_connection()

Result Gst::SDP::Media::add_connection | ( | const Glib::ustring & | nettype,
|  | const Glib::ustring & | addrtype,
|  | const Glib::ustring & | address,
|  | guint | ttl,
|  | guint | addr_number
| ) |  |

Add the given connection parameters to media.

Parameters

  nettype | The type of network. "IN" is defined to have the meaning "Internet".
  addrtype | The type of address.
  address | The address.
  ttl | The time to live of the address.
  addr_number | The number of layers.

Returns
  A Gst::SDPResult.

## ◆ add_format()

Result Gst::SDP::Media::add_format | ( | const Glib::ustring & | format | ) |

Add the format information to media.

Parameters

  format | The format.

Returns
  Gst::SDP_OK.

## ◆ as_text()

Glib::ustring Gst::SDP::Media::as_text | ( |  | ) | const

Convert the contents of media to a text string.

Returns
  A dynamically allocated string representing the media.

## ◆ attributes_len()

guint Gst::SDP::Media::attributes_len | ( |  | ) | const

Get the number of attribute fields in media.

Returns
  The number of attributes in media.

## ◆ attributes_to_caps()

Result Gst::SDP::Media::attributes_to_caps | ( | const Glib::RefPtr< Gst::Caps >& | caps | ) | const

Mapping of attributes of Gst::SDPMedia to Gst::Caps.

Parameters

  caps | A Gst::Caps.

Returns
  A Gst::SDPResult.

## ◆ bandwidths_len()

guint Gst::SDP::Media::bandwidths_len | ( |  | ) | const

Get the number of bandwidth fields in media.

Returns
  The number of bandwidths in media.

## ◆ connections_len()

guint Gst::SDP::Media::connections_len | ( |  | ) | const

Get the number of connection fields in media.

Returns
  The number of connections in media.

## ◆ formats_len()

guint Gst::SDP::Media::formats_len | ( |  | ) | const

Get the number of formats in media.

Returns
  The number of formats in media.

## ◆ get_attribute_val() [1/2]

Glib::ustring Gst::SDP::Media::get_attribute_val | ( | const Glib::ustring & | key | ) | const

Get the first attribute value for key in media.

Parameters

  key | A key.

Returns
  The first attribute value for key.

## ◆ get_attribute_val() [2/2]

Glib::ustring Gst::SDP::Media::get_attribute_val | ( | const Glib::ustring & | key,
|  | guint | nth
| ) |  | const

Get the nth attribute value for key in media.

Parameters

  key | A key.
  nth | An index.

Returns
  The nth attribute value.

## ◆ get_caps_from_media()

Glib::RefPtr<Gst::Caps> Gst::SDP::Media::get_caps_from_media | ( | int | pt | ) | const

Mapping of caps from SDP fields:

a=rtpmap:(payload) (encoding_name)/(clock_rate)[/(encoding_params)]

a=framesize:(payload) (width)-(height)

a=fmtp:(payload) (param)[=(value)];...

Parameters

  pt | A payload type.

Returns
  A Gst::Caps, or `nullptr` if an error happened.

## ◆ get_format()

Glib::ustring Gst::SDP::Media::get_format | ( | guint | idx | ) | const

Get the format information at position idx in media.

Parameters

  idx | An index.

Returns
  The format at position idx.

## ◆ get_information()

Glib::ustring Gst::SDP::Media::get_information | ( |  | ) | const

Get the information of media.

Returns
  The information of media.

## ◆ get_key()

Gst::SDP::Key Gst::SDP::Media::get_key | ( |  | ) | const

Get the encryption information from media.

Returns
  A Gst::SDPKey.

## ◆ get_media()

Glib::ustring Gst::SDP::Media::get_media | ( |  | ) | const

Get the media description of media.

Returns
  The media description.

## ◆ get_num_ports()

guint Gst::SDP::Media::get_num_ports | ( |  | ) | const

Get the number of ports for media.

Returns
  The number of ports for media.

## ◆ get_port()

guint Gst::SDP::Media::get_port | ( |  | ) | const

Get the port number for media.

Returns
  The port number of media.

## ◆ get_proto()

Glib::ustring Gst::SDP::Media::get_proto | ( |  | ) | const

Get the transport protocol of media.

Returns
  The transport protocol of media.

## ◆ gobj() [1/2]

GstSDPMedia* Gst::SDP::Media::gobj | ( |  | ) |
| inline

## ◆ gobj() [2/2]

const GstSDPMedia* Gst::SDP::Media::gobj | ( |  | ) | const
| inline

## ◆ insert_format()

Result Gst::SDP::Media::insert_format | ( | gint | idx,
|  | const Glib::ustring & | format
| ) |  |

Insert the format information to media at idx.

When idx is -1, the format is appended.

Parameters

  idx | An index.
  format | The format.

Returns
  Gst::SDP_OK.

## ◆ remove_attribute()

Result Gst::SDP::Media::remove_attribute | ( | guint | idx | ) |

Remove the attribute in media at idx.

Parameters

  idx | An index.

Returns
  Gst::SDP_OK.

## ◆ remove_bandwidth()

Result Gst::SDP::Media::remove_bandwidth | ( | guint | idx | ) |

Remove the bandwidth information in media at idx.

Parameters

  idx | An index.

Returns
  Gst::SDP_OK.

## ◆ remove_connection()

Result Gst::SDP::Media::remove_connection | ( | guint | idx | ) |

Remove the connection information in media at idx.

Parameters

  idx | An index.

Returns
  Gst::SDP_OK.

## ◆ remove_format()

Result Gst::SDP::Media::remove_format | ( | guint | idx | ) |

Remove the format information in media at idx.

Parameters

  idx | An index.

Returns
  Gst::SDP_OK.

## ◆ replace_format()

Result Gst::SDP::Media::replace_format | ( | guint | idx,
|  | const Glib::ustring & | format
| ) |  |

Replace the format information in media at idx with format.

Parameters

  idx | An index.
  format | The format.

Returns
  Gst::SDP_OK.

## ◆ set_information()

Result Gst::SDP::Media::set_information | ( | const Glib::ustring & | information | ) |

Set the media information of media to information.

Parameters

  information | The media information.

Returns
  Gst::SDP_OK.

## ◆ set_key()

Result Gst::SDP::Media::set_key | ( | const Glib::ustring & | key,
|  | const Glib::ustring & | data
| ) |  |

Adds the encryption information to media.

Parameters

  key | The encryption type.
  data | The encryption data.

Returns
  A Gst::SDPResult.

## ◆ set_media()

Result Gst::SDP::Media::set_media | ( | const Glib::ustring & | med | ) |

Set the media description of media to med.

Parameters

  med | The media description.

Returns
  Gst::SDP_OK.

## ◆ set_port_info()

Result Gst::SDP::Media::set_port_info | ( | guint | port,
|  | guint | num_ports
| ) |  |

Set the port information in media.

Parameters

  port | The port number.
  num_ports | The number of ports.

Returns
  Gst::SDP_OK.

## ◆ set_proto()

Result Gst::SDP::Media::set_proto | ( | const Glib::ustring & | proto | ) |

Set the media transport protocol of media to proto.

Parameters

  proto | The media transport protocol.

Returns
  Gst::SDP_OK.

## Member Data Documentation

## ◆ gobject_

GstSDPMedia* Gst::SDP::Media::gobject_ = nullptr
| protected