2002-04-13 02:09:18 +00:00
|
|
|
libvo --- the library to handle video output by A'rpi, 2002.04
|
|
|
|
============================================
|
|
|
|
|
|
|
|
Note: before start on this, read colorspaces.txt !
|
|
|
|
|
|
|
|
The constants for different pixelformats are defined in img_format.h,
|
|
|
|
their usage is mandatory.
|
|
|
|
|
|
|
|
Each vo driver _has_ to implement these:
|
|
|
|
|
|
|
|
preinit():
|
|
|
|
init the video system (to support querying for supported formats)
|
|
|
|
|
|
|
|
uninit():
|
|
|
|
Uninit the whole system, this is on the same "level" as preinit.
|
|
|
|
|
|
|
|
control():
|
|
|
|
Current controls:
|
|
|
|
VOCTRL_QUERY_FORMAT - queries if a given pixelformat is supported.
|
|
|
|
It also returns various flags decsirbing the capabilities
|
|
|
|
of the driver with teh given mode. for the flags, see
|
|
|
|
file vfcaps.h !
|
|
|
|
the most important flags, every driver must properly report
|
|
|
|
these:
|
|
|
|
0x1 - supported (with or without conversion)
|
|
|
|
0x2 - supported without conversion (define 0x1 too!)
|
|
|
|
0x100 - driver/hardware handles timing (blocking)
|
|
|
|
also SET sw/hw scaling and osd support flags, and flip,
|
2002-07-30 17:41:11 +00:00
|
|
|
and accept_stride if you implement VOCTRL_DRAW_IMAGE (see bellow)
|
2002-04-13 02:09:18 +00:00
|
|
|
NOTE: VOCTRL_QUERY_FORMAT may be called _before_ first config()
|
|
|
|
but is always called between preinit() and uninit()
|
|
|
|
VOCTRL_GET_IMAGE
|
|
|
|
libmpcodecs Direct Rendering interface
|
|
|
|
You need to update mpi (mp_image.h) structure, for example,
|
|
|
|
look at vo_x11, vo_sdl, vo_xv or mga_common.
|
2002-07-30 17:41:11 +00:00
|
|
|
VOCTRL_DRAW_IMAGE
|
2002-04-13 02:09:18 +00:00
|
|
|
replacement for the current draw_slice/draw_frame way of
|
|
|
|
passing video frames. by implementing SET_IMAGE, you'll get
|
|
|
|
image in mp_image struct instead of by calling draw_*.
|
2002-07-30 17:41:11 +00:00
|
|
|
unless you return VO_TRUE for VOCTRL_DRAW_IMAGE call, the
|
2002-04-13 02:09:18 +00:00
|
|
|
old-style draw_* functils will be called!
|
|
|
|
Note: draw_slice is still mandatory, for per-slice rendering!
|
|
|
|
VOCTRL_RESET - reset the video device
|
|
|
|
This is sent on seeking and similar and is useful if you are
|
|
|
|
using a device which prebuffers frames that need to flush them
|
|
|
|
before refilling audio/video buffers.
|
|
|
|
VOCTRL_PAUSE
|
|
|
|
VOCTRL_RESUME
|
|
|
|
VOCTRL_GUISUPPORT
|
|
|
|
return true only if driver supports co-operation with
|
|
|
|
MPlayer's GUI (not yet used by GUI)
|
2002-07-26 12:22:49 +00:00
|
|
|
VOCTRL_SET_EQUALIZER
|
|
|
|
set the video equalizer to the given values
|
|
|
|
two arguments are provided: item and value
|
|
|
|
item is a string, the possible values are (currently):
|
|
|
|
brightness, contrast, saturation, hue
|
|
|
|
VOCTRL_GET_EQUALIZER
|
|
|
|
get the current video equalizer values
|
|
|
|
two arguments are provided: item and value
|
2003-11-30 16:36:10 +00:00
|
|
|
item is a string, the possible values are (currently):
|
2002-07-26 12:22:49 +00:00
|
|
|
brightness, contrast, saturation, hue
|
2003-11-30 16:36:10 +00:00
|
|
|
VOCTRL_ONTOP
|
|
|
|
Makes the player window stay-on-top. Only supported (currently)
|
|
|
|
by drivers which use X11, except SDL, as well as directx and
|
|
|
|
gl2 under Windows.
|
2005-11-10 22:25:54 +00:00
|
|
|
VOCTRL_BORDER
|
|
|
|
Makes the player window borderless. Only supported by directx.
|
2002-04-13 02:09:18 +00:00
|
|
|
|
|
|
|
config():
|
|
|
|
Set up the video system. You get the dimensions and flags.
|
|
|
|
width, height: size of the source image
|
|
|
|
d_width, d_height: wanted scaled/display size (it's a hint)
|
|
|
|
Flags:
|
|
|
|
0x01 - force fullscreen (-fs)
|
|
|
|
0x02 - allow mode switching (-vm)
|
|
|
|
0x04 - allow software scaling (-zoom)
|
|
|
|
0x08 - flipping (-flip)
|
|
|
|
They're defined as VOFLAG_* (see libvo/video_out.h)
|
|
|
|
|
|
|
|
IMPORTAMT NOTE: config() may be called 0 (zero), 1 or more (2,3...)
|
|
|
|
times between preinit() and uninit() calls. You MUST handle it, and
|
|
|
|
you shouldn't crash at second config() call or at uninit() without
|
|
|
|
any config() call! To make your life easier, vo_config_count is
|
|
|
|
set to the number of previous config() call, counted from preinit().
|
|
|
|
It's set by the caller (vf_vo.c), you don't have to increase it!
|
|
|
|
So, you can check for vo_config_count>0 in uninit() when freeing
|
|
|
|
resources allocated in config() to avoid crash!
|
|
|
|
|
2003-09-21 10:47:19 +00:00
|
|
|
You should call geometry() in config() to enable user defined
|
|
|
|
window size and position. The code should look as following:
|
|
|
|
---
|
|
|
|
set x,y,w,h to the values supplied by the caller or to those you deam
|
|
|
|
usefull.
|
|
|
|
call geometry(&x, &y, &w, &h, screenw, screenh)
|
|
|
|
call aspect()
|
|
|
|
---
|
|
|
|
see libvo/geometry.c for further information
|
|
|
|
|
2002-04-13 02:09:18 +00:00
|
|
|
draw_slice(): this displays YV12 pictures (3 planes, one full sized that
|
|
|
|
contains brightness (Y), and 2 quarter-sized which the colour-info
|
|
|
|
(U,V). MPEG codecs (libmpeg2, opendivx) use this. This doesn't have
|
|
|
|
to display the whole frame, only update small parts of it.
|
|
|
|
|
|
|
|
draw_frame(): this is the older interface, this displays only complete
|
|
|
|
frames, and can do only packed format (YUY2, RGB/BGR).
|
|
|
|
Win32 codecs use this (DivX, Indeo, etc).
|
2002-07-30 17:41:11 +00:00
|
|
|
If you implement VOCTRL_DRAW_IMAGE, you can left draw_frame.
|
2002-04-13 02:09:18 +00:00
|
|
|
|
|
|
|
draw_osd(): this displays subtitles and OSD.
|
|
|
|
It's a bit tricky to use it, since it's a callback-style stuff.
|
|
|
|
It should call vo_draw_text() with screen dimension and your
|
|
|
|
draw_alpha implementation for the pixelformat (function pointer).
|
|
|
|
The vo_draw_text() checks the characters to draw, and calls
|
|
|
|
draw_alpha() for each. As a help, osd.c contains draw_alpha for
|
|
|
|
each pixelformats, use this if possible!
|
|
|
|
|
|
|
|
NOTE: this one will be obsolete soon! But it's still usefull when
|
|
|
|
you want to do tricks, like rendering osd _after_ hardware scaling
|
|
|
|
(tdfxfb) or render subtitles under of the image (vo_mpegpes, sdl)
|
|
|
|
|
|
|
|
flip_page(): this is called after each frame, this diplays the buffer for
|
2004-07-19 22:46:01 +00:00
|
|
|
real. This is 'swapbuffers' when doublebuffering.
|
2002-04-13 02:09:18 +00:00
|
|
|
|