2007-02-13 14:52:47 +00:00
|
|
|
$Id$
|
|
|
|
|
|
|
|
Currently its only save to link/unlink elements/pad when pipeline is in READY.
|
2007-08-27 20:00:39 +00:00
|
|
|
Belowe some thoughts. See http://bugzilla.gnome.org/show_bug.cgi?id=435487
|
|
|
|
for patches.
|
2007-02-13 14:52:47 +00:00
|
|
|
|
|
|
|
= current api =
|
|
|
|
|
|
|
|
gboolean gst_element_link (GstElement *src, GstElement *dest);
|
|
|
|
void gst_element_unlink (GstElement *src, GstElement *dest);
|
|
|
|
|
|
|
|
gst_element_link_many, gst_element_unlink_many, gst_element_link_filtered,
|
|
|
|
gst_element_link_pads, gst_element_unlink_pads, gst_element_link_pads_filtered
|
|
|
|
|
|
|
|
GstPadLinkReturn gst_pad_link (GstPad *srcpad, GstPad *sinkpad);
|
|
|
|
gboolean gst_pad_unlink (GstPad *srcpad, GstPad *sinkpad);
|
|
|
|
|
|
|
|
= use cases =
|
|
|
|
|
|
|
|
== inserting an element ==
|
|
|
|
|
2007-04-02 14:48:12 +00:00
|
|
|
* we have: e1 ! e4
|
|
|
|
* we want: e1 ! e2 ! e3 ! e4
|
|
|
|
* we want: e1 ! e2 ! e4
|
2007-02-13 14:52:47 +00:00
|
|
|
|
2007-04-02 14:48:12 +00:00
|
|
|
gst_element_insert_linked(e1, e2, e3, e4); // e2 == e3 allowed
|
|
|
|
gst_pads_insert_link (e1.src, e2.sink, e3.src, e4.sink);
|
|
|
|
disconnect e1.src, e1.src.peer
|
|
|
|
disconnect e4.sink, e4.sink.peer
|
2007-07-20 07:26:39 +00:00
|
|
|
connect e1.src, e2.sink
|
|
|
|
connect e3.src, e4.sink
|
2007-02-13 14:52:47 +00:00
|
|
|
|
|
|
|
== removing an element ==
|
|
|
|
|
|
|
|
* we have: e1 ! e2 ! e3
|
|
|
|
* we want: e1 ! e3
|
|
|
|
|
|
|
|
gst_element_remove_linked(e2);
|
2007-04-02 14:48:12 +00:00
|
|
|
gst_pads_remove_link (e1.src, e3.sink);
|
|
|
|
disconnect e1.src, e1.src.peer
|
2007-07-20 07:26:39 +00:00
|
|
|
disconnect e3.sink, e3.sink.peer
|
|
|
|
connect e1.src, e3.sink
|
2007-02-13 14:52:47 +00:00
|
|
|
|
|
|
|
== swapping out an elelment ==
|
|
|
|
|
2007-08-27 20:00:39 +00:00
|
|
|
* we have: e1 ! e2 ! e6
|
|
|
|
* we have: e1 ! e2 ! e3 ! e6
|
|
|
|
* we want: e1 ! e4 ! e5 ! e6
|
|
|
|
* we want: e1 ! e3 ! e6
|
2007-04-02 14:48:12 +00:00
|
|
|
|
2007-07-20 07:26:39 +00:00
|
|
|
gst_element_swap_linked(e1, e4, e5, e6);
|
|
|
|
gst_pads_insert_link (e1.src, e4.sink, e5.src, e6.sink);
|
2007-04-02 14:48:12 +00:00
|
|
|
disconnect e1.src, e1.src.peer (=e2.sink)
|
2007-07-20 07:26:39 +00:00
|
|
|
disconnect e6.sink, e6.sink.peer
|
|
|
|
connect e1.src, e4.sink
|
|
|
|
connect e5.src, e6.sink
|
2007-04-02 14:48:12 +00:00
|
|
|
|
2007-02-13 14:52:47 +00:00
|
|
|
= thoughts =
|
|
|
|
* I don't think we need api for pads
|
|
|
|
* Should current api check for the state?
|
2007-04-02 14:48:12 +00:00
|
|
|
* do we want to swapp multiple elements at once
|
2007-02-13 14:52:47 +00:00
|
|
|
|
2007-08-27 20:00:39 +00:00
|
|
|
== events ==
|
|
|
|
* tee and adder need special treatment
|
|
|
|
* both would need to cache an accumulated segment
|
|
|
|
* tee
|
|
|
|
* would also cache tags
|
|
|
|
* when linkfunc is called, it can send out the segment and the tags
|
|
|
|
* when all pads got unlinked it could clear the segment
|
|
|
|
* adder
|
|
|
|
* when linkfunc gets called it sends a seek-event
|
|
|
|
|
|
|
|
= ideas =
|
|
|
|
== dynlinkpoint ==
|
|
|
|
* use cases
|
|
|
|
* its ment to be used with one side disconnected to allow to connect elements
|
|
|
|
at runtime
|
|
|
|
* it can be used in a pipeline to remove/insert elements at runtime
|
|
|
|
* element with 1 source- and 1 sinkpad
|
|
|
|
* when both connected it passes data thru
|
|
|
|
* if src is not connected it drops received buffers
|
|
|
|
* if sink is not conected
|
|
|
|
* it does not push
|
|
|
|
* it creates silence on pull
|
|
|
|
* events
|
|
|
|
* it caches events
|
|
|
|
* down: newsegment, tags, buffersize
|
|
|
|
* up: seek (needs to be modified)
|
|
|
|
* when other-pad get connected it pushes events depending on direction
|