5586
|
1 libvo --- the library to handle video output by A'rpi, 2002.04
|
|
2 ============================================
|
|
3
|
|
4 Note: before start on this, read colorspaces.txt !
|
|
5
|
|
6 The constants for different pixelformats are defined in img_format.h,
|
|
7 their usage is mandatory.
|
|
8
|
|
9 Each vo driver _has_ to implement these:
|
|
10
|
|
11 preinit():
|
|
12 init the video system (to support querying for supported formats)
|
|
13
|
|
14 uninit():
|
|
15 Uninit the whole system, this is on the same "level" as preinit.
|
|
16
|
|
17 control():
|
|
18 Current controls:
|
|
19 VOCTRL_QUERY_FORMAT - queries if a given pixelformat is supported.
|
|
20 It also returns various flags decsirbing the capabilities
|
|
21 of the driver with teh given mode. for the flags, see
|
|
22 file vfcaps.h !
|
|
23 the most important flags, every driver must properly report
|
|
24 these:
|
|
25 0x1 - supported (with or without conversion)
|
|
26 0x2 - supported without conversion (define 0x1 too!)
|
|
27 0x100 - driver/hardware handles timing (blocking)
|
|
28 also SET sw/hw scaling and osd support flags, and flip,
|
6847
|
29 and accept_stride if you implement VOCTRL_DRAW_IMAGE (see bellow)
|
5586
|
30 NOTE: VOCTRL_QUERY_FORMAT may be called _before_ first config()
|
|
31 but is always called between preinit() and uninit()
|
|
32 VOCTRL_GET_IMAGE
|
|
33 libmpcodecs Direct Rendering interface
|
|
34 You need to update mpi (mp_image.h) structure, for example,
|
|
35 look at vo_x11, vo_sdl, vo_xv or mga_common.
|
6847
|
36 VOCTRL_DRAW_IMAGE
|
5586
|
37 replacement for the current draw_slice/draw_frame way of
|
|
38 passing video frames. by implementing SET_IMAGE, you'll get
|
|
39 image in mp_image struct instead of by calling draw_*.
|
6847
|
40 unless you return VO_TRUE for VOCTRL_DRAW_IMAGE call, the
|
5586
|
41 old-style draw_* functils will be called!
|
|
42 Note: draw_slice is still mandatory, for per-slice rendering!
|
|
43 VOCTRL_RESET - reset the video device
|
|
44 This is sent on seeking and similar and is useful if you are
|
|
45 using a device which prebuffers frames that need to flush them
|
|
46 before refilling audio/video buffers.
|
|
47 VOCTRL_PAUSE
|
|
48 VOCTRL_RESUME
|
|
49 VOCTRL_GUISUPPORT
|
|
50 return true only if driver supports co-operation with
|
|
51 MPlayer's GUI (not yet used by GUI)
|
6815
|
52 VOCTRL_SET_EQUALIZER
|
|
53 set the video equalizer to the given values
|
|
54 two arguments are provided: item and value
|
|
55 item is a string, the possible values are (currently):
|
|
56 brightness, contrast, saturation, hue
|
|
57 VOCTRL_GET_EQUALIZER
|
|
58 get the current video equalizer values
|
|
59 two arguments are provided: item and value
|
|
60 item is a string, the possible values are (currenlty):
|
|
61 brightness, contrast, saturation, hue
|
5586
|
62
|
|
63 config():
|
|
64 Set up the video system. You get the dimensions and flags.
|
|
65 width, height: size of the source image
|
|
66 d_width, d_height: wanted scaled/display size (it's a hint)
|
|
67 Flags:
|
|
68 0x01 - force fullscreen (-fs)
|
|
69 0x02 - allow mode switching (-vm)
|
|
70 0x04 - allow software scaling (-zoom)
|
|
71 0x08 - flipping (-flip)
|
|
72 They're defined as VOFLAG_* (see libvo/video_out.h)
|
|
73
|
|
74 IMPORTAMT NOTE: config() may be called 0 (zero), 1 or more (2,3...)
|
|
75 times between preinit() and uninit() calls. You MUST handle it, and
|
|
76 you shouldn't crash at second config() call or at uninit() without
|
|
77 any config() call! To make your life easier, vo_config_count is
|
|
78 set to the number of previous config() call, counted from preinit().
|
|
79 It's set by the caller (vf_vo.c), you don't have to increase it!
|
|
80 So, you can check for vo_config_count>0 in uninit() when freeing
|
|
81 resources allocated in config() to avoid crash!
|
|
82
|
|
83 draw_slice(): this displays YV12 pictures (3 planes, one full sized that
|
|
84 contains brightness (Y), and 2 quarter-sized which the colour-info
|
|
85 (U,V). MPEG codecs (libmpeg2, opendivx) use this. This doesn't have
|
|
86 to display the whole frame, only update small parts of it.
|
|
87
|
|
88 draw_frame(): this is the older interface, this displays only complete
|
|
89 frames, and can do only packed format (YUY2, RGB/BGR).
|
|
90 Win32 codecs use this (DivX, Indeo, etc).
|
6847
|
91 If you implement VOCTRL_DRAW_IMAGE, you can left draw_frame.
|
5586
|
92
|
|
93 draw_osd(): this displays subtitles and OSD.
|
|
94 It's a bit tricky to use it, since it's a callback-style stuff.
|
|
95 It should call vo_draw_text() with screen dimension and your
|
|
96 draw_alpha implementation for the pixelformat (function pointer).
|
|
97 The vo_draw_text() checks the characters to draw, and calls
|
|
98 draw_alpha() for each. As a help, osd.c contains draw_alpha for
|
|
99 each pixelformats, use this if possible!
|
|
100
|
|
101 NOTE: this one will be obsolete soon! But it's still usefull when
|
|
102 you want to do tricks, like rendering osd _after_ hardware scaling
|
|
103 (tdfxfb) or render subtitles under of the image (vo_mpegpes, sdl)
|
|
104
|
|
105 flip_page(): this is called after each frame, this diplays the buffer for
|
|
106 real. This is 'swapbuffers' when double-buffering.
|
|
107
|