[MPlayer-dev-eng] [PATCH] vf properties

Alban Bedel albeu at free.fr
Wed Feb 20 19:24:29 CET 2008


Hi all,

Here is a patch adding property support for the vf. Basically vf
properties are then accessible via: vf/name/prop where name can be:

- i     : take the filter at the given index (start at 0)
- name  : take the first filter with the given name
- name#i: take the i'th filter with the given name (start at 0)

I have only implemented properties for crop and rotate atm. To test you
can for example add the following to your input.conf:

KP8    step_property vf/crop/y 4 -1 
KP2    step_property vf/crop/y 4  1
KP4    step_property vf/crop/x 4 -1
KP6    step_property vf/crop/x 4  1
KP9    step_property vf/crop/h 0  1
KP3    step_property vf/crop/h 0 -1
KP0    step_property vf/crop/w 0 -1
KP_DEC step_property vf/crop/w 0  1

And you should be able to manipulate the crop filter with the numpad.

To test internaly setting properties I also added some code to allow
cropdetect to automatically set the crop filter. To test use
-vf cropdetect=24:0:1,crop (the third parameter enable autosetting
crop).

A few notes about the implementation:

* vf_reconfig()

I added this function to allow filters to easily config() themself
again after some property changed. However keeping the fullscreen state
is a bit hackish. The problem is that fullscreen can be set via the vo
flags going down the vf chain or directly via control(). This mean
vf_reconfigure() need to call a control() to get the current flags.
A much cleaner solution would be to manipulate the fullscreen state
only via the vf chain, but the GUI is (again) in the way :(

* vf_config_warpper()

I sligthly modified it so that it only save the parameters upon
sucessfull config(). That shouldn't change anything to it's original
purpose: prevent reconfig with different size/format on filters that
don't support it. This was done to allow vf_reconfig() to be used
again even if it fail once.

* vf_cropdetect:put_image()

I moved the get_image() call at the end of the function to avoid
ending up with config() beeing called between get and put_image().

That's all for now, comments are obviously welcome :)

	Albeu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vf_property.diff
Type: text/x-diff
Size: 7985 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20080220/1376f212/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vf_properties_crop_rotate.diff
Type: text/x-diff
Size: 12797 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20080220/1376f212/attachment-0001.diff>


More information about the MPlayer-dev-eng mailing list