remove spalib

This commit is contained in:
Wim Taymans 2018-08-14 12:33:53 +02:00
parent f532fd8681
commit a6ad8f747f
69 changed files with 612 additions and 1250 deletions

View file

@ -61,7 +61,6 @@ pipewire_module_protocol_native = shared_library('pipewire-module-protocol-nativ
'module-protocol-native/connection.c' ],
c_args : pipewire_module_c_args,
include_directories : [configinc, spa_inc],
link_with : spalib,
install : true,
install_dir : modules_install_dir,
dependencies : [mathlib, dl_lib, pipewire_dep],
@ -74,7 +73,6 @@ pipewire_module_audio_dsp = shared_library('pipewire-module-audio-dsp',
'spa/spa-node.c' ],
c_args : pipewire_module_c_args,
include_directories : [configinc, spa_inc],
link_with : spalib,
install : true,
install_dir : modules_install_dir,
dependencies : [mathlib, dl_lib, rt_lib, pipewire_dep],

View file

@ -32,8 +32,8 @@
#include <spa/buffer/alloc.h>
#include <spa/pod/parser.h>
#include <spa/param/audio/format-utils.h>
#include <spa/lib/pod.h>
#include <spa/debug/pod.h>
#include <spa/debug/format.h>
#include "pipewire/core.h"
#include "pipewire/pipewire.h"
@ -45,8 +45,6 @@
#include "client-node.h"
#include "client-stream.h"
#include <spa/lib/debug.h>
/** \cond */
struct type {
@ -349,14 +347,10 @@ static int debug_params(struct impl *impl, struct spa_node *node,
struct pw_type *t = impl->t;
struct spa_pod_builder b = { 0 };
uint8_t buffer[4096];
uint32_t state, flag;
struct spa_pod *format;
uint32_t state;
struct spa_pod *param;
int res;
flag = 0;
if (id == t->param.idEnumFormat)
flag |= SPA_DEBUG_FLAG_FORMAT;
spa_log_error(this->log, "params %s:", spa_type_map_get_type(t->map, id));
state = 0;
@ -365,18 +359,18 @@ static int debug_params(struct impl *impl, struct spa_node *node,
res = spa_node_port_enum_params(node,
direction, port_id,
id, &state,
NULL, &format, &b);
NULL, &param, &b);
if (res <= 0) {
if (res < 0)
spa_log_error(this->log, " error: %s", spa_strerror(res));
break;
}
spa_debug_pod(format, flag);
spa_debug_pod(2, t->map, param);
}
spa_log_error(this->log, "failed filter:");
if (filter)
spa_debug_pod(filter, flag);
spa_debug_pod(2, t->map, filter);
return 0;
}
@ -417,7 +411,7 @@ static int negotiate_format(struct impl *impl)
}
spa_pod_fixate(format);
spa_debug_pod(format, SPA_DEBUG_FLAG_FORMAT);
spa_debug_format(0, t->map, format);
if ((res = spa_node_port_set_param(impl->adapter_mix,
SPA_DIRECTION_REVERSE(impl->direction), 0,

View file

@ -28,9 +28,7 @@
#include <spa/node/node.h>
#include <spa/utils/hook.h>
#include <spa/param/audio/format-utils.h>
#include <spa/lib/pod.h>
#include <spa/lib/debug.h>
#include <spa/debug/format.h>
#include "pipewire/core.h"
#include "pipewire/control.h"
@ -666,7 +664,7 @@ static int collect_audio_format(void *data, uint32_t id,
return 0;
spa_pod_fixate(param);
spa_debug_pod(param, SPA_DEBUG_FLAG_FORMAT);
spa_debug_format(0, impl->t->map, param);
if (spa_format_audio_raw_parse(param, &info, &impl->type.format_audio) < 0)
return 0;

View file

@ -29,9 +29,6 @@
#include <spa/utils/hook.h>
#include <spa/param/audio/format-utils.h>
#include <spa/lib/pod.h>
#include <spa/lib/debug.h>
#include "pipewire/core.h"
#include "pipewire/link.h"
#include "pipewire/log.h"

View file

@ -28,7 +28,7 @@
#include <sys/file.h>
#include <spa/pod/iter.h>
#include <spa/lib/debug.h>
#include <spa/debug/pod.h>
#include "config.h"
@ -233,7 +233,7 @@ process_messages(struct client_data *data)
if (debug_messages) {
fprintf(stderr, "<<<<<<<<< in: %d %d %d\n", id, opcode, size);
spa_debug_pod((struct spa_pod *)message, 0);
spa_debug_pod(0, core->type.map, (struct spa_pod *)message);
}
if (demarshal[opcode].func(resource, message, size) < 0)
goto invalid_message;
@ -344,7 +344,7 @@ static struct pw_client *client_new(struct server *s, int fd)
if (this->source == NULL)
goto no_source;
this->connection = pw_protocol_native_connection_new(fd);
this->connection = pw_protocol_native_connection_new(protocol->core, fd);
if (this->connection == NULL)
goto no_connection;
@ -567,7 +567,7 @@ on_remote_data(void *data, int fd, enum spa_io mask)
}
if (debug_messages) {
fprintf(stderr, "<<<<<<<<< in: %d %d %d\n", id, opcode, size);
spa_debug_pod((struct spa_pod *)message, 0);
spa_debug_pod(0, core->type.map, (struct spa_pod *)message);
}
if (demarshal[opcode].func(proxy, message, size) < 0) {
pw_log_error ("protocol-native %p: invalid message received %u for %u", this,
@ -611,7 +611,7 @@ static int impl_connect_fd(struct pw_protocol_client *client, int fd)
impl->disconnecting = false;
impl->connection = pw_protocol_native_connection_new(fd);
impl->connection = pw_protocol_native_connection_new(remote->core, fd);
if (impl->connection == NULL)
goto error_close;

View file

@ -25,7 +25,7 @@
#include <unistd.h>
#include <sys/socket.h>
#include <spa/lib/debug.h>
#include <spa/debug/pod.h>
#include <pipewire/pipewire.h>
#include <pipewire/private.h>
@ -59,6 +59,8 @@ struct impl {
uint32_t dest_id;
uint8_t opcode;
struct spa_pod_builder builder;
struct pw_core *core;
};
/** \endcond */
@ -193,7 +195,7 @@ static void clear_buffer(struct buffer *buf)
*
* \memberof pw_protocol_native_connection
*/
struct pw_protocol_native_connection *pw_protocol_native_connection_new(int fd)
struct pw_protocol_native_connection *pw_protocol_native_connection_new(struct pw_core *core, int fd)
{
struct impl *impl;
struct pw_protocol_native_connection *this;
@ -216,6 +218,7 @@ struct pw_protocol_native_connection *pw_protocol_native_connection_new(int fd)
impl->in.buffer_data = malloc(MAX_BUFFER_SIZE);
impl->in.buffer_maxsize = MAX_BUFFER_SIZE;
impl->in.update = true;
impl->core = core;
if (impl->out.buffer_data == NULL || impl->in.buffer_data == NULL)
goto no_mem;
@ -432,7 +435,7 @@ pw_protocol_native_connection_end(struct pw_protocol_native_connection *conn,
if (debug_messages) {
fprintf(stderr, ">>>>>>>>> out: %d %d %d\n", impl->dest_id, impl->opcode, size);
spa_debug_pod((struct spa_pod *)p, 0);
spa_debug_pod(0, impl->core->type.map, (struct spa_pod *)p);
}
spa_hook_list_call(&conn->listener_list,
struct pw_protocol_native_connection_events, need_flush, 0);

View file

@ -61,7 +61,7 @@ pw_protocol_native_connection_add_listener(struct pw_protocol_native_connection
}
struct pw_protocol_native_connection *
pw_protocol_native_connection_new(int fd);
pw_protocol_native_connection_new(struct pw_core *core, int fd);
void
pw_protocol_native_connection_destroy(struct pw_protocol_native_connection *conn);

View file

@ -29,8 +29,6 @@
#include <fcntl.h>
#include <sys/file.h>
#include <spa/lib/debug.h>
#include <pipewire/pipewire.h>
#include <pipewire/private.h>

View file

@ -25,8 +25,6 @@
#include <unistd.h>
#include <sys/socket.h>
#include <spa/lib/debug.h>
#include <pipewire/pipewire.h>
#include <pipewire/private.h>

View file

@ -31,7 +31,6 @@
#include <spa/node/node.h>
#include <spa/monitor/monitor.h>
#include <spa/pod/parser.h>
#include <spa/lib/debug.h>
#include <pipewire/log.h>
#include <pipewire/type.h>