GstSDPMessage

## GstSDPMessage GstSDPMessage — Helper methods for dealing with SDP messages |

## Functions

GstSDPResult | gst_sdp_connection_set ()
GstSDPResult | gst_sdp_connection_clear ()
GstSDPResult | gst_sdp_bandwidth_set ()
GstSDPResult | gst_sdp_bandwidth_clear ()
GstSDPResult | gst_sdp_media_parse_keymgmt ()
GstSDPResult | gst_sdp_message_parse_keymgmt ()
GstSDPResult | gst_sdp_time_set ()
GstSDPResult | gst_sdp_time_clear ()
GstSDPResult | gst_sdp_zone_set ()
GstSDPResult | gst_sdp_zone_clear ()
GstSDPResult | gst_sdp_attribute_set ()
GstSDPResult | gst_sdp_attribute_clear ()
GstSDPResult | gst_sdp_message_new ()
GstSDPResult | gst_sdp_message_copy ()
GstSDPResult | gst_sdp_message_init ()
GstSDPResult | gst_sdp_message_uninit ()
GstSDPResult | gst_sdp_message_free ()
GstSDPResult | gst_sdp_message_parse_buffer ()
gchar * | gst_sdp_message_as_text ()
GstSDPResult | gst_sdp_message_parse_uri ()
gchar * | gst_sdp_message_as_uri ()
gboolean | gst_sdp_address_is_multicast ()
const gchar * | gst_sdp_message_get_version ()
GstSDPResult | gst_sdp_message_set_version ()
const GstSDPOrigin * | gst_sdp_message_get_origin ()
GstSDPResult | gst_sdp_message_set_origin ()
const gchar * | gst_sdp_message_get_session_name ()
GstSDPResult | gst_sdp_message_set_session_name ()
const gchar * | gst_sdp_message_get_information ()
GstSDPResult | gst_sdp_message_set_information ()
const gchar * | gst_sdp_message_get_uri ()
GstSDPResult | gst_sdp_message_set_uri ()
guint | gst_sdp_message_emails_len ()
const gchar * | gst_sdp_message_get_email ()
GstSDPResult | gst_sdp_message_insert_email ()
GstSDPResult | gst_sdp_message_replace_email ()
GstSDPResult | gst_sdp_message_remove_email ()
GstSDPResult | gst_sdp_message_add_email ()
guint | gst_sdp_message_phones_len ()
const gchar * | gst_sdp_message_get_phone ()
GstSDPResult | gst_sdp_message_insert_phone ()
GstSDPResult | gst_sdp_message_replace_phone ()
GstSDPResult | gst_sdp_message_remove_phone ()
GstSDPResult | gst_sdp_message_add_phone ()
const GstSDPConnection * | gst_sdp_message_get_connection ()
GstSDPResult | gst_sdp_message_set_connection ()
guint | gst_sdp_message_bandwidths_len ()
const GstSDPBandwidth * | gst_sdp_message_get_bandwidth ()
GstSDPResult | gst_sdp_message_insert_bandwidth ()
GstSDPResult | gst_sdp_message_replace_bandwidth ()
GstSDPResult | gst_sdp_message_remove_bandwidth ()
GstSDPResult | gst_sdp_message_add_bandwidth ()
guint | gst_sdp_message_times_len ()
const GstSDPTime * | gst_sdp_message_get_time ()
GstSDPResult | gst_sdp_message_insert_time ()
GstSDPResult | gst_sdp_message_replace_time ()
GstSDPResult | gst_sdp_message_remove_time ()
GstSDPResult | gst_sdp_message_add_time ()
guint | gst_sdp_message_zones_len ()
const GstSDPZone * | gst_sdp_message_get_zone ()
GstSDPResult | gst_sdp_message_insert_zone ()
GstSDPResult | gst_sdp_message_replace_zone ()
GstSDPResult | gst_sdp_message_remove_zone ()
GstSDPResult | gst_sdp_message_add_zone ()
const GstSDPKey * | gst_sdp_message_get_key ()
GstSDPResult | gst_sdp_message_set_key ()
guint | gst_sdp_message_attributes_len ()
const GstSDPAttribute * | gst_sdp_message_get_attribute ()
const gchar * | gst_sdp_message_get_attribute_val ()
const gchar * | gst_sdp_message_get_attribute_val_n ()
GstSDPResult | gst_sdp_message_insert_attribute ()
GstSDPResult | gst_sdp_message_replace_attribute ()
GstSDPResult | gst_sdp_message_remove_attribute ()
GstSDPResult | gst_sdp_message_add_attribute ()
guint | gst_sdp_message_medias_len ()
const GstSDPMedia * | gst_sdp_message_get_media ()
GstSDPResult | gst_sdp_message_add_media ()
GstSDPResult | gst_sdp_message_dump ()
GstSDPResult | gst_sdp_media_new ()
GstSDPResult | gst_sdp_media_copy ()
GstSDPResult | gst_sdp_media_init ()
GstSDPResult | gst_sdp_media_uninit ()
GstSDPResult | gst_sdp_media_free ()
gchar * | gst_sdp_media_as_text ()
const gchar * | gst_sdp_media_get_media ()
GstSDPResult | gst_sdp_media_set_media ()
guint | gst_sdp_media_get_port ()
guint | gst_sdp_media_get_num_ports ()
GstSDPResult | gst_sdp_media_set_port_info ()
const gchar * | gst_sdp_media_get_proto ()
GstSDPResult | gst_sdp_media_set_proto ()
guint | gst_sdp_media_formats_len ()
const gchar * | gst_sdp_media_get_format ()
GstSDPResult | gst_sdp_media_insert_format ()
GstSDPResult | gst_sdp_media_replace_format ()
GstSDPResult | gst_sdp_media_remove_format ()
GstSDPResult | gst_sdp_media_add_format ()
const gchar * | gst_sdp_media_get_information ()
GstSDPResult | gst_sdp_media_set_information ()
guint | gst_sdp_media_connections_len ()
const GstSDPConnection * | gst_sdp_media_get_connection ()
GstSDPResult | gst_sdp_media_insert_connection ()
GstSDPResult | gst_sdp_media_replace_connection ()
GstSDPResult | gst_sdp_media_remove_connection ()
GstSDPResult | gst_sdp_media_add_connection ()
guint | gst_sdp_media_bandwidths_len ()
const GstSDPBandwidth * | gst_sdp_media_get_bandwidth ()
GstSDPResult | gst_sdp_media_insert_bandwidth ()
GstSDPResult | gst_sdp_media_replace_bandwidth ()
GstSDPResult | gst_sdp_media_remove_bandwidth ()
GstSDPResult | gst_sdp_media_add_bandwidth ()
const GstSDPKey * | gst_sdp_media_get_key ()
GstSDPResult | gst_sdp_media_set_key ()
guint | gst_sdp_media_attributes_len ()
const GstSDPAttribute * | gst_sdp_media_get_attribute ()
const gchar * | gst_sdp_media_get_attribute_val ()
const gchar * | gst_sdp_media_get_attribute_val_n ()
GstSDPResult | gst_sdp_media_insert_attribute ()
GstSDPResult | gst_sdp_media_replace_attribute ()
GstSDPResult | gst_sdp_media_remove_attribute ()
GstSDPResult | gst_sdp_media_add_attribute ()
GstCaps * | gst_sdp_media_get_caps_from_media ()
GstSDPResult | gst_sdp_media_set_media_from_caps ()
gchar * | gst_sdp_make_keymgmt ()
GstSDPResult | gst_sdp_message_attributes_to_caps ()
GstSDPResult | gst_sdp_media_attributes_to_caps ()

