annotate DOCS/tech/vidix.txt @ 4103:917aff165995

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