GstSdp.SDPMedia¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
attributes |
[ |
r/w |
array of |
bandwidths |
[ |
r/w |
array of |
connections |
[ |
r/w |
array of |
fmts |
[ |
r/w |
an array of |
information |
r/w |
the media title |
|
key |
r/w |
the encryption key |
|
media |
r/w |
the media type |
|
num_ports |
r/w |
the number of ports or -1 if only one port was specified |
|
port |
r/w |
the transport port to which the media stream will be sent |
|
proto |
r/w |
the transport protocol |
Methods¶
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class GstSdp.SDPMedia¶
The contents of the SDP “m=” field with all related fields.
- classmethod init()[source]¶
- Returns:
-
- media:
- Return type:
(
GstSdp.SDPResult
, media:GstSdp.SDPMedia
)
Initialize media so that its contents are as if it was freshly allocated with
GstSdp.SDPMedia.new
(). This function is mostly used to initialize a media allocated on the stack.GstSdp.SDPMedia.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:
-
- media:
pointer to new
GstSdp.SDPMedia
- Return type:
(
GstSdp.SDPResult
, media:GstSdp.SDPMedia
)
Allocate a new
GstSdp.SDPMedia
and store the result in media.
- classmethod set_media_from_caps(caps)[source]¶
- Parameters:
- Returns:
-
- media:
- Return type:
(
GstSdp.SDPResult
, media:GstSdp.SDPMedia
)
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]…
a=extmap:(id)[/direction] (extensionname) (extensionattributes)
New in version 1.8.
- 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 bandwidth information with bwtype and bandwidth to self.
- add_connection(nettype, addrtype, address, ttl, addr_number)[source]¶
- Parameters:
- Returns:
- Return type:
Add the given connection parameters to self.
- add_format(format)[source]¶
- Parameters:
format (
str
) – the format- Returns:
- Return type:
Add the format information to self.
- as_text()[source]¶
- Returns:
A dynamically allocated string representing the media.
- 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 attribute fields in self.
- attributes_to_caps(caps)[source]¶
- Parameters:
- Returns:
- Return type:
Mapping of attributes of
GstSdp.SDPMedia
toGst.Caps
New in version 1.8.
- bandwidths_len()[source]¶
- Returns:
the number of bandwidths in self.
- Return type:
Get the number of bandwidth fields in self.
- connections_len()[source]¶
- Returns:
the number of connections in self.
- Return type:
Get the number of connection fields in self.
- copy()[source]¶
- Returns:
-
- copy:
pointer to new
GstSdp.SDPMedia
- Return type:
(
GstSdp.SDPResult
, copy:GstSdp.SDPMedia
)
Allocate a new copy of self and store the result in copy. The value in copy should be release with
GstSdp.SDPMedia.free
function.New in version 1.2.
- formats_len()[source]¶
- Returns:
the number of formats in self.
- Return type:
Get the number of formats 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.SDPMedia.new
().
- get_attribute(idx)[source]¶
- Parameters:
idx (
int
) – an index- Returns:
the
GstSdp.SDPAttribute
at position idx.- Return type:
Get the attribute at position idx in self.
- get_attribute_val_n(key, nth)[source]¶
- Parameters:
- Returns:
the nth attribute value.
- Return type:
Get the nth attribute value for key in self.
- get_bandwidth(idx)[source]¶
- Parameters:
idx (
int
) – an index- Returns:
the
GstSdp.SDPBandwidth
at position idx.- Return type:
Get the bandwidth at position idx in self.
- get_caps_from_media(pt)[source]¶
- Parameters:
pt (
int
) – a payload type- Returns:
- Return type:
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)];…
Note that the extmap, ssrc and rid attributes are set only by
GstSdp.SDPMedia.attributes_to_caps
().New in version 1.8.
- get_connection(idx)[source]¶
- Parameters:
idx (
int
) – an index- Returns:
the
GstSdp.SDPConnection
at position idx.- Return type:
Get the connection at position idx in self.
- get_information()[source]¶
- Returns:
the information of self.
- Return type:
Get the information of self
- get_media()[source]¶
- Returns:
the media description.
- Return type:
Get the media description of self.
- get_num_ports()[source]¶
- Returns:
the number of ports for self.
- Return type:
Get the number of ports for self.
- get_proto()[source]¶
- Returns:
the transport protocol of self.
- Return type:
Get the transport protocol of self
- insert_attribute(idx, attr)[source]¶
- Parameters:
idx (
int
) – an indexattr (
GstSdp.SDPAttribute
) – aGstSdp.SDPAttribute
- Returns:
- Return type:
Insert the attribute to self at idx. When idx is -1, the attribute is appended.
New in version 1.2.
- insert_bandwidth(idx, bw)[source]¶
- Parameters:
idx (
int
) – an indexbw (
GstSdp.SDPBandwidth
) – aGstSdp.SDPBandwidth
- Returns:
- Return type:
Insert the bandwidth information to self at idx. When idx is -1, the bandwidth is appended.
New in version 1.2.
- insert_connection(idx, conn)[source]¶
- Parameters:
idx (
int
) – an indexconn (
GstSdp.SDPConnection
) – aGstSdp.SDPConnection
- Returns:
- Return type:
Insert the connection information to self at idx. When idx is -1, the connection is appended.
New in version 1.2.
- insert_format(idx, format)[source]¶
- Parameters:
- Returns:
- Return type:
Insert the format information to self at idx. When idx is -1, the format is appended.
New in version 1.2.
- 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.SDPMedia
.New in version 1.8.1.
- remove_attribute(idx)[source]¶
- Parameters:
idx (
int
) – an index- Returns:
- Return type:
Remove the attribute in self at idx.
New in version 1.2.
- remove_bandwidth(idx)[source]¶
- Parameters:
idx (
int
) – an index- Returns:
- Return type:
Remove the bandwidth information in self at idx.
New in version 1.2.
- remove_connection(idx)[source]¶
- Parameters:
idx (
int
) – an index- Returns:
- Return type:
Remove the connection information in self at idx.
New in version 1.2.
- remove_format(idx)[source]¶
- Parameters:
idx (
int
) – an index- Returns:
- Return type:
Remove the format information in self at idx.
New in version 1.2.
- replace_attribute(idx, attr)[source]¶
- Parameters:
idx (
int
) – an indexattr (
GstSdp.SDPAttribute
) – aGstSdp.SDPAttribute
- Returns:
- Return type:
Replace the attribute in self at idx with attr.
New in version 1.2.
- replace_bandwidth(idx, bw)[source]¶
- Parameters:
idx (
int
) – an indexbw (
GstSdp.SDPBandwidth
) – aGstSdp.SDPBandwidth
- Returns:
- Return type:
Replace the bandwidth information in self at idx with bw.
New in version 1.2.
- replace_connection(idx, conn)[source]¶
- Parameters:
idx (
int
) – an indexconn (
GstSdp.SDPConnection
) – aGstSdp.SDPConnection
- Returns:
- Return type:
Replace the connection information in self at idx with conn.
New in version 1.2.
- replace_format(idx, format)[source]¶
- Parameters:
- Returns:
- Return type:
Replace the format information in self at idx with format.
New in version 1.2.
- set_information(information)[source]¶
- Parameters:
information (
str
) – the media information- Returns:
- Return type:
Set the media information of self to information.
- set_key(type, data)[source]¶
- Parameters:
- Returns:
- Return type:
Adds the encryption information to self.
- set_media(med)[source]¶
- Parameters:
med (
str
) – the media description- Returns:
- Return type:
Set the media description of self to med.
- set_port_info(port, num_ports)[source]¶
- Parameters:
- Returns:
- Return type:
Set the port information in self.
- set_proto(proto)[source]¶
- Parameters:
proto (
str
) – the media transport protocol- Returns:
- Return type:
Set the media transport protocol of self to proto.
- 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.SDPMedia.init
().