annotate DOCS/tech/libvo.txt @ 11321:ef36cd5b757e

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