mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
add more docs
This commit is contained in:
parent
45976ffeda
commit
108a42c6b3
5 changed files with 175 additions and 0 deletions
|
|
@ -53,6 +53,12 @@ pinos_client_name (void)
|
||||||
return g_strdup_printf ("pinos-pid-%lu", (gulong) getpid ());
|
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
|
void
|
||||||
pinos_fill_context_properties (PinosProperties *properties)
|
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
|
void
|
||||||
pinos_fill_stream_properties (PinosProperties *properties)
|
pinos_fill_stream_properties (PinosProperties *properties)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -742,6 +742,22 @@ compare_data (PinosObjectData *data,
|
||||||
return g_strcmp0 (data->interface_name, interface_name);
|
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
|
void
|
||||||
pinos_subscribe_get_proxy (PinosSubscribe *subscribe,
|
pinos_subscribe_get_proxy (PinosSubscribe *subscribe,
|
||||||
const gchar *name,
|
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 *
|
GDBusProxy *
|
||||||
pinos_subscribe_get_proxy_finish (PinosSubscribe *subscribe,
|
pinos_subscribe_get_proxy_finish (PinosSubscribe *subscribe,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
|
|
|
||||||
|
|
@ -425,6 +425,20 @@ handle_remove_source_input (PinosSourceOutput *output,
|
||||||
g_clear_pointer (&priv->input, g_object_unref);
|
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 *
|
PinosSourceOutput *
|
||||||
pinos_client_source_get_source_input (PinosClientSource *source,
|
pinos_client_source_get_source_input (PinosClientSource *source,
|
||||||
const gchar *client_path,
|
const gchar *client_path,
|
||||||
|
|
@ -503,6 +517,15 @@ pinos_client_source_init (PinosClientSource * source)
|
||||||
setup_pipeline (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 *
|
PinosSource *
|
||||||
pinos_client_source_new (PinosDaemon *daemon,
|
pinos_client_source_new (PinosDaemon *daemon,
|
||||||
GBytes *possible_formats)
|
GBytes *possible_formats)
|
||||||
|
|
|
||||||
|
|
@ -522,6 +522,13 @@ pinos_source_output_init (PinosSourceOutput * output)
|
||||||
g_debug ("source-output %p: new", 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
|
void
|
||||||
pinos_source_output_remove (PinosSourceOutput *output)
|
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);
|
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 *
|
const gchar *
|
||||||
pinos_source_output_get_object_path (PinosSourceOutput *output)
|
pinos_source_output_get_object_path (PinosSourceOutput *output)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -382,6 +382,18 @@ pinos_source_init (PinosSource * source)
|
||||||
priv->state = PINOS_SOURCE_STATE_SUSPENDED;
|
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 *
|
GBytes *
|
||||||
pinos_source_get_formats (PinosSource *source,
|
pinos_source_get_formats (PinosSource *source,
|
||||||
GBytes *filter,
|
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
|
gboolean
|
||||||
pinos_source_set_state (PinosSource *source,
|
pinos_source_set_state (PinosSource *source,
|
||||||
PinosSourceState state)
|
PinosSourceState state)
|
||||||
|
|
@ -438,6 +459,14 @@ pinos_source_set_state (PinosSource *source,
|
||||||
return res;
|
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
|
void
|
||||||
pinos_source_update_state (PinosSource *source,
|
pinos_source_update_state (PinosSource *source,
|
||||||
PinosSourceState state)
|
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
|
void
|
||||||
pinos_source_report_error (PinosSource *source,
|
pinos_source_report_error (PinosSource *source,
|
||||||
GError *error)
|
GError *error)
|
||||||
|
|
@ -483,6 +519,13 @@ idle_timeout (PinosSource *source)
|
||||||
return G_SOURCE_REMOVE;
|
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
|
void
|
||||||
pinos_source_report_idle (PinosSource *source)
|
pinos_source_report_idle (PinosSource *source)
|
||||||
{
|
{
|
||||||
|
|
@ -498,6 +541,13 @@ pinos_source_report_idle (PinosSource *source)
|
||||||
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
|
void
|
||||||
pinos_source_report_busy (PinosSource *source)
|
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_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
|
void
|
||||||
pinos_source_update_possible_formats (PinosSource *source, GBytes *formats)
|
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);
|
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
|
void
|
||||||
pinos_source_update_format (PinosSource *source, GBytes *format)
|
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);
|
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 *
|
PinosSourceOutput *
|
||||||
pinos_source_create_source_output (PinosSource *source,
|
pinos_source_create_source_output (PinosSource *source,
|
||||||
const gchar *client_path,
|
const gchar *client_path,
|
||||||
|
|
@ -566,6 +646,15 @@ pinos_source_create_source_output (PinosSource *source,
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pinos_source_release_source_output:
|
||||||
|
* @source: a #PinosSource
|
||||||
|
* @output: a #PinosSourceOutput
|
||||||
|
*
|
||||||
|
* Release the @output in @source.
|
||||||
|
*
|
||||||
|
* Returns: %TRUE on success.
|
||||||
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
pinos_source_release_source_output (PinosSource *source,
|
pinos_source_release_source_output (PinosSource *source,
|
||||||
PinosSourceOutput *output)
|
PinosSourceOutput *output)
|
||||||
|
|
@ -586,6 +675,14 @@ pinos_source_release_source_output (PinosSource *source,
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pinos_source_get_object_path:
|
||||||
|
* @source: a #PinosSource
|
||||||
|
*
|
||||||
|
* Get the object path of @source.
|
||||||
|
*
|
||||||
|
* Returns: the object path of @source.
|
||||||
|
*/
|
||||||
const gchar *
|
const gchar *
|
||||||
pinos_source_get_object_path (PinosSource *source)
|
pinos_source_get_object_path (PinosSource *source)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue