GstSdp.SDPMedia¶
Fields¶
| Name | Type | Access | Description | 
|---|---|---|---|
| attributes | [ object] | r/w | array of GstSdp.SDPAttributewith the additional media attributes | 
| bandwidths | [ object] | r/w | array of GstSdp.SDPBandwidthwith media bandwidth information | 
| connections | [ object] | r/w | array of GstSdp.SDPConnectionwith media connection information | 
| fmts | [ object] | r/w | an array of strformats | 
| information | str | r/w | the media title | 
| key | GstSdp.SDPKey | r/w | the encryption key | 
| media | str | r/w | the media type | 
| num_ports | int | r/w | the number of ports or -1 if only one port was specified | 
| port | int | r/w | the transport port to which the media stream will be sent | 
| proto | str | r/w | the transport protocol | 
Methods¶
Details¶
- 
class GstSdp.SDPMedia¶
- The contents of the SDP “m=” field with all related fields. - 
classmethod new()[source]¶
- Returns: - a - GstSdp.SDPResult.- media: - pointer to new - GstSdp.SDPMedia- Return type: - ( - GstSdp.SDPResult, media:- GstSdp.SDPMedia)- Allocate a new - GstSdp.SDPMediaand store the result in media.
 - 
classmethod set_media_from_caps(caps, media)[source]¶
- Parameters: - caps (Gst.Caps) – aGst.Caps
- media (GstSdp.SDPMedia) – aGstSdp.SDPMedia
 - Returns: - Return type: - 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. 