## Types and Values

enum | GstSDPResult
| GstSDPOrigin
| GstSDPConnection
#define | GST_SDP_BWTYPE_CT
#define | GST_SDP_BWTYPE_AS
#define | GST_SDP_BWTYPE_EXT_PREFIX
#define | GST_SDP_BWTYPE_RR
#define | GST_SDP_BWTYPE_RS
#define | GST_SDP_BWTYPE_TIAS
| GstSDPBandwidth
| GstSDPTime
| GstSDPZone
| GstSDPKey
| GstSDPAttribute
| GstSDPMedia
| GstSDPMessage

## Includes

    #include <gst/sdp/gstsdpmessage.h>

## Description

The GstSDPMessage helper functions makes it easy to parse and create SDP messages.

## Functions

### gst_sdp_connection_set ()

    GstSDPResult
    gst_sdp_connection_set (GstSDPConnection *conn,
                            const gchar *nettype,
                            const gchar *addrtype,
                            const gchar *address,
                            guint ttl,
                            guint addr_number);

Set the connection with the given parameters.

#### Parameters

conn | a GstSDPConnection |
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

`GST_SDP_OK` .

Since: 1.2

### gst_sdp_connection_clear ()

    GstSDPResult
    gst_sdp_connection_clear (GstSDPConnection *conn);

Clear the connection.

#### Parameters

conn | a GstSDPConnection |

#### Returns

`GST_SDP_OK` .

Since: 1.2

### gst_sdp_bandwidth_set ()

    GstSDPResult
    gst_sdp_bandwidth_set (GstSDPBandwidth *bw,
                           const gchar *bwtype,
                           guint bandwidth);

Set bandwidth information in `bw` .

#### Parameters

bw | a GstSDPBandwidth |
bwtype | the bandwidth modifier type |
bandwidth | the bandwidth in kilobits per second |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_bandwidth_clear ()

    GstSDPResult
    gst_sdp_bandwidth_clear (GstSDPBandwidth *bw);

Reset the bandwidth information in `bw` .

#### Parameters

bw | a GstSDPBandwidth |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_media_parse_keymgmt ()

    GstSDPResult
    gst_sdp_media_parse_keymgmt (const GstSDPMedia *media,
                                 GstMIKEYMessage **mikey);

Creates a new GstMIKEYMessage after parsing the key-mgmt attribute from a GstSDPMedia.

#### Parameters

media | a GstSDPMedia |
mikey | pointer to new GstMIKEYMessage. | [out][transfer full]

#### Returns

a GstSDPResult.

Since: 1.8.1

### gst_sdp_message_parse_keymgmt ()

    GstSDPResult
    gst_sdp_message_parse_keymgmt (const GstSDPMessage *msg,
                                   GstMIKEYMessage **mikey);

Creates a new GstMIKEYMessage after parsing the key-mgmt attribute from a GstSDPMessage.

#### Parameters

msg | a GstSDPMessage |
mikey | pointer to new GstMIKEYMessage. | [out][transfer full]

#### Returns

a GstSDPResult.

Since: 1.8.1

### gst_sdp_time_set ()

    GstSDPResult
    gst_sdp_time_set (GstSDPTime *t,
                      const gchar *start,
                      const gchar *stop,
                      const gchar **repeat);

Set time information `start` , `stop` and `repeat` in `t` .

#### Parameters

t | a GstSDPTime |
start | the start time |
stop | the stop time |
repeat | the repeat times. | [array zero-terminated=1]

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_time_clear ()

    GstSDPResult
    gst_sdp_time_clear (GstSDPTime *t);

Reset the time information in `t` .

#### Parameters

t | a GstSDPTime |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_zone_set ()

    GstSDPResult
    gst_sdp_zone_set (GstSDPZone *zone,
                      const gchar *adj_time,
                      const gchar *typed_time);

Set zone information in `zone` .

#### Parameters

zone | a GstSDPZone |
adj_time | the NTP time that a time zone adjustment happens |
typed_time | the offset from the time when the session was first scheduled |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_zone_clear ()

    GstSDPResult
    gst_sdp_zone_clear (GstSDPZone *zone);

Reset the zone information in `zone` .

#### Parameters

zone | a GstSDPZone |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_attribute_set ()

    GstSDPResult
    gst_sdp_attribute_set (GstSDPAttribute *attr,
                           const gchar *key,
                           const gchar *value);

Set the attribute with `key` and `value` .

#### Parameters

attr | a GstSDPAttribute |
key | the key |
value | the value |

#### Returns

`GST_SDP_OK` .

Since: 1.2

### gst_sdp_attribute_clear ()

    GstSDPResult
    gst_sdp_attribute_clear (GstSDPAttribute *attr);

Clear the attribute.

#### Parameters

attr | a GstSDPAttribute |

#### Returns

`GST_SDP_OK` .

Since: 1.2

### gst_sdp_message_new ()

    GstSDPResult
    gst_sdp_message_new (GstSDPMessage **msg);

Allocate a new GstSDPMessage and store the result in `msg` .

#### Parameters

msg | pointer to new GstSDPMessage. | [out][transfer full]

#### Returns

a GstSDPResult.

### gst_sdp_message_copy ()

    GstSDPResult
    gst_sdp_message_copy (const GstSDPMessage *msg,
                          GstSDPMessage **copy);

Allocate a new copy of `msg` and store the result in `copy` . The value in `copy` should be release with gst_sdp_message_free function.

#### Parameters

msg | a GstSDPMessage |
copy | pointer to new GstSDPMessage. | [out][transfer full]

#### Returns

a GstSDPResult

Since: 1.2

### gst_sdp_message_init ()

    GstSDPResult
    gst_sdp_message_init (GstSDPMessage *msg);

Initialize `msg` so that its contents are as if it was freshly allocated with `gst_sdp_message_new()`. This function is mostly used to initialize a message allocated on the stack. `gst_sdp_message_uninit()` undoes this operation.

When this function is invoked on newly allocated data (with malloc or on the stack), its contents should be set to 0 before calling this function.

#### Parameters

msg | a GstSDPMessage |

#### Returns

a GstSDPResult.

### gst_sdp_message_uninit ()

    GstSDPResult
    gst_sdp_message_uninit (GstSDPMessage *msg);

Free all resources allocated in `msg` . `msg` should not be used anymore after this function. This function should be used when `msg` was allocated on the stack and initialized with `gst_sdp_message_init()`.

#### Parameters

msg | a GstSDPMessage |

#### Returns

a GstSDPResult.

### gst_sdp_message_free ()

    GstSDPResult
    gst_sdp_message_free (GstSDPMessage *msg);

Free all resources allocated by `msg` . `msg` should not be used anymore after this function. This function should be used when `msg` was dynamically allocated with `gst_sdp_message_new()`.

#### Parameters

msg | a GstSDPMessage |

#### Returns

a GstSDPResult.

### gst_sdp_message_parse_buffer ()

    GstSDPResult
    gst_sdp_message_parse_buffer (const guint8 *data,
                                  guint size,
                                  GstSDPMessage *msg);

Parse the contents of `size` bytes pointed to by `data` and store the result in `msg` .

#### Parameters

data | the start of the buffer. | [array length=size]
size | the size of the buffer |
msg | the result GstSDPMessage |

#### Returns

GST_SDP_OK on success.

### gst_sdp_message_as_text ()

    gchar *
    gst_sdp_message_as_text (const GstSDPMessage *msg);

Convert the contents of `msg` to a text string.

#### Parameters

msg | a GstSDPMessage |

#### Returns

A dynamically allocated string representing the SDP description.

### gst_sdp_message_parse_uri ()

    GstSDPResult
    gst_sdp_message_parse_uri (const gchar *uri,
                               GstSDPMessage *msg);

Parse the null-terminated `uri` and store the result in `msg` .

The uri should be of the form:

scheme://[address:ttl=ttl]/sessionname]

where value is url encoded. This looslely resembles http://tools.ietf.org/html/draft-fujikawa-sdp-url-01

#### Parameters

uri | the start of the uri |
msg | the result GstSDPMessage |

#### Returns

GST_SDP_OK on success.

### gst_sdp_message_as_uri ()

    gchar *
    gst_sdp_message_as_uri (const gchar *scheme,
                            const GstSDPMessage *msg);

Creates a uri from `msg` with the given `scheme` . The uri has the format:

@scheme:///[type=value *[&type=value]]

Where each value is url encoded.

#### Parameters

scheme | the uri scheme |
msg | the GstSDPMessage |

#### Returns

a uri for `msg` .

### gst_sdp_address_is_multicast ()

    gboolean
    gst_sdp_address_is_multicast (const gchar *nettype,
                                  const gchar *addrtype,
                                  const gchar *addr);

Check if the given `addr` is a multicast address.

#### Parameters

nettype | a network type |
addrtype | an address type |
addr | an address |

#### Returns

TRUE when `addr` is multicast.

### gst_sdp_message_get_version ()

    const gchar *
    gst_sdp_message_get_version (const GstSDPMessage *msg);

Get the version in `msg` .

#### Parameters

msg | a GstSDPMessage |

#### Returns

a GstSDPResult.

### gst_sdp_message_set_version ()

    GstSDPResult
    gst_sdp_message_set_version (GstSDPMessage *msg,
                                 const gchar *version);

Set the version in `msg` .

#### Parameters

msg | a GstSDPMessage |
version | the version |

#### Returns

a GstSDPResult.

### gst_sdp_message_get_origin ()

    const GstSDPOrigin *
    gst_sdp_message_get_origin (const GstSDPMessage *msg);

Get the origin of `msg` .

#### Parameters

msg | a GstSDPMessage |

#### Returns

a GstSDPOrigin. The result remains valid as long as `msg` is valid.

### gst_sdp_message_set_origin ()

    GstSDPResult
    gst_sdp_message_set_origin (GstSDPMessage *msg,
                                const gchar *username,
                                const gchar *sess_id,
                                const gchar *sess_version,
                                const gchar *nettype,
                                const gchar *addrtype,
                                const gchar *addr);

Configure the SDP origin in `msg` with the given parameters.

#### Parameters

msg | a GstSDPMessage |
username | the user name |
sess_id | a session id |
sess_version | a session version |
nettype | a network type |
addrtype | an address type |
addr | an address |

#### Returns

GST_SDP_OK.

### gst_sdp_message_get_session_name ()

    const gchar *
    gst_sdp_message_get_session_name (const GstSDPMessage *msg);

Get the session name in `msg` .

#### Parameters

msg | a GstSDPMessage |

#### Returns

a GstSDPResult.

### gst_sdp_message_set_session_name ()

    GstSDPResult
    gst_sdp_message_set_session_name (GstSDPMessage *msg,
                                      const gchar *session_name);

Set the session name in `msg` .

#### Parameters

msg | a GstSDPMessage |
session_name | the session name |

#### Returns

a GstSDPResult.

### gst_sdp_message_get_information ()

    const gchar *
    gst_sdp_message_get_information (const GstSDPMessage *msg);

Get the information in `msg` .

#### Parameters

msg | a GstSDPMessage |

#### Returns

a GstSDPResult.

### gst_sdp_message_set_information ()

    GstSDPResult
    gst_sdp_message_set_information (GstSDPMessage *msg,
                                     const gchar *information);

Set the information in `msg` .

#### Parameters

msg | a GstSDPMessage |
information | the information |

#### Returns

a GstSDPResult.

### gst_sdp_message_get_uri ()

    const gchar *
    gst_sdp_message_get_uri (const GstSDPMessage *msg);

Get the URI in `msg` .

#### Parameters

msg | a GstSDPMessage |

#### Returns

a GstSDPResult.

### gst_sdp_message_set_uri ()

    GstSDPResult
    gst_sdp_message_set_uri (GstSDPMessage *msg,
                             const gchar *uri);

Set the URI in `msg` .

#### Parameters

msg | a GstSDPMessage |
uri | the URI |

#### Returns

a GstSDPResult.

### gst_sdp_message_emails_len ()

    guint
    gst_sdp_message_emails_len (const GstSDPMessage *msg);

Get the number of emails in `msg` .

#### Parameters

msg | a GstSDPMessage |

#### Returns

the number of emails in `msg` .

### gst_sdp_message_get_email ()

    const gchar *
    gst_sdp_message_get_email (const GstSDPMessage *msg,
                               guint idx);

Get the email with number `idx` from `msg` .

#### Parameters

msg | a GstSDPMessage |
idx | an email index |

#### Returns

the email at position `idx` .

### gst_sdp_message_insert_email ()

    GstSDPResult
    gst_sdp_message_insert_email (GstSDPMessage *msg,
                                  gint idx,
                                  const gchar *email);

Insert `email` into the array of emails in `msg` at index `idx` . When -1 is given as `idx` , the email is inserted at the end.

#### Parameters

msg | a GstSDPMessage |
idx | an index |
email | an email |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_message_replace_email ()

    GstSDPResult
    gst_sdp_message_replace_email (GstSDPMessage *msg,
                                   guint idx,
                                   const gchar *email);

Replace the email in `msg` at index `idx` with `email` .

#### Parameters

msg | a GstSDPMessage |
idx | an email index |
email | an email |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_message_remove_email ()

    GstSDPResult
    gst_sdp_message_remove_email (GstSDPMessage *msg,
                                  guint idx);

Remove the email in `msg` at index `idx` .

#### Parameters

msg | a GstSDPMessage |
idx | an email index |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_message_add_email ()

    GstSDPResult
    gst_sdp_message_add_email (GstSDPMessage *msg,
                               const gchar *email);

Add `email` to the list of emails in `msg` .

#### Parameters

msg | a GstSDPMessage |
email | an email |

#### Returns

a GstSDPResult.

### gst_sdp_message_phones_len ()

    guint
    gst_sdp_message_phones_len (const GstSDPMessage *msg);

Get the number of phones in `msg` .

#### Parameters

msg | a GstSDPMessage |

#### Returns

the number of phones in `msg` .

### gst_sdp_message_get_phone ()

    const gchar *
    gst_sdp_message_get_phone (const GstSDPMessage *msg,
                               guint idx);

Get the phone with number `idx` from `msg` .

#### Parameters

