5 What I propose for EOS condition is th following: As is stands, EOS is a
6 flag in a buffer. However, it's also a signal from an element, which is
7 odd. What I propose is that EOS become a pad thing. Here's how it would
10 When a source has a final buffer, it marks it as EOS. It passes this on
11 through the pad, and the pads set a 'pending' EOS state on the way
12 through. When another push or pull happens, only then does the pad signal
13 EOS. This means that EOS doesn't happen until the buffer has passed all
14 the way to the end, and a request for another buffer is starting to work
15 its way back. It gets stopped almost immediately.
17 This gets a bit messy in complex cases, haven't thought them all out.
18 Assuming everything is reasonably symmetric, it should work out cleanly.
19 We may have to add the ability to force buffers to pass even post EOS, but
20 that sounds like a hack.
28 ------------ |-------|
30 ------------------------ / ------------ | |
31 | video0|------/ ------------- | | -------------
32 | | -| subtitle0 |-----| merge |-------| videosink |
33 | subtitle0|------/ ------------- | | -------------
34 ---------- | | ------------- | |
35 | dvdsrc |---| mpeg2parse subtitle1|--------| subtitle1 |-----| |
36 ---------- | | ------------- |-------|
37 | audio0|--------\ ----------- |----------|
38 | | -| ac3dec0 |-----| |
39 | audio1|-------\ ----------- | | -------------
40 ------------------------ \ ----------- | switcher |----| audiosink |
41 -| ac3dec1 |-----| | -------------
42 ----------- |----------|
44 When dvdsrc reads its last buffer, it sets EOS on the buffer and passes it. The pad (probably audio1,
45 since video and audio are interleaved and subtitles don't usually end up at the end of a movie) would
46 set EOS pending, and pass it to mpeg2dec which would pass the EOS to the merge. Merge would then ask
47 for a buffer from subtitle1, since that's the one we're showing subtitles on right now. It would then
48 pull from the mpeg2parse. This would cause a switch back the parser, who's next task is to go and set
49 all the output pads to EOS. It may have to accomplish this by sending a zero-byte buffer.
51 Well, this example isn't actually very good. I'll go ahead and implement it, and we can see what
52 happens. The current setup is so lacking that anything is better....