GstSdp.SDPMessage¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
attributes |
[ |
r/w |
array of |
bandwidths |
[ |
r/w |
array of |
connection |
r/w |
connection information for the session |
|
emails |
[ |
r/w |
array of |
information |
r/w |
session information |
|
key |
r/w |
encryption key |
|
medias |
[ |
r/w |
array of |
origin |
r/w |
owner/creator and session identifier |
|
phones |
[ |
r/w |
array of |
session_name |
r/w |
session name |
|
times |
[ |
r/w |
array of |
uri |
r/w |
URI of description |
|
version |
r/w |
the protocol version |
|
zones |
[ |
r/w |
array of |
Methods¶
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class GstSdp.SDPMessage¶
The
GstSdp.SDPMessage
helper functions makes it easy to parse and create SDP messages.- classmethod as_uri(scheme, msg)[source]¶
- Parameters:
scheme (
str
) – the uri schememsg (
GstSdp.SDPMessage
) – theGstSdp.SDPMessage
- Returns:
a uri for msg.
- Return type:
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.
- classmethod init()[source]¶
- Returns:
-
- msg:
- Return type:
(
GstSdp.SDPResult
, msg:GstSdp.SDPMessage
)
Initialize msg so that its contents are as if it was freshly allocated with
GstSdp.SDPMessage.new
(). This function is mostly used to initialize a message allocated on the stack.GstSdp.SDPMessage.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.
- classmethod new()[source]¶
- Returns:
-
- msg:
pointer to new
GstSdp.SDPMessage
- Return type:
(
GstSdp.SDPResult
, msg:GstSdp.SDPMessage
)
Allocate a new
GstSdp.SDPMessage
and store the result in msg.
- classmethod new_from_text(text)[source]¶
- Parameters:
text (
str
) – A dynamically allocated string representing the SDP description- Returns:
-
- msg:
pointer to new
GstSdp.SDPMessage
- Return type:
(
GstSdp.SDPResult
, msg:GstSdp.SDPMessage
)
Parse text and create a new SDPMessage from these.
New in version 1.16.
- classmethod parse_buffer(data, msg)[source]¶
- Parameters:
data (
bytes
) – the start of the buffermsg (
GstSdp.SDPMessage
) – the resultGstSdp.SDPMessage
- Returns:
GstSdp.SDPResult.OK
on success.- Return type:
Parse the contents of size bytes pointed to by data and store the result in msg.
- classmethod parse_uri(uri, msg)[source]¶
- Parameters:
uri (
str
) – the start of the urimsg (
GstSdp.SDPMessage
) – the resultGstSdp.SDPMessage
- Returns:
GstSdp.SDPResult.OK
on success.- Return type:
Parse the null-terminated uri and store the result in msg.
The uri should be of the form:
scheme://[address’:ttl=ttl [:noa=noa]’]/’sessionname [#type=value *[&type=value]’]
where value is url encoded. This looslely resembles http://tools.ietf.org/html/draft-fujikawa-sdp-url-01
- add_attribute(key, value)[source]¶
- Parameters:
- Returns:
- Return type:
Add the attribute with key and value to self.
- add_bandwidth(bwtype, bandwidth)[source]¶
- Parameters:
- Returns:
- Return type:
Add the specified bandwidth information to self.
- add_email(email)[source]¶
- Parameters:
email (
str
) – an email- Returns:
- Return type:
Add email to the list of emails in self.
- add_media(media)[source]¶
- Parameters:
media (
GstSdp.SDPMedia
) – aGstSdp.SDPMedia
to add- Returns:
- Return type:
Adds media to the array of medias in self. This function takes ownership of the contents of media so that media will have to be reinitialized with
GstSdp.SDPMedia.init
() before it can be used again.
- add_phone(phone)[source]¶
- Parameters:
phone (
str
) – a phone- Returns:
- Return type:
Add phone to the list of phones in self.
- add_time(start, stop, repeat)[source]¶
- Parameters:
- Returns:
- Return type:
Add time information start and stop to self.
- add_zone(adj_time, typed_time)[source]¶
- Parameters:
- Returns:
- Return type:
Add time zone information to self.
- as_text()[source]¶
- Returns:
A dynamically allocated string representing the SDP description.
- Return type:
Convert the contents of self to a text string.
- attributes_len()[source]¶
- Returns:
the number of attributes in self.
- Return type:
Get the number of attributes in self.
- attributes_to_caps(caps)[source]¶
- Parameters:
- Returns:
- Return type:
Mapping of attributes of
GstSdp.SDPMessage
toGst.Caps
New in version 1.8.
- bandwidths_len()[source]¶
- Returns:
the number of bandwidth information in self.
- Return type:
Get the number of bandwidth information in self.
- copy()[source]¶
- Returns:
-
- copy:
pointer to new
GstSdp.SDPMessage
- Return type:
(
GstSdp.SDPResult
, copy:GstSdp.SDPMessage
)
Allocate a new copy of self and store the result in copy. The value in copy should be release with
GstSdp.SDPMessage.free
function.New in version 1.2.
- emails_len()[source]¶
- Returns:
the number of emails in self.
- Return type:
Get the number of emails in self.
- free()[source]¶
- Returns:
- Return type:
Free all resources allocated by self. self should not be used anymore after this function. This function should be used when self was dynamically allocated with
GstSdp.SDPMessage.new
().
- get_attribute(idx)[source]¶
- Parameters:
idx (
int
) – the index- Returns:
the
GstSdp.SDPAttribute
at position idx.- Return type:
Get the attribute at position idx in self.
- get_attribute_val(key)[source]¶
- Parameters:
key (
str
) – the key- Returns:
the attribute value of the first attribute with key.
- Return type:
Get the first attribute with key key in self.
- get_attribute_val_n(key, nth)[source]¶
- Parameters:
- Returns:
the attribute value of the nth attribute with key.
- Return type:
Get the nth attribute with key key in self.
- get_bandwidth(idx)[source]¶
- Parameters:
idx (
int
) – the bandwidth index- Returns:
- Return type:
Get the bandwidth at index idx from self.
- get_connection()[source]¶
- Returns:
a
GstSdp.SDPConnection
. The result remains valid as long as self is valid.- Return type:
Get the connection of self.
- get_media(idx)[source]¶
- Parameters:
idx (
int
) – the index- Returns:
- Return type:
Get the media description at index idx in self.
- get_origin()[source]¶
- Returns:
a
GstSdp.SDPOrigin
. The result remains valid as long as self is valid.- Return type:
Get the origin of self.
- get_time(idx)[source]¶
- Parameters:
idx (
int
) – the time index- Returns:
- Return type:
Get time information with index idx from self.
- get_zone(idx)[source]¶
- Parameters:
idx (
int
) – the zone index- Returns:
- Return type:
Get time zone information with index idx from self.
- insert_attribute(idx, attr)[source]¶
- Parameters:
idx (
int
) – an indexattr (
GstSdp.SDPAttribute
) – aGstSdp.SDPAttribute
- Returns:
- Return type:
Insert attribute into the array of attributes in self at index idx. When -1 is given as idx, the attribute is inserted at the end.
New in version 1.2.
- insert_bandwidth(idx, bw)[source]¶
- Parameters:
idx (
int
) – an indexbw (
GstSdp.SDPBandwidth
) – the bandwidth
- Returns:
- Return type:
Insert bandwidth parameters into the array of bandwidths in self at index idx. When -1 is given as idx, the bandwidth is inserted at the end.
New in version 1.2.
- insert_email(idx, email)[source]¶
- Parameters:
- Returns:
- Return type:
Insert email into the array of emails in self at index idx. When -1 is given as idx, the email is inserted at the end.
New in version 1.2.
- insert_phone(idx, phone)[source]¶
- Parameters:
- Returns:
- Return type:
Insert phone into the array of phone numbers in self at index idx. When -1 is given as idx, the phone is inserted at the end.
New in version 1.2.
- insert_time(idx, t)[source]¶
- Parameters:
idx (
int
) – an indext (
GstSdp.SDPTime
) – aGstSdp.SDPTime
- Returns:
- Return type:
Insert time parameters into the array of times in self at index idx. When -1 is given as idx, the times are inserted at the end.
New in version 1.2.
- insert_zone(idx, zone)[source]¶
- Parameters:
idx (
int
) – an indexzone (
GstSdp.SDPZone
) – aGstSdp.SDPZone
- Returns:
- Return type:
Insert zone parameters into the array of zones in self at index idx. When -1 is given as idx, the zone is inserted at the end.
New in version 1.2.
- medias_len()[source]¶
- Returns:
the number of media descriptions in self.
- Return type:
Get the number of media descriptions in self.
- parse_keymgmt()[source]¶
- Returns:
-
- mikey:
pointer to new
GstSdp.MIKEYMessage
- Return type:
(
GstSdp.SDPResult
, mikey:GstSdp.MIKEYMessage
)
Creates a new
GstSdp.MIKEYMessage
after parsing the key-mgmt attribute from aGstSdp.SDPMessage
.New in version 1.8.1.
- phones_len()[source]¶
- Returns:
the number of phones in self.
- Return type:
Get the number of phones in self.
- remove_attribute(idx)[source]¶
- Parameters:
idx (
int
) – the index- Returns:
- Return type:
Remove the attribute in self at index idx.
New in version 1.2.
- remove_bandwidth(idx)[source]¶
- Parameters:
idx (
int
) – the bandwidth index- Returns:
- Return type:
Remove the bandwidth information in self at index idx.
New in version 1.2.
- remove_email(idx)[source]¶
- Parameters:
idx (
int
) – an email index- Returns:
- Return type:
Remove the email in self at index idx.
New in version 1.2.
- remove_media(idx)[source]¶
- Parameters:
idx (
int
) – the media index- Returns:
GstSdp.SDPResult.OK
when the specified media is found at idx and removed,GstSdp.SDPResult.EINVAL
otherwise.- Return type:
Remove the media at idx from the array of medias in self if found.
New in version 1.24.
- remove_phone(idx)[source]¶
- Parameters:
idx (
int
) – a phone index- Returns:
- Return type:
Remove the phone number in self at index idx.
New in version 1.2.
- remove_time(idx)[source]¶
- Parameters:
idx (
int
) – the index- Returns:
- Return type:
Remove the time information in self at index idx.
New in version 1.2.
- remove_zone(idx)[source]¶
- Parameters:
idx (
int
) – the index- Returns:
- Return type:
Remove the zone information in self at index idx.
New in version 1.2.
- replace_attribute(idx, attr)[source]¶
- Parameters:
idx (
int
) – the indexattr (
GstSdp.SDPAttribute
) – aGstSdp.SDPAttribute
- Returns:
- Return type:
Replace the attribute in self at index idx with attr.
New in version 1.2.
- replace_bandwidth(idx, bw)[source]¶
- Parameters:
idx (
int
) – the bandwidth indexbw (
GstSdp.SDPBandwidth
) – the bandwidth
- Returns:
- Return type:
Replace the bandwidth information in self at index idx with bw.
New in version 1.2.
- replace_email(idx, email)[source]¶
- Parameters:
- Returns:
- Return type:
Replace the email in self at index idx with email.
New in version 1.2.
- replace_phone(idx, phone)[source]¶
- Parameters:
- Returns:
- Return type:
Replace the phone number in self at index idx with phone.
New in version 1.2.
- replace_time(idx, t)[source]¶
- Parameters:
idx (
int
) – the indext (
GstSdp.SDPTime
) – aGstSdp.SDPTime
- Returns:
- Return type:
Replace the time information in self at index idx with t.
New in version 1.2.
- replace_zone(idx, zone)[source]¶
- Parameters:
idx (
int
) – the indexzone (
GstSdp.SDPZone
) – aGstSdp.SDPZone
- Returns:
- Return type:
Replace the zone information in self at index idx with zone.
New in version 1.2.
- set_connection(nettype, addrtype, address, ttl, addr_number)[source]¶
- Parameters:
- Returns:
- Return type:
Configure the SDP connection in self with the given parameters.
- set_information(information)[source]¶
- Parameters:
information (
str
) – the information- Returns:
- Return type:
Set the information in self.
- set_key(type, data)[source]¶
- Parameters:
- Returns:
- Return type:
Adds the encryption information to self.
- set_origin(username, sess_id, sess_version, nettype, addrtype, addr)[source]¶
- Parameters:
- Returns:
- Return type:
Configure the SDP origin in self with the given parameters.
- set_session_name(session_name)[source]¶
- Parameters:
session_name (
str
) – the session name- Returns:
- Return type:
Set the session name in self.
- set_version(version)[source]¶
- Parameters:
version (
str
) – the version- Returns:
- Return type:
Set the version in self.
- times_len()[source]¶
- Returns:
the number of time information entries in self.
- Return type:
Get the number of time information entries in self.
- uninit()[source]¶
- Returns:
- Return type:
Free all resources allocated in self. self should not be used anymore after this function. This function should be used when self was allocated on the stack and initialized with
GstSdp.SDPMessage.init
().