mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
remove unused code
This commit is contained in:
parent
4153fac9bb
commit
f743b00f2c
4 changed files with 22 additions and 174 deletions
|
|
@ -202,6 +202,7 @@ on_port_added (PinosNode *node, PinosPort *port, PinosClient *client)
|
||||||
pinos_direction_reverse (port->direction),
|
pinos_direction_reverse (port->direction),
|
||||||
path,
|
path,
|
||||||
NULL,
|
NULL,
|
||||||
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
if (target == NULL) {
|
if (target == NULL) {
|
||||||
|
|
@ -521,7 +522,8 @@ pinos_daemon_find_port (PinosDaemon *daemon,
|
||||||
PinosDirection direction,
|
PinosDirection direction,
|
||||||
const gchar *name,
|
const gchar *name,
|
||||||
PinosProperties *props,
|
PinosProperties *props,
|
||||||
GBytes *format_filter,
|
unsigned int n_format_filters,
|
||||||
|
SpaFormat **format_filters,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
PinosDaemonPrivate *priv;
|
PinosDaemonPrivate *priv;
|
||||||
|
|
@ -534,7 +536,7 @@ pinos_daemon_find_port (PinosDaemon *daemon,
|
||||||
|
|
||||||
have_name = name ? strlen (name) > 0 : FALSE;
|
have_name = name ? strlen (name) > 0 : FALSE;
|
||||||
|
|
||||||
g_debug ("name \"%s\", format %s, %d", name, (gchar*)g_bytes_get_data (format_filter, NULL), have_name);
|
g_debug ("name \"%s\", %d", name, have_name);
|
||||||
|
|
||||||
for (nodes = priv->nodes; nodes; nodes = g_list_next (nodes)) {
|
for (nodes = priv->nodes; nodes; nodes = g_list_next (nodes)) {
|
||||||
PinosNode *n = nodes->data;
|
PinosNode *n = nodes->data;
|
||||||
|
|
@ -554,16 +556,13 @@ pinos_daemon_find_port (PinosDaemon *daemon,
|
||||||
for (ports = pinos_node_get_ports (n); ports; ports = g_list_next (ports)) {
|
for (ports = pinos_node_get_ports (n); ports; ports = g_list_next (ports)) {
|
||||||
PinosPort *p = ports->data;
|
PinosPort *p = ports->data;
|
||||||
PinosDirection dir;
|
PinosDirection dir;
|
||||||
GBytes *format;
|
|
||||||
|
|
||||||
g_object_get (p, "direction", &dir, NULL);
|
g_object_get (p, "direction", &dir, NULL);
|
||||||
if (dir != direction)
|
if (dir != direction)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
format = pinos_port_filter_formats (p, format_filter, NULL);
|
if (pinos_port_have_common_format (p, n_format_filters, format_filters, NULL)) {
|
||||||
if (format != NULL) {
|
|
||||||
g_debug ("port %p matches filter", p);
|
g_debug ("port %p matches filter", p);
|
||||||
g_bytes_unref (format);
|
|
||||||
best = p;
|
best = p;
|
||||||
node_found = TRUE;
|
node_found = TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,8 @@ PinosPort * pinos_daemon_find_port (PinosDaemon *daemon,
|
||||||
PinosDirection direction,
|
PinosDirection direction,
|
||||||
const gchar *name,
|
const gchar *name,
|
||||||
PinosProperties *props,
|
PinosProperties *props,
|
||||||
GBytes *format_filter,
|
unsigned int n_format_filters,
|
||||||
|
SpaFormat **format_filters,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
void pinos_daemon_add_node_factory (PinosDaemon *daemon,
|
void pinos_daemon_add_node_factory (PinosDaemon *daemon,
|
||||||
|
|
|
||||||
|
|
@ -51,10 +51,6 @@ struct _PinosPortPrivate
|
||||||
|
|
||||||
gulong data_id;
|
gulong data_id;
|
||||||
|
|
||||||
GBytes *possible_formats;
|
|
||||||
GBytes *format;
|
|
||||||
PinosProperties *properties;
|
|
||||||
|
|
||||||
PinosBufferCallback received_buffer_cb;
|
PinosBufferCallback received_buffer_cb;
|
||||||
PinosEventCallback received_event_cb;
|
PinosEventCallback received_event_cb;
|
||||||
gpointer received_data;
|
gpointer received_data;
|
||||||
|
|
@ -74,14 +70,10 @@ enum
|
||||||
PROP_NODE,
|
PROP_NODE,
|
||||||
PROP_DIRECTION,
|
PROP_DIRECTION,
|
||||||
PROP_ID,
|
PROP_ID,
|
||||||
PROP_POSSIBLE_FORMATS,
|
|
||||||
PROP_FORMAT,
|
|
||||||
PROP_PROPERTIES,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
SIGNAL_FORMAT_REQUEST,
|
|
||||||
SIGNAL_REMOVE,
|
SIGNAL_REMOVE,
|
||||||
SIGNAL_ACTIVATE,
|
SIGNAL_ACTIVATE,
|
||||||
SIGNAL_DEACTIVATE,
|
SIGNAL_DEACTIVATE,
|
||||||
|
|
@ -191,18 +183,6 @@ pinos_port_get_property (GObject *_object,
|
||||||
g_value_set_uint (value, port->id);
|
g_value_set_uint (value, port->id);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_POSSIBLE_FORMATS:
|
|
||||||
g_value_set_boxed (value, priv->possible_formats);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_FORMAT:
|
|
||||||
g_value_set_boxed (value, priv->format);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_PROPERTIES:
|
|
||||||
g_value_set_boxed (value, priv->properties);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (port, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (port, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
|
@ -235,24 +215,6 @@ pinos_port_set_property (GObject *_object,
|
||||||
port->id = g_value_get_uint (value);
|
port->id = g_value_get_uint (value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_POSSIBLE_FORMATS:
|
|
||||||
if (priv->possible_formats)
|
|
||||||
g_bytes_unref (priv->possible_formats);
|
|
||||||
priv->possible_formats = g_value_dup_boxed (value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_FORMAT:
|
|
||||||
if (priv->format)
|
|
||||||
g_bytes_unref (priv->format);
|
|
||||||
priv->format = g_value_dup_boxed (value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_PROPERTIES:
|
|
||||||
if (priv->properties)
|
|
||||||
pinos_properties_free (priv->properties);
|
|
||||||
priv->properties = g_value_dup_boxed (value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (port, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (port, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
|
@ -290,9 +252,6 @@ pinos_port_finalize (GObject * object)
|
||||||
GList *walk;
|
GList *walk;
|
||||||
|
|
||||||
g_debug ("port %p: finalize", port);
|
g_debug ("port %p: finalize", port);
|
||||||
g_clear_pointer (&priv->possible_formats, g_bytes_unref);
|
|
||||||
g_clear_pointer (&priv->format, g_bytes_unref);
|
|
||||||
g_clear_pointer (&priv->properties, pinos_properties_free);
|
|
||||||
if (priv->received_notify)
|
if (priv->received_notify)
|
||||||
priv->received_notify (priv->received_data);
|
priv->received_notify (priv->received_data);
|
||||||
for (walk = priv->send_datas; walk; walk = g_list_next (walk)) {
|
for (walk = priv->send_datas; walk; walk = g_list_next (walk)) {
|
||||||
|
|
@ -363,48 +322,6 @@ pinos_port_class_init (PinosPortClass * klass)
|
||||||
G_PARAM_CONSTRUCT_ONLY |
|
G_PARAM_CONSTRUCT_ONLY |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class,
|
|
||||||
PROP_POSSIBLE_FORMATS,
|
|
||||||
g_param_spec_boxed ("possible-formats",
|
|
||||||
"Possible Formats",
|
|
||||||
"The possbile formats of the port",
|
|
||||||
G_TYPE_BYTES,
|
|
||||||
G_PARAM_READWRITE |
|
|
||||||
G_PARAM_CONSTRUCT |
|
|
||||||
G_PARAM_STATIC_STRINGS));
|
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class,
|
|
||||||
PROP_FORMAT,
|
|
||||||
g_param_spec_boxed ("format",
|
|
||||||
"Format",
|
|
||||||
"The format of the port",
|
|
||||||
G_TYPE_BYTES,
|
|
||||||
G_PARAM_READWRITE |
|
|
||||||
G_PARAM_CONSTRUCT |
|
|
||||||
G_PARAM_STATIC_STRINGS));
|
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class,
|
|
||||||
PROP_PROPERTIES,
|
|
||||||
g_param_spec_boxed ("properties",
|
|
||||||
"Properties",
|
|
||||||
"The properties of the port",
|
|
||||||
PINOS_TYPE_PROPERTIES,
|
|
||||||
G_PARAM_READWRITE |
|
|
||||||
G_PARAM_CONSTRUCT |
|
|
||||||
G_PARAM_STATIC_STRINGS));
|
|
||||||
|
|
||||||
|
|
||||||
signals[SIGNAL_FORMAT_REQUEST] = g_signal_new ("format-request",
|
|
||||||
G_TYPE_FROM_CLASS (klass),
|
|
||||||
G_SIGNAL_RUN_LAST,
|
|
||||||
0,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
g_cclosure_marshal_generic,
|
|
||||||
G_TYPE_NONE,
|
|
||||||
0,
|
|
||||||
G_TYPE_NONE);
|
|
||||||
|
|
||||||
signals[SIGNAL_REMOVE] = g_signal_new ("remove",
|
signals[SIGNAL_REMOVE] = g_signal_new ("remove",
|
||||||
G_TYPE_FROM_CLASS (klass),
|
G_TYPE_FROM_CLASS (klass),
|
||||||
G_SIGNAL_RUN_LAST,
|
G_SIGNAL_RUN_LAST,
|
||||||
|
|
@ -461,89 +378,25 @@ pinos_port_remove (PinosPort *port)
|
||||||
g_signal_emit (port, signals[SIGNAL_REMOVE], 0, NULL);
|
g_signal_emit (port, signals[SIGNAL_REMOVE], 0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* pinos_port_get_possible_formats:
|
|
||||||
* @port: a #PinosPort
|
|
||||||
*
|
|
||||||
* Get the possible formats of @port
|
|
||||||
*
|
|
||||||
* Returns: the possible formats or %NULL
|
|
||||||
*/
|
|
||||||
GBytes *
|
|
||||||
pinos_port_get_possible_formats (PinosPort *port)
|
|
||||||
{
|
|
||||||
PinosPortPrivate *priv;
|
|
||||||
|
|
||||||
g_return_val_if_fail (PINOS_IS_PORT (port), NULL);
|
|
||||||
priv = port->priv;
|
|
||||||
|
|
||||||
g_signal_emit (port, signals[SIGNAL_FORMAT_REQUEST], 0, NULL);
|
|
||||||
return priv->possible_formats;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pinos_port_get_format:
|
* pinos_port_have_common_format:
|
||||||
* @port: a #PinosPort
|
* @port: a #PinosPort
|
||||||
*
|
|
||||||
* Get the format of @port
|
|
||||||
*
|
|
||||||
* Returns: the format or %NULL
|
|
||||||
*/
|
|
||||||
GBytes *
|
|
||||||
pinos_port_get_format (PinosPort *port)
|
|
||||||
{
|
|
||||||
PinosPortPrivate *priv;
|
|
||||||
|
|
||||||
g_return_val_if_fail (PINOS_IS_PORT (port), NULL);
|
|
||||||
priv = port->priv;
|
|
||||||
|
|
||||||
return priv->format;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* pinos_port_get_properties:
|
|
||||||
* @port: a #PinosPort
|
|
||||||
*
|
|
||||||
* Get the properties of @port
|
|
||||||
*
|
|
||||||
* Returns: the properties or %NULL
|
|
||||||
*/
|
|
||||||
PinosProperties *
|
|
||||||
pinos_port_get_properties (PinosPort *port)
|
|
||||||
{
|
|
||||||
PinosPortPrivate *priv;
|
|
||||||
|
|
||||||
g_return_val_if_fail (PINOS_IS_PORT (port), NULL);
|
|
||||||
priv = port->priv;
|
|
||||||
|
|
||||||
return priv->properties;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* pinos_port_filter_formats:
|
|
||||||
* @port: a #PinosPort
|
|
||||||
* @filter: a #GBytes
|
|
||||||
* @error: a #GError or %NULL
|
* @error: a #GError or %NULL
|
||||||
*
|
*
|
||||||
* Get all the currently supported formats for @port and filter the
|
* Check if @port accepts any of the give formats
|
||||||
* results with @filter.
|
|
||||||
*
|
*
|
||||||
* Returns: the list of supported format. If %NULL is returned, @error will
|
* Returns: %TRUE if there exists a matching format
|
||||||
* be set.
|
|
||||||
*/
|
*/
|
||||||
GBytes *
|
gboolean
|
||||||
pinos_port_filter_formats (PinosPort *port,
|
pinos_port_have_common_format (PinosPort *port,
|
||||||
GBytes *filter,
|
guint n_filter_formats,
|
||||||
GError **error)
|
SpaFormat **filter_formats,
|
||||||
|
GError **error)
|
||||||
{
|
{
|
||||||
PinosPortPrivate *priv;
|
g_return_val_if_fail (PINOS_IS_PORT (port), FALSE);
|
||||||
|
|
||||||
g_return_val_if_fail (PINOS_IS_PORT (port), NULL);
|
return TRUE;
|
||||||
priv = port->priv;
|
|
||||||
|
|
||||||
g_signal_emit (port, signals[SIGNAL_FORMAT_REQUEST], 0, NULL);
|
|
||||||
|
|
||||||
return pinos_format_filter (priv->possible_formats, filter, error);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -90,17 +90,12 @@ gulong pinos_port_add_send_cb (PinosPort *port,
|
||||||
void pinos_port_remove_send_cb (PinosPort *port,
|
void pinos_port_remove_send_cb (PinosPort *port,
|
||||||
gulong id);
|
gulong id);
|
||||||
|
|
||||||
void pinos_port_remove (PinosPort *port);
|
void pinos_port_remove (PinosPort *port);
|
||||||
|
|
||||||
const gchar * pinos_port_get_name (PinosPort *port);
|
|
||||||
PinosProperties * pinos_port_get_properties (PinosPort *port);
|
|
||||||
|
|
||||||
GBytes * pinos_port_get_possible_formats (PinosPort *port);
|
|
||||||
GBytes * pinos_port_filter_formats (PinosPort *port,
|
|
||||||
GBytes *filter,
|
|
||||||
GError **error);
|
|
||||||
GBytes * pinos_port_get_format (PinosPort *port);
|
|
||||||
|
|
||||||
|
gboolean pinos_port_have_common_format (PinosPort *port,
|
||||||
|
guint n_filter_formats,
|
||||||
|
SpaFormat **filter_formats,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
void pinos_port_activate (PinosPort *port);
|
void pinos_port_activate (PinosPort *port);
|
||||||
void pinos_port_deactivate (PinosPort *port);
|
void pinos_port_deactivate (PinosPort *port);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue