index c5a3edda37904b94acf68c2e45e55d9881b826b6..99125c7f0079153dfb7afdeb46fc8a5dbf79986f 100644 (file)
The flushing event is used to clear any data out of the
downstream elements.
+* Generic case
+
Consider the following pipeline:
.-----. .-------. .-------.
fr the same reason. From then on, the new data after the flushing seek
will be queued when the pad block is taken again.
+* Case where the stream is blocking downstream
+
+ The example above is only valid if the elem1.src pad is really blocking
+ (callback called or sync block returned).
+
+ In the case where the stream is blocking further downstream (on elem2.src
+ for example, or on a blocking queue), extra care has to be taken.
+
+ Consider the following pipeline:
+
+ .-----. .-------. .-------.
+ | src | | elem1 |\/ | elem2 |
+ | src -> sink src -> sink src .... Blocking somewhere downstream
+ '-----' '-------'/\ '-------'
+
+ A pad block has been requested by the user on elem1.src , but since the stream
+ is blocking somewhere downstream, the callback is not called or the sync block
+ does not return.
+
+ In order for the block to happen, a FLUSH_START needs to be sent directly on
+ the downstream blocking element/pad so that it releases the stream lock, and it
+ gives a chance for the elem1.src pad to block.
+
Use cases:
----------
4b) send EOS to element2, this makes sure that element2 flushes
out the last bits of data it holds.
4c) wait for EOS to appear in the probe, drop the EOS.
+ 4d) remove the EOS pad event probe.
5) unlink element2 and element3
- 5a) optionally element2 can now be set to NULL.
+ 5a) optionally element2 can now be set to NULL and/or removed from the
+ pipeline.
6) link element4 and element3
7) link element1 and element4 (FIXME, how about letting element4 know
- about the currently running segment?)
- 8) unblock element1 src
+ about the currently running segment?, see issues.)
+ 8) make sure element4 is in the same state as the rest of the elements. The
+ element should at least be PAUSED.
+ 9) unblock element1 src
The same flow can be used to replace an element in a PAUSED pipeline. Only
special care has to be taken when performing step 2) which has to be done
be implemented with a helper function in the future.
+Issues
+------
+
+When an EOS event has passed a pad and the pad is set to blocked, the block will
+never happen because no data is going to flow anymore. One possibility is to
+keep track of the pad's EOS state and make the block succeed immediatly. This is
+not yet implemenented.
+When dynamically reconnecting pads, some events (like NEWSEGMENT, EOS,
+TAGS, ...) are not yet retransmitted to the newly connected element. It's
+unclear if this can be done by core automatically by caching those events and
+resending them on a relink. It might also be possible that this needs a
+GstFlowReturn value from the event function, in which case the implementation
+must be delayed for after 0.11, when we can break API/ABI.