4103
|
1 VIDIX - VIDeo Interface for *niX
|
|
2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
3
|
|
4 This interface was designed and introduced as interface to userspace drivers
|
|
5 to provide DGA everywhere where it's possible (unline X11).
|
|
6 I hope that these drivers will be portable same as X11 (not only on *nix).
|
|
7
|
|
8 What is it:
|
|
9 - It's portable successor of mga_vid technology which is located in user-space.
|
|
10 - Unlikely X11 it's provides DGA everywhere where it's possible.
|
|
11 - Unlikely v4l it provides interface for video playback
|
|
12 - Unlikely linux's drivers it uses mathematics library.
|
|
13
|
|
14 Why it was developed:
|
|
15 As said Vladimir Dergachev
|
|
16 (http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/gatos/km/km.rfc.txt):
|
|
17 "0) Motivation
|
|
18 v4l, v4l2 and Xv are all suffering from the same problem: attempt to fit
|
|
19 existing multimedia devices into a fixed scheme."
|
|
20 Well - I tried to implement something similar by motivation.
|
|
21
|
|
22 How it works:
|
|
23 ~~~~~~~~~~~~~
|
|
24
|
|
25 This interface is almost finished. But I guess it can be expanded by developer's
|
|
26 requests.
|
|
27 So any suggestions, reports, criticism are gladly accepted.
|
|
28
|
|
29 1) APP calls vixGetVersion to check age of driver ;)
|
|
30 2) APP calls vixProbe. Driver should return 0 if it can handle something in PC.
|
|
31 3) APP calls vixGetCapability. Driver should return filled
|
|
32 vidix_capability_t.type field at least.
|
|
33 4) If above calls were succesful then APP calls vixInit function
|
|
34 (Driver can have not exported this function in this case call will be
|
|
35 skiped).
|
|
36 5) After initializing of driver APP calls vixGetCapability again
|
|
37 (In this case driver must fill every field of struct)
|
|
38 6) APP calls vixQueryFourcc. Driver should answer - can it configure
|
|
39 video memory for given fourcc or not.
|
|
40 7) APP calls vixConfigPlayback. Driver should prepare BES on this call.
|
|
41 APP pass to driver following info:
|
|
42 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
43 vidix_playback_t.fourcc - contains fourcc of movie
|
|
44 vidix_playback_t.capability - currently contsinas copy of vidix_capability_t.flags
|
|
45 vidix_playback_t.blend_factor- currently unused
|
|
46 vidix_playback_t.src - currently only x,y,w,h fields are used.
|
|
47 contain original movie size (in pixels)
|
|
48 x and y often are nulls.
|
|
49 vidix_playback_t.dest - x,y,w,h fields contains destinition rectange
|
|
50 on the screen in pixels.
|
|
51 vidix_playback_t.num_frames - maximal # of frames which can be used by APP.
|
|
52 (Currently 10).
|
|
53 Driver should fill following fields:
|
|
54 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
55 vidix_playback_t.num_frames - real # of frames which will be used by driver.
|
|
56 (Should be less or equal to app's num_frames).
|
|
57
|
|
58 vidix_playback_t.dest.pitch.y These fields should contain alignment
|
|
59 vidix_playback_t.dest.pitch.u - for each Y,U,V plane in bytes.
|
|
60 vidix_playback_t.dest.pitch.v (For packed fourcc only Y value is used)
|
|
61
|
|
62 vidix_playback_t.frame_size - Driver should tell to app which size of
|
|
63 source frame (src.w and src.h) should
|
|
64 use APP (according to pitches and offsets)
|
|
65
|
|
66 vidix_playback_t.offsets - offsets from begin of BES memory for each frame
|
|
67
|
|
68 vidix_playback_t.offset.y These field should contain offset
|
|
69 vidix_playback_t.offset.u - for each Y,U,V plane within frame.
|
|
70 vidix_playback_t.offset.v (For packed fourcc only Y value is used)
|
|
71
|
|
72 vidix_playback_t.dga_addr - Address of BES memory.
|
|
73
|
|
74 Also see this picture:
|
|
75
|
|
76 VIDEO MEMORY layout:
|
|
77 +----------- It's begin of video memory End of video memory--------------+
|
|
78 | |
|
|
79 v v
|
|
80 [ RGB memory | YUV memory | UNDEF ]
|
|
81 ^
|
|
82 |
|
|
83 +---- begin of BES memory
|
|
84
|
|
85 BES MEMORY layout:
|
|
86 +-------- begin of BES memory
|
|
87 |
|
|
88 v
|
|
89 [ | | | | |
|
|
90 ^ ^ ^ ^ ^
|
|
91 | | | | + BEGIN of second frame
|
|
92 | | | + BEGIN of V plane
|
|
93 | | + BEGIN of U plane
|
|
94 | +------- BEGIN of Y plane
|
|
95 |
|
|
96 +--------- BEGIN of first frame
|
|
97
|
|
98 This means that in general case:
|
|
99 offset of frame != offset of BES
|
|
100 offset of Y plane != offset of first frame
|
|
101
|
|
102 But often: vidix_playback_t.offsets[0] = vidix_playback_t.offset.y = 0;
|
|
103
|
|
104 Formula: (For Y plane) copy source to:
|
|
105 vidix_playback_t.dga_addr +
|
|
106 vidix_playback_t.offsets[i] +
|
|
107 vidix_playback_t.offset.y
|
|
108
|
|
109 8) APP calls vixPlaybackOn. Driver should activate BES on this call.
|
|
110 9) PLAYBACK. Driver should sleep here ;)
|
|
111 But during playback can be called:
|
|
112 vixFrameSelect (if this function is exported)
|
|
113 Driver should prepare and activate corresponded frame.
|
|
114 This function is used only for double and trilpe buffering and
|
|
115 never used for single buffering playback.
|
|
116 vixGet(Set)GrKeys (if this function is exported)
|
|
117 This interface should be tuned but intriduced for overlapped playback
|
|
118 and video effects (TYPE_FX)
|
|
119 vixPlaybackGet(Set)Eq (if this function is exported)
|
|
120 For color correction.
|
|
121 10) APP calls vixPlaybackOff. Driver should deactivate BES on this call.
|
|
122 11) If vixDestroy is defined APP calls this function before unloading driver
|
|
123 from memory.
|
|
124
|
|
125
|
|
126 What functions are mandatory:
|
|
127 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
128 vixGetVersion
|
|
129 vixProbe
|
|
130 vixGetCapability
|
|
131 vixQueryFourcc
|
|
132 vixConfigPlayback
|
|
133 vixPlaybackOn
|
|
134 vixPlaybackOff
|
|
135
|
|
136 All other functions are optionaly.
|
|
137
|
|
138 Please send your suggestions, reports, feedback to mplayer-dev-eng@mplayerhq.hu
|
|
139 Best regards! Nick Kurshev.
|