GstRtsp.RTSPWatch¶
Fields¶
None
Methods¶
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
Details¶
- class GstRtsp.RTSPWatch¶
 Opaque RTSP watch object that can be used for asynchronous RTSP operations.
- attach(context)[source]¶
 - Parameters:
 context (
GLib.MainContextorNone) – aGLib.MainContext(ifNone, the default context will be used)- Returns:
 the ID (greater than 0) for the watch within the
GLib.MainContext.- Return type:
 
Adds a
GstRtsp.RTSPWatchto a context so that it will be executed within that context.
- get_send_backlog()[source]¶
 - 
Get the maximum amount of bytes and messages that will be queued in self. See
GstRtsp.RTSPWatch.set_send_backlog().New in version 1.2.
 
- reset()[source]¶
 Reset self, this is usually called after
GstRtsp.RTSPConnection.do_tunnel() when the file descriptors of the connection might have changed.
- send_message(message)[source]¶
 - Parameters:
 message (
GstRtsp.RTSPMessage) – aGstRtsp.RTSPMessage- Returns:
 GstRtsp.RTSPResult.OKon success.- id:
 location for a message ID or
None
- Return type:
 (
GstRtsp.RTSPResult, id:int)
Send a message using the connection of the self. If it cannot be sent immediately, it will be queued for transmission in self. The contents of message will then be serialized and transmitted when the connection of the self becomes writable. In case the message is queued, the ID returned in id will be non-zero and used as the ID argument in the message_sent callback.
- send_messages(messages)[source]¶
 - Parameters:
 messages ([
GstRtsp.RTSPMessage]) – the messages to send- Returns:
 GstRtsp.RTSPResult.OKon success.- id:
 location for a message ID or
None
- Return type:
 (
GstRtsp.RTSPResult, id:int)
Sends messages using the connection of the self. If they cannot be sent immediately, they will be queued for transmission in self. The contents of messages will then be serialized and transmitted when the connection of the self becomes writable. In case the messages are queued, the ID returned in id will be non-zero and used as the ID argument in the message_sent callback once the last message is sent. The callback will only be called once for the last message.
New in version 1.16.
- set_flushing(flushing)[source]¶
 - Parameters:
 flushing (
bool) – new flushing state
When flushing is
True, abort a call toGstRtsp.RTSPWatch.wait_backlog() and make sureGstRtsp.RTSPWatch.write_data() returns immediately withGstRtsp.RTSPResult.EINTR. And empty the queue.New in version 1.4.
- set_send_backlog(bytes, messages)[source]¶
 - 
Set the maximum amount of bytes and messages that will be queued in self. When the maximum amounts are exceeded,
GstRtsp.RTSPWatch.write_data() andGstRtsp.RTSPWatch.send_message() will returnGstRtsp.RTSPResult.ENOMEM.A value of 0 for bytes or messages means no limits.
New in version 1.2.
 
- unref()[source]¶
 Decreases the reference count of self by one. If the resulting reference count is zero the watch and associated memory will be destroyed.
- wait_backlog(timeout)[source]¶
 - Parameters:
 timeout (
GLib.TimeVal) – aGLib.TimeValtimeout- Returns:
 GstRtsp.RTSPResult.OKwhen if there is room in queue.GstRtsp.RTSPResult.ETIMEOUTwhen timeout was reached.GstRtsp.RTSPResult.EINTRwhen self is flushingGstRtsp.RTSPResult.EINVALwhen called with invalid parameters.- Return type:
 
Wait until there is place in the backlog queue, timeout is reached or self is set to flushing.
If timeout is
Nonethis function can block forever. If timeout contains a valid timeout, this function will returnGstRtsp.RTSPResult.ETIMEOUTafter the timeout expired.The typically use of this function is when
GstRtsp.RTSPWatch.write_datareturnsGstRtsp.RTSPResult.ENOMEM. The caller then calls this function to wait for free space in the backlog queue and try again.New in version 1.4.
Deprecated since version 1.18.
- wait_backlog_usec(timeout)[source]¶
 - Parameters:
 timeout (
int) – a timeout in microseconds- Returns:
 GstRtsp.RTSPResult.OKwhen if there is room in queue.GstRtsp.RTSPResult.ETIMEOUTwhen timeout was reached.GstRtsp.RTSPResult.EINTRwhen self is flushingGstRtsp.RTSPResult.EINVALwhen called with invalid parameters.- Return type:
 
Wait until there is place in the backlog queue, timeout is reached or self is set to flushing.
If timeout is 0 this function can block forever. If timeout contains a valid timeout, this function will return
GstRtsp.RTSPResult.ETIMEOUTafter the timeout expired.The typically use of this function is when
GstRtsp.RTSPWatch.write_datareturnsGstRtsp.RTSPResult.ENOMEM. The caller then calls this function to wait for free space in the backlog queue and try again.New in version 1.18.
- write_data(data)[source]¶
 - Parameters:
 data (
bytes) – theGstRtsp.datato queue- Returns:
 GstRtsp.RTSPResult.OKon success.GstRtsp.RTSPResult.ENOMEMwhen the backlog limits are reached.GstRtsp.RTSPResult.EINTRwhen self was flushing.- id:
 location for a message ID or
None
- Return type:
 (
GstRtsp.RTSPResult, id:int)
Write data using the connection of the self. If it cannot be sent immediately, it will be queued for transmission in self. The contents of message will then be serialized and transmitted when the connection of the self becomes writable. In case the message is queued, the ID returned in id will be non-zero and used as the ID argument in the message_sent callback.
This function will take ownership of data and
GLib.free() it after use.If the amount of queued
GstRtsp.dataexceeds the limits set withGstRtsp.RTSPWatch.set_send_backlog(), this function will returnGstRtsp.RTSPResult.ENOMEM.