summaryrefslogtreecommitdiffstats
path: root/DOCS/tech/libvo.txt
diff options
context:
space:
mode:
Diffstat (limited to 'DOCS/tech/libvo.txt')
-rw-r--r--DOCS/tech/libvo.txt232
1 files changed, 116 insertions, 116 deletions
diff --git a/DOCS/tech/libvo.txt b/DOCS/tech/libvo.txt
index 945aeab952..245d29eade 100644
--- a/DOCS/tech/libvo.txt
+++ b/DOCS/tech/libvo.txt
@@ -17,7 +17,7 @@ approaches closer to the sometimes convoluted way DirectX works.
Each vo driver _has_ to implement these:
preinit():
- init the video system (to support querying for supported formats)
+ init the video system (to support querying for supported formats)
uninit():
Uninit the whole system, this is on the same "level" as preinit.
@@ -26,95 +26,95 @@ Each vo driver _has_ to implement these:
Current controls (VOCTRL_QUERY_FORMAT must be implemented,
VOCTRL_DRAW_IMAGE, VOCTRL_FULLSCREEN, VOCTRL_UPDATE_SCREENINFO
should be implemented):
- 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,
- and accept_stride if you implement VOCTRL_DRAW_IMAGE (see bellow)
- 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.
- VOCTRL_DRAW_IMAGE
- 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_*.
- unless you return VO_TRUE for VOCTRL_DRAW_IMAGE call, the
- 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)
- 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
- item is a string, the possible values are (currently):
- brightness, contrast, saturation, hue
- 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.
- VOCTRL_BORDER
- Makes the player window borderless.
- VOCTRL_FULLSCREEN
- Switch from and to fullscreen mode
- VOCTRL_GET_PANSCAN
- VOCTRL_SET_PANSCAN
+ 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,
+ and accept_stride if you implement VOCTRL_DRAW_IMAGE (see bellow)
+ 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.
+ VOCTRL_DRAW_IMAGE
+ 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_*.
+ unless you return VO_TRUE for VOCTRL_DRAW_IMAGE call, the
+ 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)
+ 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
+ item is a string, the possible values are (currently):
+ brightness, contrast, saturation, hue
+ 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.
+ VOCTRL_BORDER
+ Makes the player window borderless.
+ VOCTRL_FULLSCREEN
+ Switch from and to fullscreen mode
+ VOCTRL_GET_PANSCAN
+ VOCTRL_SET_PANSCAN
Needed to implement pan-scan support ('w' and 'e' keys during
- playback in fullscreen mode)
- VOCTRL_START_SLICE
- Called before the first draw_slice of each frame, useful if
- you need to do some set-up work.
- VOCTRL_DRAW_EOSD
- Required for EOSD (ASS subtitle) support. Provides all
- information necessary to draw the EOSD for the current video
- frame.
- VOCTRL_GET_EOSD_RES
- Required for EOSD (ASS subtitle) support. Informs the ASS
- renderer about the properties of the drawing area (size,
- borders).
- VOCTRL_SET_DEINTERLACE
- VOCTRL_GET_DEINTERLACE
- Get or set deinterlacing status for VOs that support some kind
- of deinterlacing.
- VOCTRL_UPDATE_SCREENINFO
- Should set the xinerama_x, xinerama_y, vo_screenwidth and
- vo_screenheight appropriately for the currently used
- monitor and -xineramascreen option.
- Usually should simply call the w32_update_xinerama_info or
- update_xinerama_info function.
- By supporting this, the VO also requests the newer API
- that sets vo_dx, vo_dy etc. appropriately before config()
- is called.
+ playback in fullscreen mode)
+ VOCTRL_START_SLICE
+ Called before the first draw_slice of each frame, useful if
+ you need to do some set-up work.
+ VOCTRL_DRAW_EOSD
+ Required for EOSD (ASS subtitle) support. Provides all
+ information necessary to draw the EOSD for the current video
+ frame.
+ VOCTRL_GET_EOSD_RES
+ Required for EOSD (ASS subtitle) support. Informs the ASS
+ renderer about the properties of the drawing area (size,
+ borders).
+ VOCTRL_SET_DEINTERLACE
+ VOCTRL_GET_DEINTERLACE
+ Get or set deinterlacing status for VOs that support some kind
+ of deinterlacing.
+ VOCTRL_UPDATE_SCREENINFO
+ Should set the xinerama_x, xinerama_y, vo_screenwidth and
+ vo_screenheight appropriately for the currently used
+ monitor and -xineramascreen option.
+ Usually should simply call the w32_update_xinerama_info or
+ update_xinerama_info function.
+ By supporting this, the VO also requests the newer API
+ that sets vo_dx, vo_dy etc. appropriately before config()
+ is called.
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)
+ 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)
IMPORTANT NOTE: config() may be called 0 (zero), 1 or more (2,3...)
@@ -132,42 +132,42 @@ Each vo driver _has_ to implement these:
support multi-monitor setups (if based on x11_common, w32_common).
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.
- If this is not supported, it must be signaled in QUERY_FORMAT with
- VOCAP_NOSLICES.
+ 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.
+ If this is not supported, it must be signaled in QUERY_FORMAT with
+ VOCAP_NOSLICES.
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).
- If you implement VOCTRL_DRAW_IMAGE, you do not need to implement draw_frame.
+ frames, and can do only packed format (YUY2, RGB/BGR).
+ Win32 codecs use this (DivX, Indeo, etc).
+ If you implement VOCTRL_DRAW_IMAGE, you do not need to implement draw_frame.
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 that if you do not draw directly onto the video you should
- use vo_draw_text_ext() which allows you to specify the border
- values etc. needed to draw DVD menu highlights at the correct place.
- If you do not want to implement this, you can still use -vf
- expand=osd=1 to draw the OSD, or even implement code to insert
- this filter automatically.
- Make sure you set VFCAP_OSD depending on whether you implemented it
- or not.
-
- NOTE: This one will be obsolete soon! But it's still useful when
- you want to do tricks, like rendering osd _after_ hardware scaling
- (tdfxfb) or render subtitles under of the image (vo_mpegpes, sdl)
-
- NOTE2: above NOTE is probably wrong, there are currently no plans to
- obsolete draw_osd, though there is the more advanced EOSD support for
- ASS subtitles.
+ 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 that if you do not draw directly onto the video you should
+ use vo_draw_text_ext() which allows you to specify the border
+ values etc. needed to draw DVD menu highlights at the correct place.
+ If you do not want to implement this, you can still use -vf
+ expand=osd=1 to draw the OSD, or even implement code to insert
+ this filter automatically.
+ Make sure you set VFCAP_OSD depending on whether you implemented it
+ or not.
+
+ NOTE: This one will be obsolete soon! But it's still useful when
+ you want to do tricks, like rendering osd _after_ hardware scaling
+ (tdfxfb) or render subtitles under of the image (vo_mpegpes, sdl)
+
+ NOTE2: above NOTE is probably wrong, there are currently no plans to
+ obsolete draw_osd, though there is the more advanced EOSD support for
+ ASS subtitles.
flip_page(): this is called after each frame, this displays the buffer for
- real. This is 'swapbuffers' when doublebuffering.
- Try to do as little work here as possible, since that affect jitter/
- A-V sync.
+ real. This is 'swapbuffers' when doublebuffering.
+ Try to do as little work here as possible, since that affect jitter/
+ A-V sync.