RTSPConnection

This object manages the RTSP connection to the server. It provides function to receive and send bytes and messages.

class RTSPConnection {
GstRTSPConnection* cInstancePtr;
bool owned;
}

Members

Functions

addExtraHttpRequestHeader
void addExtraHttpRequestHeader(string key, string value)

Add header to be appended to any HTTP request made by connection. If the header already exists then the old header is replaced by the new header.

clearAuthParams
void clearAuthParams()

Clear the list of authentication directives stored in conn.

close
gstrtsp.types.RTSPResult close()

Close the connected conn. After this call, the connection is in the same state as when it was first created.

connect
gstrtsp.types.RTSPResult connect(glib.time_val.TimeVal timeout)

Attempt to connect to the url of conn made with gstrtsp.rtspconnection.RTSPConnection.create. If timeout is null this function can block forever. If timeout contains a valid timeout, this function will return #GST_RTSP_ETIMEOUT after the timeout expired.

connectUsec
gstrtsp.types.RTSPResult connectUsec(long timeout)

Attempt to connect to the url of conn made with gstrtsp.rtspconnection.RTSPConnection.create. If timeout is 0 this function can block forever. If timeout contains a valid timeout, this function will return #GST_RTSP_ETIMEOUT after the timeout expired.

connectWithResponse
gstrtsp.types.RTSPResult connectWithResponse(glib.time_val.TimeVal timeout, gstrtsp.rtspmessage.RTSPMessage response)

Attempt to connect to the url of conn made with gstrtsp.rtspconnection.RTSPConnection.create. If timeout is null this function can block forever. If timeout contains a valid timeout, this function will return #GST_RTSP_ETIMEOUT after the timeout expired. If conn is set to tunneled, response will contain a response to the tunneling request messages.

connectWithResponseUsec
gstrtsp.types.RTSPResult connectWithResponseUsec(long timeout, gstrtsp.rtspmessage.RTSPMessage response)

Attempt to connect to the url of conn made with gstrtsp.rtspconnection.RTSPConnection.create. If timeout is 0 this function can block forever. If timeout contains a valid timeout, this function will return #GST_RTSP_ETIMEOUT after the timeout expired. If conn is set to tunneled, response will contain a response to the tunneling request messages.

doTunnel
gstrtsp.types.RTSPResult doTunnel(gstrtsp.rtspconnection.RTSPConnection conn2)

If conn received the first tunnel connection and conn2 received the second tunnel connection, link the two connections together so that conn manages the tunneled connection.

flush
gstrtsp.types.RTSPResult flush(bool flush)

Start or stop the flushing action on conn. When flushing, all current and future actions on conn will return #GST_RTSP_EINTR until the connection is set to non-flushing mode again.

getIgnoreXServerReply
bool getIgnoreXServerReply()

Get the ignore_x_server_reply value.

getIp
string getIp()

Retrieve the IP address of the other end of conn.

getReadSocket
gio.socket.Socket getReadSocket()

Get the file descriptor for reading.

getRememberSessionId
bool getRememberSessionId()
getTls
gio.tls_connection.TlsConnection getTls()

Get the TLS connection of conn.

getTlsDatabase
gio.tls_database.TlsDatabase getTlsDatabase()

Gets the anchor certificate authorities database that will be used after a server certificate can't be verified with the default certificate database.

getTlsInteraction
gio.tls_interaction.TlsInteraction getTlsInteraction()

Gets a #GTlsInteraction object to be used when the connection or certificate database need to interact with the user. This will be used to prompt the user for passwords where necessary.

getTlsValidationFlags
gio.types.TlsCertificateFlags getTlsValidationFlags()

Gets the TLS validation flags used to verify the peer certificate when a TLS connection is established.

getTunnelid
string getTunnelid()

Get the tunnel session id the connection.

getUrl
gstrtsp.rtspurl.RTSPUrl getUrl()