msg | a GstSDPMessage |
idx | a phone index |

#### Returns

the phone at position `idx` .

### gst_sdp_message_insert_phone ()

    GstSDPResult
    gst_sdp_message_insert_phone (GstSDPMessage *msg,
                                  gint idx,
                                  const gchar *phone);

Insert `phone` into the array of phone numbers in `msg` at index `idx` . When -1 is given as `idx` , the phone is inserted at the end.

#### Parameters

msg | a GstSDPMessage |
idx | a phone index |
phone | a phone |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_message_replace_phone ()

    GstSDPResult
    gst_sdp_message_replace_phone (GstSDPMessage *msg,
                                   guint idx,
                                   const gchar *phone);

Replace the phone number in `msg` at index `idx` with `phone` .

#### Parameters

msg | a GstSDPMessage |
idx | a phone index |
phone | a phone |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_message_remove_phone ()

    GstSDPResult
    gst_sdp_message_remove_phone (GstSDPMessage *msg,
                                  guint idx);

Remove the phone number in `msg` at index `idx` .

#### Parameters

msg | a GstSDPMessage |
idx | a phone index |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_message_add_phone ()

    GstSDPResult
    gst_sdp_message_add_phone (GstSDPMessage *msg,
                               const gchar *phone);

Add `phone` to the list of phones in `msg` .

#### Parameters

msg | a GstSDPMessage |
phone | a phone |

#### Returns

a GstSDPResult.

### gst_sdp_message_get_connection ()

    const GstSDPConnection *
    gst_sdp_message_get_connection (const GstSDPMessage *msg);

Get the connection of `msg` .

#### Parameters

msg | a GstSDPMessage |

#### Returns

a GstSDPConnection. The result remains valid as long as `msg` is valid.

### gst_sdp_message_set_connection ()

    GstSDPResult
    gst_sdp_message_set_connection (GstSDPMessage *msg,
                                    const gchar *nettype,
                                    const gchar *addrtype,
                                    const gchar *address,
                                    guint ttl,
                                    guint addr_number);

Configure the SDP connection in `msg` with the given parameters.

#### Parameters

msg | a GstSDPMessage |
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 GstSDPResult.

### gst_sdp_message_bandwidths_len ()

    guint
    gst_sdp_message_bandwidths_len (const GstSDPMessage *msg);

Get the number of bandwidth information in `msg` .

#### Parameters

msg | a GstSDPMessage |

#### Returns

the number of bandwidth information in `msg` .

### gst_sdp_message_get_bandwidth ()

    const GstSDPBandwidth *
    gst_sdp_message_get_bandwidth (const GstSDPMessage *msg,
                                   guint idx);

Get the bandwidth at index `idx` from `msg` .

#### Parameters

msg | a GstSDPMessage |
idx | the bandwidth index |

#### Returns

a GstSDPBandwidth.

### gst_sdp_message_insert_bandwidth ()

    GstSDPResult
    gst_sdp_message_insert_bandwidth (GstSDPMessage *msg,
                                      gint idx,
                                      GstSDPBandwidth *bw);

Insert bandwidth parameters into the array of bandwidths in `msg` at index `idx` . When -1 is given as `idx` , the bandwidth is inserted at the end.

#### Parameters

msg | a GstSDPMessage |
idx | an index |
bw | the bandwidth |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_message_replace_bandwidth ()

    GstSDPResult
    gst_sdp_message_replace_bandwidth (GstSDPMessage *msg,
                                       guint idx,
                                       GstSDPBandwidth *bw);

Replace the bandwidth information in `msg` at index `idx` with `bw` .

#### Parameters

msg | a GstSDPMessage |
idx | the bandwidth index |
bw | the bandwidth |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_message_remove_bandwidth ()

    GstSDPResult
    gst_sdp_message_remove_bandwidth (GstSDPMessage *msg,
                                      guint idx);

Remove the bandwidth information in `msg` at index `idx` .

#### Parameters

msg | a GstSDPMessage |
idx | the bandwidth index |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_message_add_bandwidth ()

    GstSDPResult
    gst_sdp_message_add_bandwidth (GstSDPMessage *msg,
                                   const gchar *bwtype,
                                   guint bandwidth);

Add the specified bandwidth information to `msg` .

#### Parameters

msg | a GstSDPMessage |
bwtype | the bandwidth modifier type |
bandwidth | the bandwidth in kilobits per second |

#### Returns

a GstSDPResult.

### gst_sdp_message_times_len ()

    guint
    gst_sdp_message_times_len (const GstSDPMessage *msg);

Get the number of time information entries in `msg` .

#### Parameters

msg | a GstSDPMessage |

#### Returns

the number of time information entries in `msg` .

### gst_sdp_message_get_time ()

    const GstSDPTime *
    gst_sdp_message_get_time (const GstSDPMessage *msg,
                              guint idx);

Get time information with index `idx` from `msg` .

#### Parameters

msg | a GstSDPMessage |
idx | the time index |

#### Returns

a GstSDPTime.

### gst_sdp_message_insert_time ()

    GstSDPResult
    gst_sdp_message_insert_time (GstSDPMessage *msg,
                                 gint idx,
                                 GstSDPTime *t);

Insert time parameters into the array of times in `msg` at index `idx` . When -1 is given as `idx` , the times are inserted at the end.

#### Parameters

msg | a GstSDPMessage |
idx | an index |
t | a GstSDPTime |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_message_replace_time ()

    GstSDPResult
    gst_sdp_message_replace_time (GstSDPMessage *msg,
                                  guint idx,
                                  GstSDPTime *t);

Replace the time information in `msg` at index `idx` with `t` .

#### Parameters

msg | a GstSDPMessage |
idx | the index |
t | a GstSDPTime |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_message_remove_time ()

    GstSDPResult
    gst_sdp_message_remove_time (GstSDPMessage *msg,
                                 guint idx);

Remove the time information in `msg` at index `idx` .

#### Parameters

msg | a GstSDPMessage |
idx | the index |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_message_add_time ()

    GstSDPResult
    gst_sdp_message_add_time (GstSDPMessage *msg,
                              const gchar *start,
                              const gchar *stop,
                              const gchar **repeat);

Add time information `start` and `stop` to `msg` .

#### Parameters

msg | a GstSDPMessage |
start | the start time |
stop | the stop time |
repeat | the repeat times. | [array zero-terminated=1]

#### Returns

a GstSDPResult.

### gst_sdp_message_zones_len ()

    guint
    gst_sdp_message_zones_len (const GstSDPMessage *msg);

Get the number of time zone information entries in `msg` .

#### Parameters

msg | a GstSDPMessage |

#### Returns

the number of time zone information entries in `msg` .

### gst_sdp_message_get_zone ()

    const GstSDPZone *
    gst_sdp_message_get_zone (const GstSDPMessage *msg,
                              guint idx);

Get time zone information with index `idx` from `msg` .

#### Parameters

msg | a GstSDPMessage |
idx | the zone index |

#### Returns

a GstSDPZone.

### gst_sdp_message_insert_zone ()

    GstSDPResult
    gst_sdp_message_insert_zone (GstSDPMessage *msg,
                                 gint idx,
                                 GstSDPZone *zone);

Insert zone parameters into the array of zones in `msg` at index `idx` . When -1 is given as `idx` , the zone is inserted at the end.

#### Parameters

