diff --git a/pinos/client/pinos.c b/pinos/client/pinos.c index 849161aa1..89a86b9c0 100644 --- a/pinos/client/pinos.c +++ b/pinos/client/pinos.c @@ -53,6 +53,12 @@ pinos_client_name (void) return g_strdup_printf ("pinos-pid-%lu", (gulong) getpid ()); } +/** + * pinos_fill_context_properties: + * @properties: a #PinosProperties + * + * Fill @properties with a set of default context properties. + */ void pinos_fill_context_properties (PinosProperties *properties) { @@ -87,6 +93,12 @@ pinos_fill_context_properties (PinosProperties *properties) } } +/** + * pinos_fill_stream_properties + * @properties: a #PinosProperties + * + * Fill @properties with a set of default stream properties. + */ void pinos_fill_stream_properties (PinosProperties *properties) { diff --git a/pinos/client/subscribe.c b/pinos/client/subscribe.c index 71db7db87..6f5c7ebe2 100644 --- a/pinos/client/subscribe.c +++ b/pinos/client/subscribe.c @@ -742,6 +742,22 @@ compare_data (PinosObjectData *data, return g_strcmp0 (data->interface_name, interface_name); } +/** + * pinos_subscribe_get_proxy: + * @subscribe: a #PinosSubscribe + * @name: the owner name + * @object_path: the object path + * @interface_name: the interface name + * @cancellable: a #GCancellable + * @callback: a #GAsyncReadyCallback + * @user_data: extra user data + * + * Asyncronously get a #GDBusProxy for the object with the given + * @name/@object_path/@interface. + * + * Use pinos_subscribe_get_proxy_finish() to get the result or error in + * @callback. + */ void pinos_subscribe_get_proxy (PinosSubscribe *subscribe, const gchar *name, @@ -780,6 +796,18 @@ pinos_subscribe_get_proxy (PinosSubscribe *subscribe, } } +/** + * pinos_subscribe_get_proxy_finish: + * @subscribe: a #PinosSubscribe + * @res: a #GAsyncResult + * @error: a #GError or %NULL + * + * Get the requested #GDBusProxy. This function should be called in the callback + * of pinos_subscribe_get_proxy() to get the result or error. + * + * Returns: the requested #GDBusProxy. If %NULL is returned, @error will + * be set. + */ GDBusProxy * pinos_subscribe_get_proxy_finish (PinosSubscribe *subscribe, GAsyncResult *res, diff --git a/pinos/server/client-source.c b/pinos/server/client-source.c index e0f50cb4f..d8bf0f053 100644 --- a/pinos/server/client-source.c +++ b/pinos/server/client-source.c @@ -425,6 +425,20 @@ handle_remove_source_input (PinosSourceOutput *output, g_clear_pointer (&priv->input, g_object_unref); } +/** + * pinos_client_source_get_source_input: + * @source: a #PinosClientSource + * @client_path: the client path + * @format_filter: a #GBytes + * @props: extra properties + * @prefix: a path prefix + * @error: a #GError or %NULL + * + * Create a new #PinosSourceOutput that can be used to send data to + * the pinos server. + * + * Returns: a new #PinosSourceOutput. + */ PinosSourceOutput * pinos_client_source_get_source_input (PinosClientSource *source, const gchar *client_path, @@ -503,6 +517,15 @@ pinos_client_source_init (PinosClientSource * source) setup_pipeline (source); } +/** + * pinos_client_source_new: + * @daemon: the parent #PinosDaemon + * @possible_formats: a #GBytes + * + * Make a new #PinosSource that can be used to receive data from a client. + * + * Returns: a new #PinosSource. + */ PinosSource * pinos_client_source_new (PinosDaemon *daemon, GBytes *possible_formats) diff --git a/pinos/server/source-output.c b/pinos/server/source-output.c index bcdf4ca42..744701aaf 100644 --- a/pinos/server/source-output.c +++ b/pinos/server/source-output.c @@ -522,6 +522,13 @@ pinos_source_output_init (PinosSourceOutput * output) g_debug ("source-output %p: new", output); } +/** + * pinos_source_output_remove: + * @output: a #PinosSourceOutput + * + * Remove @output. This will stop the transfer on the output and + * free the resources allocated by @output. + */ void pinos_source_output_remove (PinosSourceOutput *output) { @@ -531,6 +538,14 @@ pinos_source_output_remove (PinosSourceOutput *output) g_signal_emit (output, signals[SIGNAL_REMOVE], 0, NULL); } +/** + * pinos_source_output_get_object_path: + * @output: a #PinosSourceOutput + * + * Get the object patch of @output + * + * Returns: the object path of @source. + */ const gchar * pinos_source_output_get_object_path (PinosSourceOutput *output) { diff --git a/pinos/server/source.c b/pinos/server/source.c index 90373dc8d..7b3cb74b1 100644 --- a/pinos/server/source.c +++ b/pinos/server/source.c @@ -382,6 +382,18 @@ pinos_source_init (PinosSource * source) priv->state = PINOS_SOURCE_STATE_SUSPENDED; } +/** + * pinos_source_get_formats: + * @source: a #PinosSource + * @filter: a #GBytes + * @error: a #GError or %NULL + * + * Get all the currently supported formats for @source and filter the + * results with @filter. + * + * Returns: the list of supported format. If %NULL is returned, @error will + * be set. + */ GBytes * pinos_source_get_formats (PinosSource *source, GBytes *filter, @@ -417,6 +429,15 @@ remove_idle_timeout (PinosSource *source) } } +/** + * pinos_source_set_state: + * @source: a #PinosSource + * @state: a #PinosSourceState + * + * Set the state of @source to @state. + * + * Returns: %TRUE on success. + */ gboolean pinos_source_set_state (PinosSource *source, PinosSourceState state) @@ -438,6 +459,14 @@ pinos_source_set_state (PinosSource *source, return res; } +/** + * pinos_source_update_state: + * @source: a #PinosSource + * @state: a #PinosSourceState + * + * Update the state of a source. This method is used from + * inside @source itself. + */ void pinos_source_update_state (PinosSource *source, PinosSourceState state) @@ -454,6 +483,13 @@ pinos_source_update_state (PinosSource *source, } } +/** + * pinos_source_report_error: + * @source: a #PinosSource + * @error: a #GError + * + * Report an error from within @source. + */ void pinos_source_report_error (PinosSource *source, GError *error) @@ -483,6 +519,13 @@ idle_timeout (PinosSource *source) return G_SOURCE_REMOVE; } +/** + * pinos_source_report_idle: + * @source: a #PinosSource + * + * Mark @source as being idle. This will start a timeout that will + * set the source to SUSPENDED. + */ void pinos_source_report_idle (PinosSource *source) { @@ -498,6 +541,13 @@ pinos_source_report_idle (PinosSource *source) source); } +/** + * pinos_source_report_busy: + * @source: a #PinosSource + * + * Mark @source as being busy. This will set the state of the source + * to the RUNNING state. + */ void pinos_source_report_busy (PinosSource *source) { @@ -506,6 +556,14 @@ pinos_source_report_busy (PinosSource *source) pinos_source_set_state (source, PINOS_SOURCE_STATE_RUNNING); } +/** + * pinos_source_update_possible_formats: + * @source: a #PinosSource + * @formats: a #GBytes + * + * Update the possible formats in @source to @formats. This function also + * updates the possible formats of the outputs. + */ void pinos_source_update_possible_formats (PinosSource *source, GBytes *formats) { @@ -524,6 +582,14 @@ pinos_source_update_possible_formats (PinosSource *source, GBytes *formats) g_object_set (walk->data, "possible-formats", formats, NULL); } +/** + * pinos_source_update_format: + * @source: a #PinosSource + * @format: a #GBytes + * + * Update the current format in @source to @format. This function also + * updates the current format of the outputs. + */ void pinos_source_update_format (PinosSource *source, GBytes *format) { @@ -537,6 +603,20 @@ pinos_source_update_format (PinosSource *source, GBytes *format) g_object_set (walk->data, "format", format, NULL); } +/** + * pinos_source_create_source_output: + * @source: a #PinosSource + * @client_path: the client path + * @format_filter: a #GBytes + * @props: #PinosProperties + * @prefix: a prefix + * @error: a #GError or %NULL + * + * Create a new #PinosSourceOutput for @source. + * + * Returns: a new #PinosSourceOutput or %NULL, in wich case @error will contain + * more information about the error. + */ PinosSourceOutput * pinos_source_create_source_output (PinosSource *source, const gchar *client_path, @@ -566,6 +646,15 @@ pinos_source_create_source_output (PinosSource *source, return res; } +/** + * pinos_source_release_source_output: + * @source: a #PinosSource + * @output: a #PinosSourceOutput + * + * Release the @output in @source. + * + * Returns: %TRUE on success. + */ gboolean pinos_source_release_source_output (PinosSource *source, PinosSourceOutput *output) @@ -586,6 +675,14 @@ pinos_source_release_source_output (PinosSource *source, return res; } +/** + * pinos_source_get_object_path: + * @source: a #PinosSource + * + * Get the object path of @source. + * + * Returns: the object path of @source. + */ const gchar * pinos_source_get_object_path (PinosSource *source) {