Fix proxy ids

The proxy/resource ids are generated by the client and so we need to
used them as index in the client resource map instead of making our own
number.
Fix stream disconnect and client-node destroy
Fix gstreamer device provider
Make all sockets non-blocking to avoid errors with bad clients
Advertise the subsystems we monitor and disable the gstreamer monitors.
Implement core properties updates
Make sure we send REMOVE_ID after we are done with the resource.
This commit is contained in:
Wim Taymans 2017-01-20 15:53:03 +01:00
parent e579efea10
commit 4b55d7c4da
18 changed files with 222 additions and 69 deletions

View file

@ -74,14 +74,15 @@ typedef struct
PinosStreamFlags flags;
bool disconnecting;
PinosStreamMode mode;
int rtfd;
SpaSource *rtsocket_source;
PinosProxy *node_proxy;
bool disconnecting;
PinosListener node_proxy_destroy;
PinosTransport *trans;
SpaSource *timeout_source;
@ -845,6 +846,18 @@ stream_dispatch_func (void *object,
return SPA_RESULT_OK;
}
static void
on_node_proxy_destroy (PinosListener *listener,
PinosProxy *proxy)
{
PinosStreamImpl *impl = SPA_CONTAINER_OF (listener, PinosStreamImpl, node_proxy_destroy);
PinosStream *this = &impl->this;
impl->disconnecting = false;
impl->node_proxy = NULL;
stream_set_state (this, PINOS_STREAM_STATE_UNCONNECTED, NULL);
}
/**
* pinos_stream_connect:
* @stream: a #PinosStream
@ -897,6 +910,10 @@ pinos_stream_connect (PinosStream *stream,
if (impl->node_proxy == NULL)
return false;
pinos_signal_add (&impl->node_proxy->destroy_signal,
&impl->node_proxy_destroy,
on_node_proxy_destroy);
pinos_proxy_set_dispatch (impl->node_proxy,
stream_dispatch_func,
impl);
@ -1002,9 +1019,18 @@ bool
pinos_stream_disconnect (PinosStream *stream)
{
PinosStreamImpl *impl = SPA_CONTAINER_OF (stream, PinosStreamImpl, this);
PinosMessageDestroy msg;
impl->disconnecting = true;
unhandle_socket (stream);
msg.seq = ++impl->seq;
pinos_proxy_send_message (impl->node_proxy,
PINOS_MESSAGE_DESTROY,
&msg,
true);
return true;
}