msg | a GstSDPMessage |
idx | an index `zone` a GstSDPZone |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_message_replace_zone ()

    GstSDPResult
    gst_sdp_message_replace_zone (GstSDPMessage *msg,
                                  guint idx,
                                  GstSDPZone *zone);

Replace the zone information in `msg` at index `idx` with `zone` .

#### Parameters

msg | a GstSDPMessage |
idx | the index |
zone | a GstSDPZone |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_message_remove_zone ()

    GstSDPResult
    gst_sdp_message_remove_zone (GstSDPMessage *msg,
                                 guint idx);

Remove the zone information in `msg` at index `idx` .

#### Parameters

msg | a GstSDPMessage |
idx | the index |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_message_add_zone ()

    GstSDPResult
    gst_sdp_message_add_zone (GstSDPMessage *msg,
                              const gchar *adj_time,
                              const gchar *typed_time);

Add time zone information to `msg` .

#### Parameters

msg | a GstSDPMessage |
adj_time | the NTP time that a time zone adjustment happens |
typed_time | the offset from the time when the session was first scheduled |

#### Returns

a GstSDPResult.

### gst_sdp_message_get_key ()

    const GstSDPKey *
    gst_sdp_message_get_key (const GstSDPMessage *msg);

Get the encryption information from `msg` .

#### Parameters

msg | a GstSDPMessage |

#### Returns

a GstSDPKey.

### gst_sdp_message_set_key ()

    GstSDPResult
    gst_sdp_message_set_key (GstSDPMessage *msg,
                             const gchar *type,
                             const gchar *data);

Adds the encryption information to `msg` .

#### Parameters

msg | a GstSDPMessage |
type | the encryption type |
data | the encryption data |

#### Returns

a GstSDPResult.

### gst_sdp_message_attributes_len ()

    guint
    gst_sdp_message_attributes_len (const GstSDPMessage *msg);

Get the number of attributes in `msg` .

#### Parameters

msg | a GstSDPMessage |

#### Returns

the number of attributes in `msg` .

### gst_sdp_message_get_attribute ()

    const GstSDPAttribute *
    gst_sdp_message_get_attribute (const GstSDPMessage *msg,
                                   guint idx);

Get the attribute at position `idx` in `msg` .

#### Parameters

msg | a GstSDPMessage |
idx | the index |

#### Returns

the GstSDPAttribute at position `idx` .

### gst_sdp_message_get_attribute_val ()

    const gchar *
    gst_sdp_message_get_attribute_val (const GstSDPMessage *msg,
                                       const gchar *key);

Get the first attribute with key `key` in `msg` .

#### Parameters

msg | a GstSDPMessage |
key | the key |

#### Returns

the attribute value of the first attribute with `key` .

### gst_sdp_message_get_attribute_val_n ()

    const gchar *
    gst_sdp_message_get_attribute_val_n (const GstSDPMessage *msg,
                                         const gchar *key,
                                         guint nth);

Get the `nth` attribute with key `key` in `msg` .

#### Parameters

msg | a GstSDPMessage |
key | the key |
nth | the index |

#### Returns

the attribute value of the `nth` attribute with `key` .

### gst_sdp_message_insert_attribute ()

    GstSDPResult
    gst_sdp_message_insert_attribute (GstSDPMessage *msg,
                                      gint idx,
                                      GstSDPAttribute *attr);

Insert attribute into the array of attributes in `msg` at index `idx` . When -1 is given as `idx` , the attribute is inserted at the end.

#### Parameters

msg | a GstSDPMessage |
idx | an index |
attr | a GstSDPAttribute |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_message_replace_attribute ()

    GstSDPResult
    gst_sdp_message_replace_attribute (GstSDPMessage *msg,
                                       guint idx,
                                       GstSDPAttribute *attr);

Replace the attribute in `msg` at index `idx` with `attr` .

#### Parameters

msg | a GstSDPMessage |
idx | the index |
attr | a GstSDPAttribute |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_message_remove_attribute ()

    GstSDPResult
    gst_sdp_message_remove_attribute (GstSDPMessage *msg,
                                      guint idx);

Remove the attribute in `msg` at index `idx` .

#### Parameters

msg | a GstSDPMessage |
idx | the index |

#### Returns

a GstSDPResult.

Since: 1.2

### gst_sdp_message_add_attribute ()

    GstSDPResult
    gst_sdp_message_add_attribute (GstSDPMessage *msg,
                                   const gchar *key,
                                   const gchar *value);

Add the attribute with `key` and `value` to `msg` .

#### Parameters

msg | a GstSDPMessage |
key | the key |
value | the value |

#### Returns

`GST_SDP_OK` .

### gst_sdp_message_medias_len ()

    guint
    gst_sdp_message_medias_len (const GstSDPMessage *msg);

Get the number of media descriptions in `msg` .

#### Parameters

msg | a GstSDPMessage |

#### Returns

the number of media descriptions in `msg` .

### gst_sdp_message_get_media ()

    const GstSDPMedia *
    gst_sdp_message_get_media (const GstSDPMessage *msg,
                               guint idx);

Get the media description at index `idx` in `msg` .

#### Parameters

msg | a GstSDPMessage |
idx | the index |

#### Returns

a GstSDPMedia.

### gst_sdp_message_add_media ()

    GstSDPResult
    gst_sdp_message_add_media (GstSDPMessage *msg,
                               GstSDPMedia *media);

Adds `media` to the array of medias in `msg` . This function takes ownership of the contents of `media` so that `media` will have to be reinitialized with `gst_sdp_media_init()` before it can be used again.

#### Parameters

msg | a GstSDPMessage |
media | a GstSDPMedia to add |

#### Returns

a GstSDPResult.

### gst_sdp_message_dump ()

    GstSDPResult
    gst_sdp_message_dump (const GstSDPMessage *msg);

Dump the parsed contents of `msg` to stdout.

#### Parameters

msg | a GstSDPMessage |

#### Returns

a GstSDPResult.

### gst_sdp_media_new ()

    GstSDPResult
    gst_sdp_media_new (GstSDPMedia **media);

Allocate a new GstSDPMedia and store the result in `media` .

#### Parameters

media | pointer to new GstSDPMedia. | [out][transfer full]

#### Returns

a GstSDPResult.

### gst_sdp_media_copy ()

    GstSDPResult
    gst_sdp_media_copy (const GstSDPMedia *media,
                        GstSDPMedia **copy);

Allocate a new copy of `media` and store the result in `copy` . The value in `copy` should be release with gst_sdp_media_free function.

#### Parameters

media | a GstSDPMedia |
copy | pointer to new GstSDPMedia. | [out][transfer full]

#### Returns

a GstSDPResult

Since: 1.2

### gst_sdp_media_init ()

    GstSDPResult
    gst_sdp_media_init (GstSDPMedia *media);

Initialize `media` so that its contents are as if it was freshly allocated with `gst_sdp_media_new()`. This function is mostly used to initialize a media allocated on the stack. `gst_sdp_media_uninit()` undoes this operation.

When this function is invoked on newly allocated data (with malloc or on the stack), its contents should be set to 0 before calling this function.

#### Parameters

media | a GstSDPMedia |

#### Returns

a GstSDPResult.

### gst_sdp_media_uninit ()

    GstSDPResult
    gst_sdp_media_uninit (GstSDPMedia *media);

Free all resources allocated in `media` . `media` should not be used anymore after this function. This function should be used when `media` was allocated on the stack and initialized with `gst_sdp_media_init()`.

#### Parameters

media | a GstSDPMedia |

#### Returns

a GstSDPResult.

### gst_sdp_media_free ()

    GstSDPResult
    gst_sdp_media_free (GstSDPMedia *media);

Free all resources allocated by `media` . `media` should not be used anymore after this function. This function should be used when `media` was dynamically allocated with `gst_sdp_media_new()`.

#### Parameters

media | a GstSDPMedia |

#### Returns

a GstSDPResult.

### gst_sdp_media_as_text ()

    gchar *
    gst_sdp_media_as_text (const GstSDPMedia *media);

Convert the contents of `media` to a text string.

#### Parameters

media | a GstSDPMedia |

#### Returns

A dynamically allocated string representing the media.

### gst_sdp_media_get_media ()

    const gchar *
    gst_sdp_media_get_media (const GstSDPMedia *media);

Get the media description of `media` .

#### Parameters

media | a GstSDPMedia |

#### Returns

the media description.

### gst_sdp_media_set_media ()

    GstSDPResult
    gst_sdp_media_set_media (GstSDPMedia *media,
                             const gchar *med);

Set the media description of `media` to `med` .

#### Parameters

media | a GstSDPMedia |
med | the media description |

#### Returns

GST_SDP_OK.

### gst_sdp_media_get_port ()

    guint
    gst_sdp_media_get_port (const GstSDPMedia *media);

Get the port number for `media` .

#### Parameters

media | a GstSDPMedia |

#### Returns

the port number of `media` .

### gst_sdp_media_get_num_ports ()

    guint
    gst_sdp_media_get_num_ports (const GstSDPMedia *media);

Get the number of ports for `media` .

#### Parameters

media | a GstSDPMedia |

#### Returns

the number of ports for `media` .

### gst_sdp_media_set_port_info ()

    GstSDPResult
    gst_sdp_media_set_port_info (GstSDPMedia *media,
                                 guint port,
                                 guint num_ports);

Set the port information in `media` .

#### Parameters

media | a GstSDPMedia |
port | the port number |
num_ports | the number of ports |

#### Returns

GST_SDP_OK.

### gst_sdp_media_get_proto ()

    const gchar *
    gst_sdp_media_get_proto (const GstSDPMedia *media);

Get the transport protocol of `media`

#### Parameters

media | a GstSDPMedia |

#### Returns

the transport protocol of `media` .

### gst_sdp_media_set_proto ()

    GstSDPResult
    gst_sdp_media_set_proto (GstSDPMedia *media,
                             const gchar *proto);

Set the media transport protocol of `media` to `proto` .

#### Parameters

media | a GstSDPMedia |
proto | the media transport protocol |

#### Returns

GST_SDP_OK.

### gst_sdp_media_formats_len ()

    guint
    gst_sdp_media_formats_len (const GstSDPMedia *media);

Get the number of formats in `media` .

#### Parameters

media | a GstSDPMedia |

#### Returns

the number of formats in `media` .

### gst_sdp_media_get_format ()

    const gchar *
    gst_sdp_media_get_format (const GstSDPMedia *media,
                              guint idx);

Get the format information at position `idx` in `media` .

#### Parameters

media | a GstSDPMedia |
idx | an index |

#### Returns

the format at position `idx` .

### gst_sdp_media_insert_format ()

    GstSDPResult
    gst_sdp_media_insert_format (GstSDPMedia *media,
                                 gint idx,
                                 const gchar *format);

Insert the format information to `media` at `idx` . When `idx` is -1, the format is appended.

#### Parameters

media | a GstSDPMedia |
idx | an index |
format | the format |

#### Returns

GST_SDP_OK.

Since: 1.2

### gst_sdp_media_replace_format ()

    GstSDPResult
    gst_sdp_media_replace_format (GstSDPMedia *media,
                                  guint idx,
                                  const gchar *format);

Replace the format information in `media` at `idx` with `format` .

#### Parameters

media | a GstSDPMedia |
idx | an index |
format | the format |

#### Returns

GST_SDP_OK.

Since: 1.2

### gst_sdp_media_remove_format ()

    GstSDPResult
    gst_sdp_media_remove_format (GstSDPMedia *media,
                                 guint idx);

Remove the format information in `media` at `idx` .

#### Parameters

media | a GstSDPMedia |
idx | an index |

#### Returns

GST_SDP_OK.

Since: 1.2

### gst_sdp_media_add_format ()

    GstSDPResult
    gst_sdp_media_add_format (GstSDPMedia *media,
                              const gchar *format);

Add the format information to `media` .

#### Parameters

media | a GstSDPMedia |
format | the format |

#### Returns

GST_SDP_OK.

### gst_sdp_media_get_information ()

    const gchar *
    gst_sdp_media_get_information (const GstSDPMedia *media);

Get the information of `media`

#### Parameters

media | a GstSDPMedia |

#### Returns

the information of `media` .

### gst_sdp_media_set_information ()

    GstSDPResult
    gst_sdp_media_set_information (GstSDPMedia *media,
                                   const gchar *information);

Set the media information of `media` to `information` .

#### Parameters

media | a GstSDPMedia |
information | the media information |

#### Returns

GST_SDP_OK.

### gst_sdp_media_connections_len ()

    guint
    gst_sdp_media_connections_len (const GstSDPMedia *media);

Get the number of connection fields in `media` .

#### Parameters

media | a GstSDPMedia |

#### Returns

the number of connections in `media` .

### gst_sdp_media_get_connection ()

    const GstSDPConnection *
    gst_sdp_media_get_connection (const GstSDPMedia *media,
                                  guint idx);

Get the connection at position `idx` in `media` .

#### Parameters

media | a GstSDPMedia |
idx | an index |

#### Returns

the GstSDPConnection at position `idx` .

### gst_sdp_media_insert_connection ()

    GstSDPResult
    gst_sdp_media_insert_connection (GstSDPMedia *media,
                                     gint idx,
                                     GstSDPConnection *conn);

Insert the connection information to `media` at `idx` . When `idx` is -1, the connection is appended.

#### Parameters

media | a GstSDPMedia |
idx | an index |
conn | a GstSDPConnection |

#### Returns

GST_SDP_OK.

Since: 1.2

### gst_sdp_media_replace_connection ()

    GstSDPResult
    gst_sdp_media_replace_connection (GstSDPMedia *media,
                                      guint idx,
                                      GstSDPConnection *conn);

Replace the connection information in `media` at `idx` with `conn` .

#### Parameters

media | a GstSDPMedia |
idx | an index |
conn | a GstSDPConnection |

#### Returns

GST_SDP_OK.

Since: 1.2

### gst_sdp_media_remove_connection ()

    GstSDPResult
    gst_sdp_media_remove_connection (GstSDPMedia *media,
                                     guint idx);

Remove the connection information in `media` at `idx` .

#### Parameters

media | a GstSDPMedia |
idx | an index |

#### Returns

GST_SDP_OK.

Since: 1.2

### gst_sdp_media_add_connection ()

    GstSDPResult
    gst_sdp_media_add_connection (GstSDPMedia *media,
                                  const gchar *nettype,
                                  const gchar *addrtype,
                                  const gchar *address,
                                  guint ttl,
                                  guint addr_number);

