* @ip: the IP address of the other end
* @port: the port used by the other end
* @initial_buffer: data already read from @fd
- * @conn: (out) (transfer full): storage for a #GstRTSPConnection
+ * @conn: (out) (transfer full) (nullable): storage for a #GstRTSPConnection
*
* Create a new #GstRTSPConnection for handling communication on the existing
* socket @socket. The @initial_buffer contains zero terminated data already
g_return_val_if_fail (ip != NULL, GST_RTSP_EINVAL);
g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL);
+ *conn = NULL;
+
if (!collect_addresses (socket, &local_ip, NULL, FALSE, &err))
goto getnameinfo_failed;
/**
* gst_rtsp_connection_accept:
* @socket: a socket
- * @conn: (out) (transfer full): storage for a #GstRTSPConnection
+ * @conn: (out) (transfer full) (nullable): storage for a #GstRTSPConnection
* @cancellable: a #GCancellable to cancel the operation
*
* Accept a new connection on @socket and create a new #GstRTSPConnection for
g_return_val_if_fail (G_IS_SOCKET (socket), GST_RTSP_EINVAL);
g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL);
+ *conn = NULL;
+
client_sock = g_socket_accept (socket, cancellable, &err);
if (!client_sock)
goto accept_failed;
/**
* gst_rtsp_connection_get_tls:
* @conn: a #GstRTSPConnection
- * @error: #GError for error reporting, or NULL to ignore.
+ * @error: (optional): #GError for error reporting, or NULL to ignore.
*
* Get the TLS connection of @conn.
*
/**
* gst_rtsp_connection_set_tls_database:
* @conn: a #GstRTSPConnection
- * @database: a #GTlsDatabase
+ * @database: (nullable): a #GTlsDatabase
*
* Sets the anchor certificate authorities database. This certificate
* database will be used to verify the server's certificate in case it
* after a server certificate can't be verified with the default
* certificate database.
*
- * Returns: (transfer full): the anchor certificate authorities database, or NULL if no
+ * Returns: (transfer full) (nullable): the anchor certificate authorities database, or NULL if no
* database has been previously set. Use g_object_unref() to release the
* certificate database.
*
/**
* gst_rtsp_connection_set_tls_interaction:
* @conn: a #GstRTSPConnection
- * @interaction: a #GTlsInteraction
+ * @interaction: (nullable): a #GTlsInteraction
*
* 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
* database need to interact with the user. This will be used to prompt the
* user for passwords where necessary.
*
- * Returns: (transfer full): a reference on the #GTlsInteraction. Use
+ * Returns: (transfer full) (nullable): a reference on the #GTlsInteraction. Use
* g_object_unref() to release.
*
* Since: 1.6
/**
* gst_rtsp_connection_write_usec:
* @conn: a #GstRTSPConnection
- * @data: the data to write
+ * @data: (array length=size): the data to write
* @size: the size of @data
* @timeout: a timeout value or 0
*
/**
* gst_rtsp_connection_read_usec:
* @conn: a #GstRTSPConnection
- * @data: the data to read
+ * @data: (array length=size): the data to read
* @size: the size of @data
* @timeout: a timeout value in microseconds
*
/**
* gst_rtsp_connection_receive_usec:
* @conn: a #GstRTSPConnection
- * @message: the message to read
+ * @message: (out caller-allocates): the message to read
* @timeout: a timeout value or 0
*
* Attempt to read into @message from the connected @conn, blocking up to
* gst_rtsp_connection_poll_usec:
* @conn: a #GstRTSPConnection
* @events: a bitmask of #GstRTSPEvent flags to check
- * @revents: location for result flags
+ * @revents: (out caller-allocates): location for result flags
* @timeout: a timeout in microseconds
*
* Wait up to the specified @timeout for the connection to become available for
*
* Get the file descriptor for reading.
*
- * Returns: (transfer none): the file descriptor used for reading or %NULL on
+ * Returns: (transfer none) (nullable): the file descriptor used for reading or %NULL on
* error. The file descriptor remains valid until the connection is closed.
*/
GSocket *
*
* Get the file descriptor for writing.
*
- * Returns: (transfer none): the file descriptor used for writing or NULL on
+ * Returns: (transfer none) (nullable): the file descriptor used for writing or NULL on
* error. The file descriptor remains valid until the connection is closed.
*/
GSocket *
*
* Get the tunnel session id the connection.
*
- * Returns: returns a non-empty string if @conn is being tunneled over HTTP.
+ * Returns: (nullable): returns a non-empty string if @conn is being tunneled over HTTP.
*/
const gchar *
gst_rtsp_connection_get_tunnelid (const GstRTSPConnection * conn)
/**
* gst_rtsp_connection_do_tunnel:
* @conn: a #GstRTSPConnection
- * @conn2: a #GstRTSPConnection or %NULL
+ * @conn2: (nullable): a #GstRTSPConnection or %NULL
*
* If @conn received the first tunnel connection and @conn2 received
* the second tunnel connection, link the two connections together so that
*
* @conn must exist for the entire lifetime of the watch.
*
- * Returns: a #GstRTSPWatch that can be used for asynchronous RTSP
+ * Returns: (transfer full): a #GstRTSPWatch that can be used for asynchronous RTSP
* communication. Free with gst_rtsp_watch_unref () after usage.
*/
GstRTSPWatch *
/**
* gst_rtsp_watch_attach:
* @watch: a #GstRTSPWatch
- * @context: a GMainContext (if NULL, the default context will be used)
+ * @context: (nullable): a GMainContext (if NULL, the default context will be used)
*
* Adds a #GstRTSPWatch to a context so that it will be executed within that context.
*
* @watch: a #GstRTSPWatch
* @data: (array length=size) (transfer full): the data to queue
* @size: the size of @data
- * @id: (out) (allow-none): location for a message ID or %NULL
+ * @id: (out) (optional): location for a message ID or %NULL
*
* Write @data using the connection of the @watch. If it cannot be sent
* immediately, it will be queued for transmission in @watch. The contents of
* gst_rtsp_watch_send_message:
* @watch: a #GstRTSPWatch
* @message: a #GstRTSPMessage
- * @id: (out) (allow-none): location for a message ID or %NULL
+ * @id: (out) (optional): location for a message ID or %NULL
*
* Send a @message using the connection of the @watch. If it cannot be sent
* immediately, it will be queued for transmission in @watch. The contents of
* @watch: a #GstRTSPWatch
* @messages: (array length=n_messages): the messages to send
* @n_messages: the number of messages to send
- * @id: (out) (allow-none): location for a message ID or %NULL
+ * @id: (out) (optional): location for a message ID or %NULL
*
* Sends @messages using the connection of the @watch. If they cannot be sent
* immediately, they will be queued for transmission in @watch. The contents of
/**
* gst_rtsp_connection_read:
* @conn: a #GstRTSPConnection
- * @data: the data to read
+ * @data: (array length=size): the data to read
* @size: the size of @data
* @timeout: a timeout value or %NULL
*
/**
* gst_rtsp_connection_write:
* @conn: a #GstRTSPConnection
- * @data: the data to write
+ * @data: (array length=size): the data to write
* @size: the size of @data
* @timeout: a timeout value or %NULL
*
/**
* gst_rtsp_connection_receive:
* @conn: a #GstRTSPConnection
- * @message: the message to read
+ * @message: (out caller-allocates): the message to read
* @timeout: a timeout value or %NULL
*
* Attempt to read into @message from the connected @conn, blocking up to
* gst_rtsp_connection_poll:
* @conn: a #GstRTSPConnection
* @events: a bitmask of #GstRTSPEvent flags to check
- * @revents: location for result flags
+ * @revents: (out): location for result flags
* @timeout: a timeout
*
* Wait up to the specified @timeout for the connection to become available for
*
* Convert @method to a string.
*
- * Returns: a string representation of @method.
+ * Returns: (nullable): a string representation of @method.
*/
const gchar *
gst_rtsp_method_as_text (GstRTSPMethod method)
*
* Convert @field to a string.
*
- * Returns: a string representation of @field.
+ * Returns: (nullable): a string representation of @field.
*/
const gchar *
gst_rtsp_header_as_text (GstRTSPHeaderField field)
/**
* gst_rtsp_generate_digest_auth_response:
- * @algorithm: (allow-none): Hash algorithm to use, or %NULL for MD5
+ * @algorithm: (nullable): Hash algorithm to use, or %NULL for MD5
* @method: Request method, e.g. PLAY
* @realm: Realm
* @username: Username
*
* Currently only supported algorithm "md5".
*
- * Returns: Authentication response or %NULL if unsupported
+ * Returns: (nullable): Authentication response or %NULL if unsupported
*
* Since: 1.12
*/
/**
* gst_rtsp_generate_digest_auth_response_from_md5:
- * @algorithm: (allow-none): Hash algorithm to use, or %NULL for MD5
+ * @algorithm: (nullable): Hash algorithm to use, or %NULL for MD5
* @method: Request method, e.g. PLAY
* @md5: The md5 sum of username:realm:password
* @uri: Original request URI
*
* Currently only supported algorithm "md5".
*
- * Returns: Authentication response or %NULL if unsupported
+ * Returns: (nullable): Authentication response or %NULL if unsupported
*
* Since: 1.16
*/
/**
* gst_rtsp_message_init:
- * @msg: a #GstRTSPMessage
+ * @msg: (out caller-allocates): a #GstRTSPMessage
*
* Initialize @msg. This function is mostly used when @msg is allocated on the
* stack. The reverse operation of this is gst_rtsp_message_unset().
/**
* gst_rtsp_message_init_request:
- * @msg: a #GstRTSPMessage
+ * @msg: (out caller-allocates): a #GstRTSPMessage
* @method: the request method to use
* @uri: (transfer none): the uri of the request
*
/**
* gst_rtsp_message_parse_request:
* @msg: a #GstRTSPMessage
- * @method: (out) (allow-none): location to hold the method
- * @uri: (out) (allow-none) (transfer none): location to hold the uri
- * @version: (out) (allow-none) (transfer none): location to hold the version
+ * @method: (out) (optional): location to hold the method
+ * @uri: (out) (optional) (transfer none): location to hold the uri
+ * @version: (out) (optional) (transfer none): location to hold the version
*
* Parse the request message @msg and store the values @method, @uri and
* @version. The result locations can be %NULL if one is not interested in its
* gst_rtsp_message_new_response:
* @msg: (out) (transfer full): a location for the new #GstRTSPMessage
* @code: the status code
- * @reason: (transfer none) (allow-none): the status reason or %NULL
- * @request: (transfer none) (allow-none): the request that triggered the response or %NULL
+ * @reason: (transfer none) (optional): the status reason or %NULL
+ * @request: (transfer none) (optional): the request that triggered the response or %NULL
*
* Create a new response #GstRTSPMessage with @code and @reason and store the
* result message in @msg. Free with gst_rtsp_message_free().
/**
* gst_rtsp_message_init_response:
- * @msg: a #GstRTSPMessage
+ * @msg: (out caller-allocates): a #GstRTSPMessage
* @code: the status code
- * @reason: (transfer none) (allow-none): the status reason or %NULL
- * @request: (transfer none) (allow-none): the request that triggered the response or %NULL
+ * @reason: (transfer none) (optional): the status reason or %NULL
+ * @request: (transfer none) (optional): the request that triggered the response or %NULL
*
* Initialize @msg with @code and @reason.
*
/**
* gst_rtsp_message_parse_response:
* @msg: a #GstRTSPMessage
- * @code: (out) (allow-none): location to hold the status code
- * @reason: (out) (allow-none) (transfer none): location to hold the status reason
- * @version: (out) (allow-none) (transfer none): location to hold the version
+ * @code: (out) (optional): location to hold the status code
+ * @reason: (out) (optional) (transfer none): location to hold the status reason
+ * @version: (out) (optional) (transfer none): location to hold the version
*
* Parse the response message @msg and store the values @code, @reason and
* @version. The result locations can be %NULL if one is not interested in its
/**
* gst_rtsp_message_init_data:
- * @msg: a #GstRTSPMessage
+ * @msg: (out caller-allocates): a #GstRTSPMessage
* @channel: a channel
*
* Initialize a new data #GstRTSPMessage for @channel.
/**
* gst_rtsp_message_parse_data:
* @msg: a #GstRTSPMessage
- * @channel: (out): location to hold the channel
+ * @channel: (out) (optional): location to hold the channel
*
* Parse the data message @msg and store the channel in @channel.
*
/**
* gst_rtsp_message_copy:
* @msg: a #GstRTSPMessage
- * @copy: (out) (transfer full): pointer to new #GstRTSPMessage
+ * @copy: (out) (nullable) (transfer full): pointer to new #GstRTSPMessage
*
* Allocate a new copy of @msg and store the result in @copy. The value in
* @copy should be release with gst_rtsp_message_free function.
GstRTSPResult ret;
GstRTSPMessage *cp;
+ g_return_val_if_fail (copy != NULL, GST_RTSP_EINVAL);
+
+ *copy = NULL;
+
if (msg == NULL)
return GST_RTSP_EINVAL;
* gst_rtsp_message_get_header:
* @msg: a #GstRTSPMessage
* @field: a #GstRTSPHeaderField
- * @value: (out) (transfer none): pointer to hold the result
+ * @value: (out) (transfer none) (optional) (nullable): pointer to hold the result
* @indx: the index of the header
*
* Get the @indx header value with key @field from @msg. The result in @value
g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
+ if (value)
+ *value = NULL;
+
/* no header initialized, there are no headers */
if (msg->hdr_fields == NULL)
return GST_RTSP_ENOTIMPL;
* gst_rtsp_message_get_header_by_name:
* @msg: a #GstRTSPMessage
* @header: a #GstRTSPHeaderField
- * @value: (out) (transfer none): pointer to hold the result
+ * @value: (out) (transfer none) (optional) (nullable): pointer to hold the result
* @index: the index of the header
*
* Get the @index header value with key @header from @msg. The result in @value
g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
g_return_val_if_fail (header != NULL, GST_RTSP_EINVAL);
+ if (value)
+ *value = NULL;
+
pos = gst_rtsp_message_find_header_by_name (msg, header, index);
if (pos < 0)
*
* Parses the credentials given in a WWW-Authenticate or Authorization header.
*
- * Returns: (array zero-terminated=1):
+ * Returns: (transfer full) (array zero-terminated=1):
* %NULL-terminated array of GstRTSPAuthCredential or %NULL.
*
* Since: 1.12
/**
* gst_rtsp_transport_new:
- * @transport: location to hold the new #GstRTSPTransport
+ * @transport: (out) (transfer full): location to hold the new #GstRTSPTransport
*
* Allocate a new initialized #GstRTSPTransport. Use gst_rtsp_transport_free()
* after usage.
/**
* gst_rtsp_transport_init:
- * @transport: a #GstRTSPTransport
+ * @transport: (out caller-allocates): a #GstRTSPTransport
*
* Initialize @transport so that it can be used.
*
/**
* gst_rtsp_transport_get_mime:
* @trans: a #GstRTSPTransMode
- * @mime: location to hold the result
+ * @mime: (out) (transfer none): location to hold the result
*
* Get the mime type of the transport mode @trans. This mime type is typically
* used to generate #GstCaps events.
/**
* gst_rtsp_transport_parse:
* @str: a transport string
- * @transport: a #GstRTSPTransport
+ * @transport: (out caller-allocates): a #GstRTSPTransport
*
* Parse the RTSP transport string @str into @transport.
*
* Convert @transport into a string that can be used to signal the transport in
* an RTSP SETUP response.
*
- * Returns: a string describing the RTSP transport or %NULL when the transport
- * is invalid.
+ * Returns: (transfer full) (nullable): a string describing the RTSP transport
+ * or %NULL when the transport is invalid.
*/
gchar *
gst_rtsp_transport_as_text (GstRTSPTransport * transport)
/**
* gst_rtsp_url_parse:
* @urlstr: the url string to parse
- * @url: (out): location to hold the result.
+ * @url: (out) (transfer full) (nullable): location to hold the result.
*
* Parse the RTSP @urlstr into a newly allocated #GstRTSPUrl. Free after usage
* with gst_rtsp_url_free().
g_return_val_if_fail (urlstr != NULL, GST_RTSP_EINVAL);
g_return_val_if_fail (url != NULL, GST_RTSP_EINVAL);
+ *url = NULL;
+
res = g_new0 (GstRTSPUrl, 1);
p = (gchar *) urlstr;
*
* Make a copy of @url.
*
- * Returns: a copy of @url. Free with gst_rtsp_url_free () after usage.
+ * Returns: (transfer full): a copy of @url. Free with gst_rtsp_url_free () after usage.
*/
GstRTSPUrl *
gst_rtsp_url_copy (const GstRTSPUrl * url)
*
* Get a newly allocated string describing the request URI for @url.
*
- * Returns: a string with the request URI. g_free() after usage.
+ * Returns: (transfer full): a string with the request URI. g_free() after usage.
*/
gchar *
gst_rtsp_url_get_request_uri (const GstRTSPUrl * url)
* Get a newly allocated string describing the request URI for @url
* combined with the control path for @control_path
*
- * Returns: a string with the request URI combined with the control path.
+ * Returns: (transfer full): a string with the request URI combined with the control path.
* g_free() after usage.
*
* Since: 1.18