GstRtsp.RTSPMessage¶
Fields¶
| Name | Type | Access | Description | 
|---|---|---|---|
| body | int | r | |
| body_buffer | Gst.Buffer | r | |
| body_size | int | r | |
| hdr_fields | [ object] | r | |
| type | GstRtsp.RTSPMsgType | r/w | the message type | 
Methods¶
| add_header(field, value) | |
| add_header_by_name(header, value) | |
| append_headers(str) | |
| copy() | |
| dump() | |
| free() | |
| get_body() | |
| get_body_buffer() | |
| get_header(field, indx) | |
| get_header_by_name(header, index) | |
| get_type() | |
| has_body_buffer() | |
| init() | |
| init_data(channel) | |
| init_request(method, uri) | |
| init_response(code, reason, request) | |
| parse_auth_credentials(field) | |
| parse_data() | |
| parse_request() | |
| parse_response() | |
| remove_header(field, indx) | |
| remove_header_by_name(header, index) | |
| set_body(data) | |
| set_body_buffer(buffer) | |
| steal_body() | |
| steal_body_buffer() | |
| take_body(data) | |
| take_body_buffer(buffer) | |
| take_header(field, value) | |
| take_header_by_name(header, value) | |
| unset() | 
Details¶
- 
class GstRtsp.RTSPMessage¶
- Provides methods for creating and parsing - GstRtsp.request,- GstRtsp.responseand- GstRtsp.datamessages.- 
add_header(field, value)[source]¶
- Parameters: - field (GstRtsp.RTSPHeaderField) – aGstRtsp.RTSPHeaderField
- value (str) – the value of the header
 - Returns: - Return type: - Add a header with key field and value to self. This function takes a copy of value. 