Add the given connection parameters to `media` .

#### Parameters

media | a GstSDPMedia |
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 GstSDPResult.

### gst_sdp_media_bandwidths_len ()

    guint
    gst_sdp_media_bandwidths_len (const GstSDPMedia *media);

Get the number of bandwidth fields in `media` .

#### Parameters

media | a GstSDPMedia |

#### Returns

the number of bandwidths in `media` .

### gst_sdp_media_get_bandwidth ()

    const GstSDPBandwidth *
    gst_sdp_media_get_bandwidth (const GstSDPMedia *media,
                                 guint idx);

Get the bandwidth at position `idx` in `media` .

#### Parameters

media | a GstSDPMedia |
idx | an index |

#### Returns

the GstSDPBandwidth at position `idx` .

### gst_sdp_media_insert_bandwidth ()

    GstSDPResult
    gst_sdp_media_insert_bandwidth (GstSDPMedia *media,
                                    gint idx,
                                    GstSDPBandwidth *bw);

Insert the bandwidth information to `media` at `idx` . When `idx` is -1, the bandwidth is appended.

#### Parameters

media | a GstSDPMedia |
idx | an index |
bw | a GstSDPBandwidth |

#### Returns

GST_SDP_OK.

Since: 1.2

### gst_sdp_media_replace_bandwidth ()

    GstSDPResult
    gst_sdp_media_replace_bandwidth (GstSDPMedia *media,
                                     guint idx,
                                     GstSDPBandwidth *bw);

Replace the bandwidth information in `media` at `idx` with `bw` .

#### Parameters

media | a GstSDPMedia |
idx | an index |
bw | a GstSDPBandwidth |

#### Returns

GST_SDP_OK.

Since: 1.2

### gst_sdp_media_remove_bandwidth ()

    GstSDPResult
    gst_sdp_media_remove_bandwidth (GstSDPMedia *media,
                                    guint idx);

Remove the bandwidth information in `media` at `idx` .

#### Parameters

media | a GstSDPMedia |
idx | an index |

#### Returns

GST_SDP_OK.

Since: 1.2

### gst_sdp_media_add_bandwidth ()

    GstSDPResult
    gst_sdp_media_add_bandwidth (GstSDPMedia *media,
                                 const gchar *bwtype,
                                 guint bandwidth);

Add the bandwidth information with `bwtype` and `bandwidth` to `media` .

#### Parameters

media | a GstSDPMedia |
bwtype | the bandwidth modifier type |
bandwidth | the bandwidth in kilobits per second |

#### Returns

GST_SDP_OK.

### gst_sdp_media_get_key ()

    const GstSDPKey *
    gst_sdp_media_get_key (const GstSDPMedia *media);

Get the encryption information from `media` .

#### Parameters

media | a GstSDPMedia |

#### Returns

a GstSDPKey.

### gst_sdp_media_set_key ()

    GstSDPResult
    gst_sdp_media_set_key (GstSDPMedia *media,
                           const gchar *type,
                           const gchar *data);

Adds the encryption information to `media` .

#### Parameters

media | a GstSDPMedia |
type | the encryption type |
data | the encryption data |

#### Returns

a GstSDPResult.

### gst_sdp_media_attributes_len ()

    guint
    gst_sdp_media_attributes_len (const GstSDPMedia *media);

Get the number of attribute fields in `media` .

#### Parameters

media | a GstSDPMedia |

#### Returns

the number of attributes in `media` .

### gst_sdp_media_get_attribute ()

    const GstSDPAttribute *
    gst_sdp_media_get_attribute (const GstSDPMedia *media,
                                 guint idx);

Get the attribute at position `idx` in `media` .

#### Parameters

media | a GstSDPMedia |
idx | an index |

#### Returns

the GstSDPAttribute at position `idx` .

### gst_sdp_media_get_attribute_val ()

    const gchar *
    gst_sdp_media_get_attribute_val (const GstSDPMedia *media,
                                     const gchar *key);

Get the first attribute value for `key` in `media` .

#### Parameters

media | a GstSDPMedia |
key | a key |

#### Returns

the first attribute value for `key` .

### gst_sdp_media_get_attribute_val_n ()

    const gchar *
    gst_sdp_media_get_attribute_val_n (const GstSDPMedia *media,
                                       const gchar *key,
                                       guint nth);

Get the `nth` attribute value for `key` in `media` .

#### Parameters

media | a GstSDPMedia |
key | a key |
nth | an index |

#### Returns

the `nth` attribute value.

### gst_sdp_media_insert_attribute ()

    GstSDPResult
    gst_sdp_media_insert_attribute (GstSDPMedia *media,
                                    gint idx,
                                    GstSDPAttribute *attr);

Insert the attribute to `media` at `idx` . When `idx` is -1, the attribute is appended.

#### Parameters

media | a GstSDPMedia |
idx | an index |
attr | a GstSDPAttribute |

#### Returns

GST_SDP_OK.

Since: 1.2

### gst_sdp_media_replace_attribute ()

    GstSDPResult
    gst_sdp_media_replace_attribute (GstSDPMedia *media,
                                     guint idx,
                                     GstSDPAttribute *attr);

Replace the attribute in `media` at `idx` with `attr` .

#### Parameters

media | a GstSDPMedia |
idx | an index |
attr | a GstSDPAttribute |

#### Returns

GST_SDP_OK.

Since: 1.2

### gst_sdp_media_remove_attribute ()

    GstSDPResult
    gst_sdp_media_remove_attribute (GstSDPMedia *media,
                                    guint idx);

Remove the attribute in `media` at `idx` .

#### Parameters

media | a GstSDPMedia |
idx | an index |

#### Returns

GST_SDP_OK.

Since: 1.2

### gst_sdp_media_add_attribute ()

    GstSDPResult
    gst_sdp_media_add_attribute (GstSDPMedia *media,
                                 const gchar *key,
                                 const gchar *value);

Add the attribute with `key` and `value` to `media` .

#### Parameters

media | a GstSDPMedia |
key | a key |
value | a value |

#### Returns

GST_SDP_OK.

### gst_sdp_media_get_caps_from_media ()

    GstCaps *
    gst_sdp_media_get_caps_from_media (const GstSDPMedia *media,
                                       gint pt);

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

media | a GstSDPMedia |
pt | a payload type |

#### Returns

a GstCaps, or `NULL` if an error happened

Since: 1.8

### gst_sdp_media_set_media_from_caps ()

    GstSDPResult
    gst_sdp_media_set_media_from_caps (const GstCaps *caps,
                                       GstSDPMedia *media);

Mapping of caps to SDP fields:

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

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

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

a=rtcp-fb:(payload) (param1) [param2]...

#### Parameters

caps | a GstCaps |
media | a GstSDPMedia |

#### Returns

a GstSDPResult.

Since: 1.8

### gst_sdp_make_keymgmt ()

    gchar *
    gst_sdp_make_keymgmt (const gchar *uri,
                          const gchar *base64);

Makes key management data

#### Parameters

uri | a gchar URI |
base64 | a gchar base64-encoded key data |

#### Returns

a gchar key-mgmt data,.

[transfer full]

Since: 1.8

### gst_sdp_message_attributes_to_caps ()

    GstSDPResult
    gst_sdp_message_attributes_to_caps (const GstSDPMessage *msg,
                                        GstCaps *caps);

Mapping of attributes of GstSDPMessage to GstCaps

#### Parameters

msg | a GstSDPMessage |
caps | a GstCaps |

#### Returns

a GstSDPResult.

Since: 1.8

### gst_sdp_media_attributes_to_caps ()

    GstSDPResult
    gst_sdp_media_attributes_to_caps (const GstSDPMedia *media,
                                      GstCaps *caps);

Mapping of attributes of GstSDPMedia to GstCaps

#### Parameters

media | a GstSDPMedia |
caps | a GstCaps |

#### Returns

a GstSDPResult.

Since: 1.8

## Types and Values

### enum GstSDPResult

Return values for the SDP functions.

#### Members

GST_SDP_OK | A successful return value |
GST_SDP_EINVAL | a function was given invalid parameters |

### GstSDPOrigin

    typedef struct {
      gchar *username;
      gchar *sess_id;
      gchar *sess_version;
      gchar *nettype;
      gchar *addrtype;
      gchar *addr;
    } GstSDPOrigin;

The contents of the SDP "o=" field which gives the originator of the session (their username and the address of the user's host) plus a session id and session version number.

#### Members

gchar *`username`; | the user's login on the originating host, or it is "-" if the originating host does not support the concept of user ids. |
gchar *`sess_id`; | is a numeric string such that the tuple of `username` , `sess_id` , `nettype` , `addrtype` and `addr` form a globally unique identifier for the session. |
gchar *`sess_version`; | a version number for this announcement |
gchar *`nettype`; | the type of network. "IN" is defined to have the meaning "Internet". |
gchar *`addrtype`; | the type of `addr` . |
gchar *`addr`; | the globally unique address of the machine from which the session was created. |

### GstSDPConnection

    typedef struct {
      gchar *nettype;
      gchar *addrtype;
      gchar *address;
      guint  ttl;
      guint  addr_number;
    } GstSDPConnection;

The contents of the SDP "c=" field which contains connection data.

#### Members

gchar *`nettype`; | the type of network. "IN" is defined to have the meaning "Internet". |
gchar *`addrtype`; | the type of `address` . |
gchar *`address`; | the address |
guint `ttl`; | the time to live of the address |
guint `addr_number`; | the number of layers |

### GST_SDP_BWTYPE_CT

    #define GST_SDP_BWTYPE_CT               "CT"

The Conference Total bandwidth modifier.

### GST_SDP_BWTYPE_AS

    #define GST_SDP_BWTYPE_AS               "AS"

The Application-Specific Maximum bandwidth modifier.

### GST_SDP_BWTYPE_EXT_PREFIX

    #define GST_SDP_BWTYPE_EXT_PREFIX       "X-"

The extension prefix bandwidth modifier.

### GST_SDP_BWTYPE_RR

    #define GST_SDP_BWTYPE_RR               "RR"

RTCP bandwidth allocated to data receivers (RFC 3556).

### GST_SDP_BWTYPE_RS

    #define GST_SDP_BWTYPE_RS               "RS"

RTCP bandwidth allocated to active data senders (RFC 3556).

### GST_SDP_BWTYPE_TIAS

    #define GST_SDP_BWTYPE_TIAS             "TIAS"

Transport Independent Application Specific Maximum bandwidth (RFC 3890).

### GstSDPBandwidth

    typedef struct {
      gchar *bwtype;
      guint  bandwidth;
    } GstSDPBandwidth;

The contents of the SDP "b=" field which specifies the proposed bandwidth to be used by the session or media.

#### Members

gchar *`bwtype`; | the bandwidth modifier type |
guint `bandwidth`; | the bandwidth in kilobits per second |

### GstSDPTime

    typedef struct {
      gchar  *start;
      gchar  *stop;
      GArray *repeat;
    } GstSDPTime;

The contents of the SDP "t=" field which specify the start and stop times for a conference session.

#### Members

gchar *`start`; | start time for the conference. The value is the decimal representation of Network Time Protocol (NTP) time values in seconds |
gchar *`stop`; | stop time for the conference. The value is the decimal representation of Network Time Protocol (NTP) time values in seconds |
GArray *`repeat`; | repeat times for a session |

### GstSDPZone

    typedef struct {
      gchar *time;
      gchar *typed_time;
    } GstSDPZone;

The contents of the SDP "z=" field which allows the sender to specify a list of time zone adjustments and offsets from the base time.

#### Members

gchar *`time`; | the NTP time that a time zone adjustment happens |
gchar *`typed_time`; | the offset from the time when the session was first scheduled |

### GstSDPKey

    typedef struct {
      gchar *type;
      gchar *data;
    } GstSDPKey;

The contents of the SDP "k=" field which is used to convey encryption keys.

#### Members

gchar *`type`; | the encryption type |
gchar *`data`; | the encryption data |

### GstSDPAttribute

    typedef struct {
      gchar *key;
      gchar *value;
    } GstSDPAttribute;

The contents of the SDP "a=" field which contains a key/value pair.

#### Members

gchar *`key`; | the attribute key |
gchar *`value`; | the attribute value or NULL when it was a property attribute |

### GstSDPMedia

    typedef struct {
      gchar            *media;
      guint             port;
      guint             num_ports;
      gchar            *proto;
      GArray           *fmts;
      gchar            *information;
      GArray           *connections;
      GArray           *bandwidths;
      GstSDPKey         key;
      GArray           *attributes;
    } GstSDPMedia;

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

#### Members

gchar *`media`; | the media type |
guint `port`; | the transport port to which the media stream will be sent |
guint `num_ports`; | the number of ports or -1 if only one port was specified |
gchar *`proto`; | the transport protocol |
GArray *`fmts`; | an array of gchar formats |
gchar *`information`; | the media title |
GArray *`connections`; | array of GstSDPConnection with media connection information |
GArray *`bandwidths`; | array of GstSDPBandwidth with media bandwidth information |
GstSDPKey `key`; | the encryption key |
GArray *`attributes`; | array of GstSDPAttribute with the additional media attributes |

### GstSDPMessage

    typedef struct {
      gchar            *version;
      GstSDPOrigin      origin;
      gchar            *session_name;
      gchar            *information;
      gchar            *uri;
      GArray           *emails;
      GArray           *phones;
      GstSDPConnection  connection;
      GArray           *bandwidths;
      GArray           *times;
      GArray           *zones;
      GstSDPKey         key;
      GArray           *attributes;
      GArray           *medias;
    } GstSDPMessage;

The contents of the SDP message.

#### Members

gchar *`version`; | the protocol version |
GstSDPOrigin `origin`; | owner/creator and session identifier |
gchar *`session_name`; | session name |
gchar *`information`; | session information |
gchar *`uri`; | URI of description |
GArray *`emails`; | array of gchar with email addresses |
GArray *`phones`; | array of gchar with phone numbers |
GstSDPConnection `connection`; | connection information for the session |
GArray *`bandwidths`; | array of GstSDPBandwidth with bandwidth information |
GArray *`times`; | array of GstSDPTime with time descriptions |
GArray *`zones`; | array of GstSDPZone with time zone adjustments |
GstSDPKey `key`; | encryption key |
GArray *`attributes`; | array of GstSDPAttribute with session attributes |
GArray *`medias`; | array of GstSDPMedia with media descriptions |