[MPlayer-dev-eng] [PATCH] bmovl2: nonblocking input

Jonas Jensen jbj at knef.dk
Sun Nov 9 16:01:05 CET 2003


To follow up on the discussion about the next generation of the bmovl
filter from a few weeks ago, here are my changes to bmovl2, preparing it
for input from multiple file descriptors. The patch is
"mplayer-bmovl2-jbj.patch".

The main thing I have changed is the input layer for handling commands.
Jason Tackaberry's version and the original bmovl did blocking read(2)
calls of one byte at a time when reading a command, making it both
inefficient and fragile. My implementation uses a dynamically growing
input buffer and parses the commands from there.

The main user-visible difference is that bmovl will not just execute one
command (or ATOM) per frame and block on the rest, but it will read as
many commands as possible without blocking and execute them all at once.
It still guarantees that commands in ATOM blocks are executed in one
frame, but they may be sent over multiple frames. This also makes it
possible to send commands over a slow network without stopping the video
playback.

Some clients rely on the write(2) call to the fifo blocking instead of
sleeping between frames, but that isn't possible now. These clients must
use the FRAME command I have added to guarantee that no more commands
will be executed in the current frame. I have modified the bmovl2-test
program (http://people.auc.ca/tack/archive/2003-10/bmovl2-test.tar.gz)
to use the FRAME command, that is in the attached bmovl2-test-jbj.patch
file.

The attached file "diff-between-patches.diff" is for information only,
showing the difference between Jason Tackaberry's last version and mine.

My plans are to add actual multi-fd support to bmovl2 next week if there
are no problems with this code.

-- 
Jonas Jensen <jbj at knef.dk>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bmovl2-test-jbj.patch
Type: text/x-patch
Size: 440 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20031109/1fb99526/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff-between-patches.diff
Type: text/x-patch
Size: 18742 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20031109/1fb99526/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer-bmovl2-jbj.patch
Type: text/x-patch
Size: 29678 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20031109/1fb99526/attachment-0002.bin>


More information about the MPlayer-dev-eng mailing list