[gst-devel] Autoplugging with multiple sinks

Richard Boulton richard.boulton at open.muscat.com
Thu Sep 14 02:25:52 CEST 2000


On Wed, Sep 13, 2000 at 12:19:48PM -0400, Myers W. Carpenter wrote:
> 	Here's one idea: you don't have gst_type_get_sink_to_src (or you do
> have it but not as implemented), but a gst_type_get_point_to_point,
> where you can attempt to connect two points.  As it comes up with a new
> path it checks for other connections from the first point and sees if it
> can also us those.
> 
> 	You could still have a gst_type_get_sink_to_src but it's only for
> simple cases.

Yes, I think that's the right kind of way to go.  A full scheme might be:

  Users build a pipeline out of various elements, and also specify
  connections between them.  These connections are allowed to be between
  incompatible pad types (the connections get modified later to be valid).

  The user then calls an autoplug function on the pipeline:

    As a special case, if there is one and only one sink node, or one and
    only one source node, the system will now automatically put a link from
    the sink to the sources, or the sinks to the source.

    We now have a network describing what the user wants to happen, but
    with some connections needing to have intermediate nodes added to make
    them valid.

    The system then loops over each connection in the network, checking
    whether the types are compatible.  If not, it calculates a valid path
    from one node to the next (using a gst_type_get_point_to_point()
    function), and replaces the connection with the path calculated.

    As an improvement, probably to be implemented once the above is
    working, the system could try and calculate paths from each node to
    the next nodes which share as much of the pathway as possible.  A naive
    algorithm would be to calculate all the paths possible and pick the
    "cheapest" one.

Calling the autoplug function could even be made implicit - if the network
has no invalid connections, nothing will happen.

What do you think?  Should I try and code it? ;-)
(Not that I think I'd be able to get it going in a short period of time,
but...)

-- 
Richard



More information about the gstreamer-devel mailing list