[MPlayer-dev-eng] [PATCH] vf_osd take two

Jason Tackaberry tack at sault.org
Tue Sep 6 22:44:01 CEST 2005


Hi,

Based on feedback received on the list over the summer, I've made
numerous changes to the vf_osd patch.  vf_osd implements a filter that
provides an custom OSD buffer to an application controlling MPlayer in
slave mode.  The features and interface is similar to the OSD of the
Hauppauge PVR-350 and likely other hardware.  Here is an outline of
changes made to address the comments made (particularly by Michael and
Oded):

      * Removed some global variables.  (Can't eliminate all because of
        the persistent nature of vf_osd instances.  See code comments
        for further explanation.)
      * Added runtime detection of MMX.
      * Removed emms from one of the inner loops and put it some place
        more sane.
      * Specified output operands in inline mmx; no longer modifying
        input operands.
      * Cleaned up some of the mmx code (use MANGLE macro in places).
      * Made width/height parameters optional.  If not specified, OSD
        becomes the video destination size.
      * doxygenified the code and added considerably more code
        documentation.
      * Removed vf_osd_pause_update() function and instead added a
        VFCTRL_PAUSE_UPDATE vf control.  This is called inside the pause
        loop as well as the sleep loop.  (The latter is needed so that
        the OSD can be updated independent of the video frame rate.)
      * Call vf_get_image() in put_image() even when OSD is disabled.

Some general remarks:

      * To clarify why the OSD size arguments exist at all (Oded had
        asked): one important requirement of vf_osd is that things work
        properly when a loadfile command is issued.  When specifying the
        OSD size, the application can rely on a persistent OSD buffer no
        matter what video is playing.  (When OSD size is specified,
        then, it's expected MPlayer will be called with -vf
        scale,expand.)  This patch adds the ability to not specify OSD
        size, in which case a new buffer will be created for each
        differently-sized video loaded by loadfile.  This might be ok
        for simple OSDs, but a more complex OSD (such as a menu-based
        one like Freevo will implement) will prefer to specify OSD
        dimensions.
      * Oded suggested I remove the command filter (which handles
        "osdcmd" slave commands) and handle everything through
        vfilter->control.  I didn't implement that since it seemed
        unclean to add filter-specific code to mplayer.c.  I actually
        think it makes more sense to change vf_rectangle to add its own
        command filter and handle CHANGE_RECTANGLE.  (Note that vf_menu
        does it this way, so it didn't seem to me to be a misused
        feature.)
      * Colorspace conversion from BGRA to "YV12A" is done internally
        because Swscaler doesn't handle alpha channels.  Michael
        suggested I extend swscaler to support this, but I think this is
        beyond my abilities.  Similarly for "unfixed" OSD sizes (i.e.
        OSD buffer resizes based on dest video size when OSD size is not
        specified on cmd line): I am presently using Swscaler to scale
        the mpi to the OSD resolution and then blending them, but if
        Swscaler's BGR32->BGR32 had an option to also handle the alpha
        channel, I could instead scale the OSD to the mpi.

I hope this addresses most of the concerns.  The attached patch is
diffed against current CVS.  Please let me know of any further changes
that should be made -- merging it would be nice too. :)

Cheers,
Jason.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: osd-2005-09-06.diff
Type: text/x-patch
Size: 75538 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20050906/b4eaf0e2/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 229 bytes
Desc: This is a digitally signed message part
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20050906/b4eaf0e2/attachment.pgp>


More information about the MPlayer-dev-eng mailing list