- field (
 - 
add_header_by_name(header, value)[source]¶
- Parameters: - Returns: - Return type: - Add a header with key header and value to self. This function takes a copy of value. - New in version 1.6. 
 - 
append_headers(str)[source]¶
- Parameters: - str ( - GLib.String) – a string- Returns: - GstRtsp.RTSPResult.OK.- Return type: - GstRtsp.RTSPResult- Append the currently configured headers in self to the - GLib.Stringstr suitable for transmission.
 - 
copy()[source]¶
- Returns: - a - GstRtsp.RTSPResult- copy: - pointer to new - GstRtsp.RTSPMessage- Return type: - ( - GstRtsp.RTSPResult, copy:- GstRtsp.RTSPMessage)- Allocate a new copy of self and store the result in copy. The value in copy should be release with - GstRtsp.RTSPMessage.freefunction.- New in version 1.14. 
 - 
dump()[source]¶
- Returns: - GstRtsp.RTSPResult.OK.- Return type: - GstRtsp.RTSPResult- Dump the contents of self to stdout. 
 - 
free()[source]¶
- Returns: - a - GstRtsp.RTSPResult.- Return type: - GstRtsp.RTSPResult- Free the memory used by self. 
 - 
get_body()[source]¶
- Returns: - GstRtsp.RTSPResult.OK.- data: - location for the - GstRtsp.data- Return type: - ( - GstRtsp.RTSPResult, data:- bytes)- Get the body of self. data remains valid for as long as self is valid and unchanged. - If the message body was set as a - Gst.Bufferbefore this will cause the- GstRtsp.datato be copied and stored in the message. The- Gst.Bufferwill no longer be kept in the message.
 - 
get_body_buffer()[source]¶
- Returns: - GstRtsp.RTSPResult.OK.- buffer: - location for the buffer - Return type: - ( - GstRtsp.RTSPResult, buffer:- Gst.Buffer)- Get the body of self. buffer remains valid for as long as self is valid and unchanged. - If body - GstRtsp.datawas set from raw memory instead of a- Gst.Bufferthis function will always return- None. The caller can check if there is a body buffer by calling- GstRtsp.RTSPMessage.has_body_buffer().- New in version 1.16. 
 - 
get_header(field, indx)[source]¶
- Parameters: - field (GstRtsp.RTSPHeaderField) – aGstRtsp.RTSPHeaderField
- indx (int) – the index of the header
 - Returns: - GstRtsp.RTSPResult.OKwhen field was found,- GstRtsp.RTSPResult.ENOTIMPLif the key was not found.- value: - pointer to hold the result - Return type: - ( - GstRtsp.RTSPResult, value:- str)- Get the indx header value with key field from self. The result in value stays valid as long as it remains present in self. 
- field (
 - 
get_header_by_name(header, index)[source]¶
- Parameters: - header (str) – aGstRtsp.RTSPHeaderField
- index (int) – the index of the header
 - Returns: - GstRtsp.RTSPResult.OKwhen field was found,- GstRtsp.RTSPResult.ENOTIMPLif the key was not found.- value: - pointer to hold the result - Return type: - ( - GstRtsp.RTSPResult, value:- str)- Get the index header value with key header from self. The result in value stays valid as long as it remains present in self. - New in version 1.6. 
- header (
 - 
get_type()[source]¶
- Returns: - the message type. - Return type: - GstRtsp.RTSPMsgType- Get the message type of self. 
 - 
has_body_buffer()[source]¶
- Returns: - Trueif self has a body and it’s stored as- Gst.Buffer,- Falseotherwise.- Return type: - bool- Checks if self has a body and the body is stored as - Gst.Buffer.- New in version 1.16. 
 - 
init()[source]¶
- Returns: - a - GstRtsp.RTSPResult.- Return type: - GstRtsp.RTSPResult- Initialize self. This function is mostly used when self is allocated on the stack. The reverse operation of this is - GstRtsp.RTSPMessage.unset().
 - 
init_data(channel)[source]¶
- Parameters: - channel ( - int) – a channel- Returns: - a - GstRtsp.RTSPResult.- Return type: - GstRtsp.RTSPResult- Initialize a new - GstRtsp.data- GstRtsp.RTSPMessagefor channel.
 - 
init_request(method, uri)[source]¶
- Parameters: - method (GstRtsp.RTSPMethod) – theGstRtsp.requestmethod to use
- uri (str) – the uri of theGstRtsp.request
 - Returns: - Return type: - Initialize self as a - GstRtsp.requestmessage with method and uri. To clear self again, use- GstRtsp.RTSPMessage.unset().
- method (
 - 
init_response(code, reason, request)[source]¶
- Parameters: - code (GstRtsp.RTSPStatusCode) – the status code
- reason (strorNone) – the status reason orNone
- request (GstRtsp.RTSPMessageorNone) – theGstRtsp.requestthat triggered theGstRtsp.responseorNone
 - Returns: - Return type: - Initialize self with code and reason. - When reason is - None, the default reason for code will be used.- When request is not - None, the relevant headers will be copied to the new- GstRtsp.responsemessage.
- code (
 - 
parse_auth_credentials(field)[source]¶
- Parameters: - field ( - GstRtsp.RTSPHeaderField) – a- GstRtsp.RTSPHeaderField- Returns: - None-terminated array of- GstRtsp.RTSPAuthCredentialor- None.- Return type: - [ - GstRtsp.RTSPAuthCredential]- Parses the credentials given in a WWW-Authenticate or Authorization header. - New in version 1.12. 
 - 
parse_data()[source]¶
- Returns: - a - GstRtsp.RTSPResult.- channel: - location to hold the channel - Return type: - ( - GstRtsp.RTSPResult, channel:- int)- Parse the - GstRtsp.datamessage self and store the channel in channel.
 - 
parse_request()[source]¶
- Returns: - a - GstRtsp.RTSPResult.- method: - location to hold the method - uri: - location to hold the uri - version: - location to hold the version - Return type: - ( - GstRtsp.RTSPResult, method:- GstRtsp.RTSPMethod, uri:- str, version:- GstRtsp.RTSPVersion)- Parse the - GstRtsp.requestmessage self and store the values method, uri and version. The result locations can be- Noneif one is not interested in its value.- uri remains valid for as long as self is valid and unchanged. 
 - 
parse_response()[source]¶
- Returns: - a - GstRtsp.RTSPResult.- code: - location to hold the status code - reason: - location to hold the status reason - version: - location to hold the version - Return type: - ( - GstRtsp.RTSPResult, code:- GstRtsp.RTSPStatusCode, reason:- str, version:- GstRtsp.RTSPVersion)- Parse the - GstRtsp.responsemessage self and store the values code, reason and version. The result locations can be- Noneif one is not interested in its value.- reason remains valid for as long as self is valid and unchanged. 
 - 
remove_header(field, indx)[source]¶
- Parameters: - field (GstRtsp.RTSPHeaderField) – aGstRtsp.RTSPHeaderField
- indx (int) – the index of the header
 - Returns: - Return type: - Remove the indx header with key field from self. If indx equals -1, all headers will be removed. 
- field (
 - 
remove_header_by_name(header, index)[source]¶
- Parameters: - Returns: - Return type: - Remove the index header with key header from self. If index equals -1, all matching headers will be removed. - New in version 1.6. 
 - 
set_body(data)[source]¶
- Parameters: - data ( - bytes) – the- GstRtsp.data- Returns: - GstRtsp.RTSPResult.OK.- Return type: - GstRtsp.RTSPResult- Set the body of self to a copy of data. Any existing body or body buffer will be replaced by the new body. 
 - 
set_body_buffer(buffer)[source]¶
- Parameters: - buffer ( - Gst.Buffer) – a- Gst.Buffer- Returns: - GstRtsp.RTSPResult.OK.- Return type: - GstRtsp.RTSPResult- Set the body of self to buffer. Any existing body or body buffer will be replaced by the new body. - New in version 1.16. 
 - 
steal_body()[source]¶
- Returns: - GstRtsp.RTSPResult.OK.- data: - location for the - GstRtsp.data- Return type: - ( - GstRtsp.RTSPResult, data:- bytes)- Take the body of self and store it in data and size. After this method, the body and size of self will be set to - Noneand 0 respectively.
 - 
steal_body_buffer()[source]¶
- Returns: - GstRtsp.RTSPResult.OK.- buffer: - location for the buffer - Return type: - ( - GstRtsp.RTSPResult, buffer:- Gst.Buffer)- Take the body of self and store it in buffer. After this method, the body and size of self will be set to - Noneand 0 respectively.- If body - GstRtsp.datawas set from raw memory instead of a- Gst.Bufferthis function will always return- None. The caller can check if there is a body buffer by calling- GstRtsp.RTSPMessage.has_body_buffer().- New in version 1.16. 
 - 
take_body(data)[source]¶
- Parameters: - data ( - bytes) – the- GstRtsp.data- Returns: - GstRtsp.RTSPResult.OK.- Return type: - GstRtsp.RTSPResult- Set the body of self to data and size. This method takes ownership of data. Any existing body or body buffer will be replaced by the new body. 
 - 
take_body_buffer(buffer)[source]¶
- Parameters: - buffer ( - Gst.Buffer) – a- Gst.Buffer- Returns: - GstRtsp.RTSPResult.OK.- Return type: - GstRtsp.RTSPResult- Set the body of self to buffer. This method takes ownership of buffer. Any existing body or body buffer will be replaced by the new body. - New in version 1.16. 
 - 
take_header(field, value)[source]¶
- Parameters: - field (GstRtsp.RTSPHeaderField) – aGstRtsp.RTSPHeaderField
- value (str) – the value of the header
 - Returns: - Return type: - Add a header with key field and value to self. This function takes ownership of value. 
- field (
 - 
take_header_by_name(header, value)[source]¶
- Parameters: - Returns: - Return type: - Add a header with key header and value to self. This function takes ownership of value, but not of header. - New in version 1.6. 
 - 
unset()[source]¶
- Returns: - GstRtsp.RTSPResult.OK.- Return type: - GstRtsp.RTSPResult- Unset the contents of self so that it becomes an uninitialized - GstRtsp.RTSPMessageagain. This function is mostly used in combination with- GstRtsp.RTSPMessage.init_request(),- GstRtsp.RTSPMessage.init_response() and- GstRtsp.RTSPMessage.init_data() on stack allocated- GstRtsp.RTSPMessagestructures.
 
-