This directory contains a diff against the current mplayer (as of
2007/05/30) which adds the "dl" video output device.

Use:
-vo dl:<path-to-so>

where <path-to-so> is the path to a shared object that will be loaded
(.dylib on MacOS X, .dll on Windows, .so on most unices). The object
should implement at least the vo_dump_frame function which is called
for every frame that mplayer plays.


The following functions can be implemented by the client. Only the
vo_dump_frame function is mandatory, all others are optional:

int  vo_dump_frame(void *buf, int w, int h, int f, int chs, int flags);
int  vo_accept_format(int format);
int  vo_begin(int w, int h, int f);
void vo_end(void);

The usual sequence of calls is:

vo_accept_format
vo_begin
vo_dump_frame
vo_dump_frame
...
vo_end

Details:

** vo_accept_format (optional, not present = accept any format)
This function is called to determine which format is viable for the
back-end. mplayer tries several formats in the order of difficulty,
i.e. the first offered formats are likely to be closest to the format
of the source medium.

Parameters:
 format   - format description as fourcc constant
            (e.g. YV12 = 0x32315659)

Return value:
 0  = format rejected
 1  = format accepted

** vo_dump_frame (mandtory)
This function is called for every frame.

Parameters:
 buf   - address of the buffer. The buffer is guaranteed to be at
         least w*h*4 bytes long. The callee is free to modify the
	 buffer as desired. Regardless of its size, each plane starts
	 at w*h*n where n=0,1,2,3 (plane number).
 w     - frame width
 h     - frame height
 f     - format (fourcc code, see accept_format)
 chs   - number of channels
 flags - additional flags (see flags below)

Return value:
 should always return 0

** vo_begin (optional)
This function is called when the format is determined before first
frame is dumped.

Parameters:
 w     - frame width
 h     - frame height
 f     - format

Return value:
 should always return 0

** vo_end (optional)
This function is called when mplayer cleans up before removing the
module.

No parameters or return value.

---
dump_frame flags (bit 0 = LSB)

bit 0-3   Cr x shift (i.e. width of chroma planes is frame_width/2^x_shift)
    4-7   Cr y shift (i.e. height of chroma planes is frame_height/2^y_shift)
    8     interlaced (set when numer of planes=1 and the channels are interlaced)
    9	  inverse channel order
   10-15  0
   16-19  frame type (0=unknown)
   20-32  0

Cr x/y shift is valid only for YCrCb formats.
