[MPlayer-dev-eng] [PATCH] vf_bmovl2 - rewrite of vf_bmovl - Extra Tasty Crispy version

Jason Tackaberry tack at auc.ca
Mon Oct 20 06:55:14 CEST 2003


I have been working with the bmovl filter over the past few days and
have come across a few limitations.  For example, I wanted to be able to
animate an overlaid image, but the design of bmovl made it very
difficult to be modified for this task.

So I've worked up a new version of bmovl that has several design
differences.  The original bmovl uses a single bitmap which has the same
dimensions of the video.  This modified version can have up to 10
separate bitmaps of varying sizes and they are overlaid at arbitrary
coordinates.

Another feature of bmovl2 is the introduction of ATOM/ENDATOM commands,
which specify a list of operations to be executed in between frames. 
For example, suppose you want to move an image and adjust its alpha
level.  With bmovl, this would take 2 frames because only one command is
evaluated per frame.  With bmovl2, you just send this to the fifo:

	ATOM
	MOVE 0 100 200
	ALPHA 0 200
	ENDATOM

This would move the image with id 0 to coords 100,200 and set the alpha
level for that image to 100 before the next frame is drawn.  As you can
see, it wouldn't be very difficult to have a nice animated menu that
slides in from off screen and fades in as it's moving.  Or if you're
transitioning menus, as the new menu slides in, it could push the old
menu off the screen as it fades out (by using a second image id).  In
fact, I've already done this and it looks and works great.

bmovl2 can also be updated while mplayer is paused.  This was an
important requirement for me, and I bet freevo will benefit from it as
well.  Additionally, only one bmovl2 filter can be instantiated -- this
was a design decision because I wanted the overlay images to survive a
loadfile command.  While this is contrary to mplayer's filter design
(the ability to chain filters), in practice I strongly doubt it will be
a problem and there are good reasons to only allow one instance.

There is a bit of documentation at the top of vf_bmovl2.c, but I've not
yet patched the man page because I wasn't sure if this has a chance of
being accepted.  If there's interest, I'll update the man pages.  I will
also submit a test program similar to the original bmovl-test.

I made some modifications in mplayer.c that affect timing (to make
updating more responsive while paused) and I might not have a full
appreciation of the impact of those changes.  They strike me as benign,
but they would benefit from more eyeballs.

So I submit this patch for your review and comments.  Consider it a
first draft. :)

Cheers,
Jason.

-- 
Jason Tackaberry  ::  tack at auc.ca  :: 705-949-2301 x330
Academic Computing Support Specialist
Information Technology Services
Algoma University College  ::  www.auc.ca
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bmovl2.patch
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20031020/f48bf576/attachment.txt>


More information about the MPlayer-dev-eng mailing list