use interfaces in client

This commit is contained in:
Wim Taymans 2017-03-03 17:43:23 +01:00
parent e0813b679d
commit b9a0b067be
10 changed files with 1163 additions and 842 deletions

View file

@ -22,9 +22,6 @@
typedef struct {
PinosProxy this;
PinosDispatchFunc dispatch_func;
void *dispatch_data;
} PinosProxyImpl;
PinosProxy *
@ -67,42 +64,3 @@ pinos_proxy_destroy (PinosProxy *proxy)
pinos_log_debug ("proxy %p: free", proxy);
free (impl);
}
void
pinos_proxy_set_dispatch (PinosProxy *proxy,
PinosDispatchFunc func,
void *data)
{
PinosProxyImpl *impl = SPA_CONTAINER_OF (proxy, PinosProxyImpl, this);
impl->dispatch_func = func;
impl->dispatch_data = data;
}
SpaResult
pinos_proxy_send_message (PinosProxy *proxy,
uint32_t opcode,
void *message,
bool flush)
{
return pinos_context_send_message (proxy->context,
proxy,
opcode,
message,
flush);
}
SpaResult
pinos_proxy_dispatch (PinosProxy *proxy,
uint32_t opcode,
void *message)
{
PinosProxyImpl *impl = SPA_CONTAINER_OF (proxy, PinosProxyImpl, this);
if (impl->dispatch_func)
return impl->dispatch_func (proxy, opcode, message, impl->dispatch_data);
pinos_log_error ("proxy %p: dispatch func not implemented", proxy);
return SPA_RESULT_NOT_IMPLEMENTED;
}