- caps (
 - 
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: - GstSdp.SDPResult.OK.- Return type: - GstSdp.SDPResult- Add the format information to self. 
 - 
as_text()[source]¶
- Returns: - A dynamically allocated string representing the media. - Return type: - str- Convert the contents of self to a text string. 
 - 
attributes_len()[source]¶
- Returns: - the number of attributes in self. - Return type: - int- Get the number of attribute fields in self. 
 - 
attributes_to_caps(caps)[source]¶
- Parameters: - caps ( - Gst.Caps) – a- Gst.Caps- Returns: - a - GstSdp.SDPResult.- Return type: - GstSdp.SDPResult- Mapping of attributes of - GstSdp.SDPMediato- Gst.Caps- New in version 1.8. 
 - 
bandwidths_len()[source]¶
- Returns: - the number of bandwidths in self. - Return type: - int- Get the number of bandwidth fields in self. 
 - 
connections_len()[source]¶
- Returns: - the number of connections in self. - Return type: - int- Get the number of connection fields in self. 
 - 
copy()[source]¶
- Returns: - a - GstSdp.SDPResult- 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.freefunction.- New in version 1.2. 
 - 
formats_len()[source]¶
- Returns: - the number of formats in self. - Return type: - int- Get the number of formats in self. 
 - 
free()[source]¶
- Returns: - a - GstSdp.SDPResult.- Return type: - GstSdp.SDPResult- 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.SDPAttributeat position idx.- Return type: - GstSdp.SDPAttribute- Get the attribute at position idx in self. 
 - 
get_attribute_val(key)[source]¶
- Parameters: - key ( - str) – a key- Returns: - the first attribute value for key. - Return type: - str- Get the first attribute value for key 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.SDPBandwidthat position idx.- Return type: - GstSdp.SDPBandwidth- Get the bandwidth at position idx in self. 
 - 
get_caps_from_media(pt)[source]¶
- Parameters: - pt ( - int) – a payload type- Returns: - a - Gst.Caps, or- Noneif an error happened- Return type: - Gst.Caps- 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 attribute is 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.SDPConnectionat position idx.- Return type: - GstSdp.SDPConnection- Get the connection at position idx in self. 
 - 
get_format(idx)[source]¶
- Parameters: - idx ( - int) – an index- Returns: - the format at position idx. - Return type: - str- Get the format information at position idx in self. 
 - 
get_information()[source]¶
- Returns: - the information of self. - Return type: - str- Get the information of self 
 - 
get_key()[source]¶
- Returns: - a - GstSdp.SDPKey.- Return type: - GstSdp.SDPKey- Get the encryption information from self. 
 - 
get_media()[source]¶
- Returns: - the media description. - Return type: - str- Get the media description of self. 
 - 
get_num_ports()[source]¶
- Returns: - the number of ports for self. - Return type: - int- Get the number of ports for self. 
 - 
get_proto()[source]¶
- Returns: - the transport protocol of self. - Return type: - str- Get the transport protocol of self 
 - 
init()[source]¶
- Returns: - a - GstSdp.SDPResult.- Return type: - GstSdp.SDPResult- Initialize self 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. 
 - 
insert_attribute(idx, attr)[source]¶
- Parameters: - idx (int) – an index
- attr (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. 
- idx (
 - 
insert_bandwidth(idx, bw)[source]¶
- Parameters: - idx (int) – an index
- bw (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. 
- idx (
 - 
insert_connection(idx, conn)[source]¶
- Parameters: - idx (int) – an index
- conn (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. 
- idx (
 - 
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: - a - GstSdp.SDPResult.- mikey: - pointer to new - GstSdp.MIKEYMessage- Return type: - ( - GstSdp.SDPResult, mikey:- GstSdp.MIKEYMessage)- Creates a new - GstSdp.MIKEYMessageafter parsing the key-mgmt attribute from a- GstSdp.SDPMedia.- New in version 1.8.1. 
 - 
remove_attribute(idx)[source]¶
- Parameters: - idx ( - int) – an index- Returns: - GstSdp.SDPResult.OK.- Return type: - GstSdp.SDPResult- Remove the attribute in self at idx. - New in version 1.2. 
 - 
remove_bandwidth(idx)[source]¶
- Parameters: - idx ( - int) – an index- Returns: - GstSdp.SDPResult.OK.- Return type: - GstSdp.SDPResult- Remove the bandwidth information in self at idx. - New in version 1.2. 
 - 
remove_connection(idx)[source]¶
- Parameters: - idx ( - int) – an index- Returns: - GstSdp.SDPResult.OK.- Return type: - GstSdp.SDPResult- Remove the connection information in self at idx. - New in version 1.2. 
 - 
remove_format(idx)[source]¶
- Parameters: - idx ( - int) – an index- Returns: - GstSdp.SDPResult.OK.- Return type: - GstSdp.SDPResult- Remove the format information in self at idx. - New in version 1.2. 
 - 
replace_attribute(idx, attr)[source]¶
- Parameters: - idx (int) – an index
- attr (GstSdp.SDPAttribute) – aGstSdp.SDPAttribute
 - Returns: - Return type: - Replace the attribute in self at idx with attr. - New in version 1.2. 
- idx (
 - 
replace_bandwidth(idx, bw)[source]¶
- Parameters: - idx (int) – an index
- bw (GstSdp.SDPBandwidth) – aGstSdp.SDPBandwidth
 - Returns: - Return type: - Replace the bandwidth information in self at idx with bw. - New in version 1.2. 
- idx (
 - 
replace_connection(idx, conn)[source]¶
- Parameters: - idx (int) – an index
- conn (GstSdp.SDPConnection) – aGstSdp.SDPConnection
 - Returns: - Return type: - Replace the connection information in self at idx with conn. - New in version 1.2. 
- idx (
 - 
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: - GstSdp.SDPResult.OK.- Return type: - GstSdp.SDPResult- 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: - GstSdp.SDPResult.OK.- Return type: - GstSdp.SDPResult- 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: - GstSdp.SDPResult.OK.- Return type: - GstSdp.SDPResult- Set the media transport protocol of self to proto. 
 - 
uninit()[source]¶
- Returns: - a - GstSdp.SDPResult.- Return type: - GstSdp.SDPResult- 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().
 
- 
classmethod