[Nice] API thoughts

Olivier Crête olivier.crete at collabora.co.uk
Tue Apr 15 10:24:51 PDT 2008

On Tue, 2008-04-15 at 18:14 +0300, Kai.Vehmanen at nokia.com wrote:
> Hi,
> On 11 April 2008,  Dafydd Harries wrote:
> >Our current idea is to have a new pair of agent methods:
> [...]
> >  GMainContext *
> >  nice_agent_make_recv_context (
> >      NiceAgent *agent,
> >      guint stream_id,
> >      guint component_id,
> >      NiceAgentRecvFunc func,
> >      gpointer data);
> [...]
> >The first would create a GMainContext with a GSource for each 
> >of the indicated stream's candidates, suitable for a GstSource 
> >to run in a mainloop. This provides the ability to stop 
> >waiting at any time using g_main_loop_quit ().
> ... or I guess a set of GSources related to one stream/component
> (multiple
> candidates may share the same socket)?

Can they, isn't it one socket per component?

> In principle this sounds good (in fact
> 'agent.c:priv_attach_new_stream()'
> already creates the GSources this way), but I'm a bit worried about 
> how this works for clients which don't want to use different threads
> for diffenrt stream/components.
> Could we somehow support both models? Or is there a way to run
> a set of GMainContexts in a single GMainloop (without writing
> a custom GSource for this purpose)...?

Maybe we should have a function that takes a GMainContext as an argument
(or NULL, in which case it would get the default one) and return a
src_id for that context. With the proposed api, there is no way to
disconnect a source.

Olivier Crête
olivier.crete at collabora.co.uk
Collabora Ltd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/nice/attachments/20080415/2f0e69a2/attachment.pgp 

More information about the Nice mailing list