Retrieve the URL of the other end of conn.

getWriteSocket
gio.socket.Socket getWriteSocket()

Get the file descriptor for writing.

isTunneled
bool isTunneled()

Get the tunneling state of the connection.

nextTimeout
gstrtsp.types.RTSPResult nextTimeout(glib.time_val.TimeVal timeout)

Calculate the next timeout for conn, storing the result in timeout.

nextTimeoutUsec
long nextTimeoutUsec()

Calculate the next timeout for conn

poll
gstrtsp.types.RTSPResult poll(gstrtsp.types.RTSPEvent events, gstrtsp.types.RTSPEvent revents, glib.time_val.TimeVal timeout)

Wait up to the specified timeout for the connection to become available for at least one of the operations specified in events. When the function returns with #GST_RTSP_OK, revents will contain a bitmask of available operations on conn.

pollUsec
gstrtsp.types.RTSPResult pollUsec(gstrtsp.types.RTSPEvent events, gstrtsp.types.RTSPEvent revents, long timeout)

Wait up to the specified timeout for the connection to become available for at least one of the operations specified in events. When the function returns with #GST_RTSP_OK, revents will contain a bitmask of available operations on conn.

read
gstrtsp.types.RTSPResult read(ubyte[] data, glib.time_val.TimeVal timeout)

Attempt to read size bytes into data from the connected conn, blocking up to the specified timeout. timeout can be null, in which case this function might block forever.

readUsec
gstrtsp.types.RTSPResult readUsec(ubyte[] data, long timeout)

Attempt to read size bytes into data from the connected conn, blocking up to the specified timeout. timeout can be 0, in which case this function might block forever.

receive
gstrtsp.types.RTSPResult receive(gstrtsp.rtspmessage.RTSPMessage message, glib.time_val.TimeVal timeout)

Attempt to read into message from the connected conn, blocking up to the specified timeout. timeout can be null, in which case this function might block forever.

receiveUsec
gstrtsp.types.RTSPResult receiveUsec(gstrtsp.rtspmessage.RTSPMessage message, long timeout)

Attempt to read into message from the connected conn, blocking up to the specified timeout. timeout can be 0, in which case this function might block forever.

resetTimeout
gstrtsp.types.RTSPResult resetTimeout()

Reset the timeout of conn.

send
gstrtsp.types.RTSPResult send(gstrtsp.rtspmessage.RTSPMessage message, glib.time_val.TimeVal timeout)

Attempt to send message to the connected conn, blocking up to the specified timeout. timeout can be null, in which case this function might block forever.

sendMessages
gstrtsp.types.RTSPResult sendMessages(gstrtsp.rtspmessage.RTSPMessage[] messages, glib.time_val.TimeVal timeout)

Attempt to send messages to the connected conn, blocking up to the specified timeout. timeout can be null, in which case this function might block forever.

sendMessagesUsec
gstrtsp.types.RTSPResult sendMessagesUsec(gstrtsp.rtspmessage.RTSPMessage[] messages, long timeout)

Attempt to send messages to the connected conn, blocking up to the specified timeout. timeout can be 0, in which case this function might block forever.

sendUsec
gstrtsp.types.RTSPResult sendUsec(gstrtsp.rtspmessage.RTSPMessage message, long timeout)

Attempt to send message to the connected conn, blocking up to the specified timeout. timeout can be 0, in which case this function might block forever.

setAcceptCertificateFunc
void setAcceptCertificateFunc(gstrtsp.types.RTSPConnectionAcceptCertificateFunc func)

Sets a custom accept-certificate function for checking certificates for validity. This will directly map to #GTlsConnection 's "accept-certificate" signal and be performed after the default checks of #GstRTSPConnection (checking against the #GTlsDatabase with the given #GTlsCertificateFlags) have failed. If no #GTlsDatabase is set on this connection, only func will be called.

setAuth
gstrtsp.types.RTSPResult setAuth(gstrtsp.types.RTSPAuthMethod method, string user, string pass)

Configure conn for authentication mode method with user and pass as the user and password respectively.

setAuthParam
void setAuthParam(string param, string value)

Setup conn with authentication directives. This is not necessary for methods #GST_RTSP_AUTH_NONE and #GST_RTSP_AUTH_BASIC. For #GST_RTSP_AUTH_DIGEST, directives should be taken from the digest challenge in the WWW-Authenticate response header and can include realm, domain, nonce, opaque, stale, algorithm, qop as per RFC2617.

setContentLengthLimit
void setContentLengthLimit(uint limit)

Configure conn to use the specified Content-Length limit. Both requests and responses are validated. If content-length is exceeded, ENOMEM error will be returned.

setHttpMode
void setHttpMode(bool enable)

By setting the HTTP mode to true the message parsing will support HTTP messages in addition to the RTSP messages. It will also disable the automatic handling of setting up an HTTP tunnel.

setIgnoreXServerReply
void setIgnoreXServerReply(bool ignore)

Set whether to ignore the x-server-ip-address header reply or not. If the header is ignored, the original address will be used instead.

setIp
void setIp(string ip)

Set the IP address of the server.

setProxy
gstrtsp.types.RTSPResult setProxy(string host, uint port)

Set the proxy host and port.

setQosDscp
gstrtsp.types.RTSPResult setQosDscp(uint qosDscp)

Configure conn to use the specified DSCP value.

setRememberSessionId
void setRememberSessionId(bool remember)

Sets if the #GstRTSPConnection should remember the session id from the last response received and force it onto any further requests.

setTlsDatabase
void setTlsDatabase(gio.tls_database.TlsDatabase database)

Sets the anchor certificate authorities database. This certificate database will be used to verify the server's certificate in case it can't be verified with the default certificate database first.

setTlsInteraction
void setTlsInteraction(gio.tls_interaction.TlsInteraction interaction)

Sets a #GTlsInteraction object to be used when the connection or certificate database need to interact with the user. This will be used to prompt the user for passwords where necessary.

setTlsValidationFlags
bool setTlsValidationFlags(gio.types.TlsCertificateFlags flags)

Sets the TLS validation flags to be used to verify the peer certificate when a TLS connection is established.

setTunneled
void setTunneled(bool tunneled)

Set the HTTP tunneling state of the connection. This must be configured before the conn is connected.

write
gstrtsp.types.RTSPResult write(ubyte[] data, glib.time_val.TimeVal timeout)

Attempt to write size bytes of data to the connected conn, blocking up to the specified timeout. timeout can be null, in which case this function might block forever.

writeUsec
gstrtsp.types.RTSPResult writeUsec(ubyte[] data, long timeout)

Attempt to write size bytes of data to the connected conn, blocking up to the specified timeout. timeout can be 0, in which case this function might block forever.

Static functions

accept
gstrtsp.types.RTSPResult accept(gio.socket.Socket socket, gstrtsp.rtspconnection.RTSPConnection conn, gio.cancellable.Cancellable cancellable)

Accept a new connection on socket and create a new #GstRTSPConnection for handling communication on new socket.

create
gstrtsp.types.RTSPResult create(gstrtsp.rtspurl.RTSPUrl url, gstrtsp.rtspconnection.RTSPConnection conn)

Create a newly allocated #GstRTSPConnection from url and store it in conn. The connection will not yet attempt to connect to url, use gstrtsp.rtspconnection.RTSPConnection.connect.

createFromSocket
gstrtsp.types.RTSPResult createFromSocket(gio.socket.Socket socket, string ip, ushort port, string initialBuffer, gstrtsp.rtspconnection.RTSPConnection conn)

Create a new #GstRTSPConnection for handling communication on the existing socket socket. The initial_buffer contains zero terminated data already read from socket which should be used before starting to read new data.