Mercurial > mplayer.hg
annotate libvo/vosub_vidix.c @ 4969:db86fcf25ede
xanim, raw, rle added
author | arpi |
---|---|
date | Thu, 07 Mar 2002 01:39:07 +0000 |
parents | 939eacee89ab |
children | ad943b99610a |
rev | line source |
---|---|
4010 | 1 /* |
2 * vosub_vidix.c | |
3 * | |
4 * Copyright (C) Nick Kurshev <nickols_k@mail.ru> - 2002 | |
4280 | 5 * Copyright (C) Alex Beregszaszi |
4010 | 6 * |
7 * You can redistribute this file under terms and conditions | |
8 * of GNU General Public licence v2. | |
9 * | |
10 * This file contains vidix interface to any mplayer's VO plugin. | |
11 * (Partly based on vesa_lvo.c from mplayer's package) | |
12 */ | |
13 | |
14 #include <inttypes.h> | |
15 #include <sys/ioctl.h> | |
16 #include <unistd.h> | |
17 #include <fcntl.h> | |
18 #include <sys/mman.h> | |
19 #include <stdio.h> | |
20 #include <stdlib.h> | |
21 #include <string.h> | |
4372 | 22 #include <errno.h> |
4010 | 23 |
24 #include "config.h" | |
25 | |
26 #include "vosub_vidix.h" | |
27 #include "../vidix/vidixlib.h" | |
28 #include "fastmemcpy.h" | |
29 #include "osd.h" | |
30 #include "video_out.h" | |
31 | |
4929 | 32 #define NUM_FRAMES VID_PLAY_MAXFRAMES /* Temporary: driver will overwrite it */ |
4010 | 33 #define UNUSED(x) ((void)(x)) /* Removes warning about unused arguments */ |
34 | |
35 static VDL_HANDLE vidix_handler = NULL; | |
36 static uint8_t *vidix_mem = NULL; | |
37 static uint8_t next_frame; | |
38 static unsigned image_bpp,image_height,image_width,src_format; | |
39 extern int verbose; | |
4372 | 40 static int video_on=0; |
4010 | 41 |
42 static vidix_capability_t vidix_cap; | |
43 static vidix_playback_t vidix_play; | |
44 static vidix_fourcc_t vidix_fourcc; | |
4454 | 45 static vo_functions_t * vo_server; |
4739 | 46 static uint32_t (*server_control)(uint32_t request, void *data, ...); |
47 | |
4010 | 48 |
4372 | 49 static int vidix_get_bes_da(bes_da_t *); |
4379 | 50 static int vidix_get_video_eq(vidix_video_eq_t *info); |
51 static int vidix_set_video_eq(const vidix_video_eq_t *info); | |
52 static int vidix_get_num_fx(unsigned *info); | |
53 static int vidix_get_oem_fx(vidix_oem_fx_t *info); | |
54 static int vidix_set_oem_fx(const vidix_oem_fx_t *info); | |
55 static int vidix_set_deint(const vidix_deinterlace_t *info); | |
4372 | 56 |
57 static void vidix_query_vaa(vo_vaa_t *vaa) | |
58 { | |
59 memset(vaa,0,sizeof(vo_vaa_t)); | |
60 vaa->query_bes_da=vidix_get_bes_da; | |
4379 | 61 vaa->get_video_eq=vidix_get_video_eq; |
62 vaa->set_video_eq=vidix_set_video_eq; | |
63 vaa->get_num_fx=vidix_get_num_fx; | |
64 vaa->get_oem_fx=vidix_get_oem_fx; | |
65 vaa->set_oem_fx=vidix_set_oem_fx; | |
66 vaa->set_deint=vidix_set_deint; | |
4372 | 67 } |
68 | |
4229 | 69 extern int vo_gamma_brightness; |
70 extern int vo_gamma_saturation; | |
71 extern int vo_gamma_contrast; | |
72 extern int vo_gamma_hue; | |
4317 | 73 extern int vo_gamma_red_intensity; |
74 extern int vo_gamma_green_intensity; | |
75 extern int vo_gamma_blue_intensity; | |
4229 | 76 |
4240 | 77 static vidix_video_eq_t vid_eq; |
4229 | 78 |
4234
0ec1d81c8f94
sorry, i really wanted to add vidix_start and stop as int, to detect if something went into the wrong way (also implement check in vo_xvidix)
alex
parents:
4231
diff
changeset
|
79 int vidix_start(void) |
4198
7e2bf04c9a7c
added vidix_start() and vidix_stop() for better runtime-resize support ;)
alex
parents:
4138
diff
changeset
|
80 { |
7e2bf04c9a7c
added vidix_start() and vidix_stop() for better runtime-resize support ;)
alex
parents:
4138
diff
changeset
|
81 int err; |
4270
178c84b1090e
clearing safely the buffer, queryfourcc returns 0x2 (hw accel, noconv.), setting eq only if drivers i able
alex
parents:
4255
diff
changeset
|
82 if((err=vdlPlaybackOn(vidix_handler))!=0) |
178c84b1090e
clearing safely the buffer, queryfourcc returns 0x2 (hw accel, noconv.), setting eq only if drivers i able
alex
parents:
4255
diff
changeset
|
83 { |
178c84b1090e
clearing safely the buffer, queryfourcc returns 0x2 (hw accel, noconv.), setting eq only if drivers i able
alex
parents:
4255
diff
changeset
|
84 printf("vosub_vidix: Can't start playback: %s\n",strerror(err)); |
178c84b1090e
clearing safely the buffer, queryfourcc returns 0x2 (hw accel, noconv.), setting eq only if drivers i able
alex
parents:
4255
diff
changeset
|
85 return -1; |
178c84b1090e
clearing safely the buffer, queryfourcc returns 0x2 (hw accel, noconv.), setting eq only if drivers i able
alex
parents:
4255
diff
changeset
|
86 } |
4379 | 87 video_on=1; |
4270
178c84b1090e
clearing safely the buffer, queryfourcc returns 0x2 (hw accel, noconv.), setting eq only if drivers i able
alex
parents:
4255
diff
changeset
|
88 if (vidix_cap.flags & FLAG_EQUALIZER) |
4229 | 89 { |
4270
178c84b1090e
clearing safely the buffer, queryfourcc returns 0x2 (hw accel, noconv.), setting eq only if drivers i able
alex
parents:
4255
diff
changeset
|
90 if(verbose > 1) |
178c84b1090e
clearing safely the buffer, queryfourcc returns 0x2 (hw accel, noconv.), setting eq only if drivers i able
alex
parents:
4255
diff
changeset
|
91 { |
178c84b1090e
clearing safely the buffer, queryfourcc returns 0x2 (hw accel, noconv.), setting eq only if drivers i able
alex
parents:
4255
diff
changeset
|
92 printf("vosub_vidix: vo_gamma_brightness=%i\n" |
4229 | 93 "vosub_vidix: vo_gamma_saturation=%i\n" |
94 "vosub_vidix: vo_gamma_contrast=%i\n" | |
95 "vosub_vidix: vo_gamma_hue=%i\n" | |
4317 | 96 "vosub_vidix: vo_gamma_red_intensity=%i\n" |
97 "vosub_vidix: vo_gamma_green_intensity=%i\n" | |
98 "vosub_vidix: vo_gamma_blue_intensity=%i\n" | |
4229 | 99 ,vo_gamma_brightness |
100 ,vo_gamma_saturation | |
101 ,vo_gamma_contrast | |
102 ,vo_gamma_hue | |
4317 | 103 ,vo_gamma_red_intensity |
104 ,vo_gamma_green_intensity | |
105 ,vo_gamma_blue_intensity); | |
4270
178c84b1090e
clearing safely the buffer, queryfourcc returns 0x2 (hw accel, noconv.), setting eq only if drivers i able
alex
parents:
4255
diff
changeset
|
106 } |
4317 | 107 /* To use full set of vid_eq.cap */ |
4379 | 108 if(vidix_get_video_eq(&vid_eq) == 0) |
4317 | 109 { |
110 vid_eq.brightness = vo_gamma_brightness; | |
111 vid_eq.saturation = vo_gamma_saturation; | |
112 vid_eq.contrast = vo_gamma_contrast; | |
113 vid_eq.hue = vo_gamma_hue; | |
114 vid_eq.red_intensity = vo_gamma_red_intensity; | |
115 vid_eq.green_intensity = vo_gamma_green_intensity; | |
116 vid_eq.blue_intensity = vo_gamma_blue_intensity; | |
117 vid_eq.flags = VEQ_FLG_ITU_R_BT_601; | |
4379 | 118 vidix_set_video_eq(&vid_eq); |
4317 | 119 } |
4198
7e2bf04c9a7c
added vidix_start() and vidix_stop() for better runtime-resize support ;)
alex
parents:
4138
diff
changeset
|
120 } |
4234
0ec1d81c8f94
sorry, i really wanted to add vidix_start and stop as int, to detect if something went into the wrong way (also implement check in vo_xvidix)
alex
parents:
4231
diff
changeset
|
121 return 0; |
4198
7e2bf04c9a7c
added vidix_start() and vidix_stop() for better runtime-resize support ;)
alex
parents:
4138
diff
changeset
|
122 } |
7e2bf04c9a7c
added vidix_start() and vidix_stop() for better runtime-resize support ;)
alex
parents:
4138
diff
changeset
|
123 |
4234
0ec1d81c8f94
sorry, i really wanted to add vidix_start and stop as int, to detect if something went into the wrong way (also implement check in vo_xvidix)
alex
parents:
4231
diff
changeset
|
124 int vidix_stop(void) |
4198
7e2bf04c9a7c
added vidix_start() and vidix_stop() for better runtime-resize support ;)
alex
parents:
4138
diff
changeset
|
125 { |
7e2bf04c9a7c
added vidix_start() and vidix_stop() for better runtime-resize support ;)
alex
parents:
4138
diff
changeset
|
126 int err; |
7e2bf04c9a7c
added vidix_start() and vidix_stop() for better runtime-resize support ;)
alex
parents:
4138
diff
changeset
|
127 if((err=vdlPlaybackOff(vidix_handler))!=0) |
7e2bf04c9a7c
added vidix_start() and vidix_stop() for better runtime-resize support ;)
alex
parents:
4138
diff
changeset
|
128 { |
7e2bf04c9a7c
added vidix_start() and vidix_stop() for better runtime-resize support ;)
alex
parents:
4138
diff
changeset
|
129 printf("vosub_vidix: Can't stop playback: %s\n",strerror(err)); |
4234
0ec1d81c8f94
sorry, i really wanted to add vidix_start and stop as int, to detect if something went into the wrong way (also implement check in vo_xvidix)
alex
parents:
4231
diff
changeset
|
130 return -1; |
4198
7e2bf04c9a7c
added vidix_start() and vidix_stop() for better runtime-resize support ;)
alex
parents:
4138
diff
changeset
|
131 } |
4372 | 132 video_on=0; |
4234
0ec1d81c8f94
sorry, i really wanted to add vidix_start and stop as int, to detect if something went into the wrong way (also implement check in vo_xvidix)
alex
parents:
4231
diff
changeset
|
133 return 0; |
4198
7e2bf04c9a7c
added vidix_start() and vidix_stop() for better runtime-resize support ;)
alex
parents:
4138
diff
changeset
|
134 } |
7e2bf04c9a7c
added vidix_start() and vidix_stop() for better runtime-resize support ;)
alex
parents:
4138
diff
changeset
|
135 |
4010 | 136 void vidix_term( void ) |
137 { | |
138 if(verbose > 1) printf("vosub_vidix: vidix_term() was called\n"); | |
4198
7e2bf04c9a7c
added vidix_start() and vidix_stop() for better runtime-resize support ;)
alex
parents:
4138
diff
changeset
|
139 vidix_stop(); |
4010 | 140 vdlClose(vidix_handler); |
141 } | |
142 | |
4430 | 143 static uint32_t vidix_draw_slice_420(uint8_t *image[], int stride[], int w,int h,int x,int y) |
4010 | 144 { |
145 uint8_t *src; | |
146 uint8_t *dest; | |
4014 | 147 unsigned bespitch,apitch; |
4010 | 148 int i; |
4324
09f15844c960
don't render UV planes if interleaved (also add support later)
alex
parents:
4317
diff
changeset
|
149 |
09f15844c960
don't render UV planes if interleaved (also add support later)
alex
parents:
4317
diff
changeset
|
150 /* Plane Y */ |
4014 | 151 apitch = vidix_play.dest.pitch.y-1; |
152 bespitch = (w + apitch) & ~apitch; | |
4270
178c84b1090e
clearing safely the buffer, queryfourcc returns 0x2 (hw accel, noconv.), setting eq only if drivers i able
alex
parents:
4255
diff
changeset
|
153 |
4032 | 154 dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.y; |
4010 | 155 dest += bespitch*y + x; |
156 src = image[0]; | |
157 for(i=0;i<h;i++){ | |
158 memcpy(dest,src,w); | |
159 src+=stride[0]; | |
160 dest += bespitch; | |
161 } | |
162 | |
4324
09f15844c960
don't render UV planes if interleaved (also add support later)
alex
parents:
4317
diff
changeset
|
163 if (vidix_play.flags & VID_PLAY_INTERLEAVED_UV) |
09f15844c960
don't render UV planes if interleaved (also add support later)
alex
parents:
4317
diff
changeset
|
164 { |
4744
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
165 int hi,wi; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
166 uint8_t *src2; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
167 dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.v; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
168 dest += bespitch*y/2 + x; // <- is this correct ? |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
169 h/=2; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
170 w/=2; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
171 src = image[1]; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
172 src2 = image[2]; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
173 for(hi = 0; hi < h; hi++) |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
174 { |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
175 for(wi = 0; wi < w; wi++) |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
176 { |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
177 dest[2*wi+0] = src[wi]; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
178 dest[2*wi+1] = src2[wi]; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
179 } |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
180 dest += bespitch; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
181 src += stride[1]; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
182 src2+= stride[2]; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
183 } |
4324
09f15844c960
don't render UV planes if interleaved (also add support later)
alex
parents:
4317
diff
changeset
|
184 |
4744
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
185 } else { |
4324
09f15844c960
don't render UV planes if interleaved (also add support later)
alex
parents:
4317
diff
changeset
|
186 |
4744
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
187 /* Plane V */ |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
188 apitch = vidix_play.dest.pitch.v-1; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
189 bespitch = (w + apitch) & ~apitch; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
190 |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
191 dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.v; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
192 dest += bespitch*y/4 + x; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
193 src = image[1]; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
194 for(i=0;i<h/2;i++){ |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
195 memcpy(dest,src,w/2); |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
196 src+=stride[1]; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
197 dest+=bespitch/2; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
198 } |
4324
09f15844c960
don't render UV planes if interleaved (also add support later)
alex
parents:
4317
diff
changeset
|
199 |
4744
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
200 /* Plane U */ |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
201 apitch = vidix_play.dest.pitch.u-1; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
202 bespitch = (w + apitch) & ~apitch; |
4010 | 203 |
4744
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
204 dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.u; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
205 dest += bespitch*y/4 + x; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
206 src = image[2]; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
207 for(i=0;i<h/2;i++){ |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
208 memcpy(dest,src,w/2); |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
209 src+=stride[2]; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
210 dest += bespitch/2; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
211 } |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
212 return 0; |
da595f0e882e
vidix interleaved U V planes (for g200) by Attila Kinali <kinali@gmx.net>
nick
parents:
4741
diff
changeset
|
213 } |
4010 | 214 } |
215 | |
4430 | 216 static uint32_t vidix_draw_slice_422(uint8_t *image[], int stride[], int w,int h,int x,int y) |
4010 | 217 { |
218 uint8_t *src; | |
219 uint8_t *dest; | |
4014 | 220 unsigned bespitch,apitch; |
4010 | 221 int i; |
4014 | 222 apitch = vidix_play.dest.pitch.y-1; |
223 bespitch = (w*2 + apitch) & ~apitch; | |
4032 | 224 dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.y; |
4010 | 225 dest += bespitch*y + x; |
226 src = image[0]; | |
227 for(i=0;i<h;i++){ | |
228 memcpy(dest,src,w*2); | |
229 src+=stride[0]; | |
230 dest += bespitch; | |
231 } | |
4240 | 232 return 0; |
4010 | 233 } |
234 | |
4454 | 235 static uint32_t vidix_draw_slice_422_fast(uint8_t *image[], int stride[], int w,int h,int x,int y) |
236 { | |
237 uint8_t *src; | |
238 uint8_t *dest; | |
239 unsigned bespitch,apitch; | |
240 int i; | |
241 apitch = vidix_play.dest.pitch.y-1; | |
242 bespitch = (w*2 + apitch) & ~apitch; | |
243 dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.y; | |
244 dest += bespitch*y + x; | |
245 src = image[0]; | |
246 memcpy(dest,src,h*bespitch); | |
247 return 0; | |
248 } | |
249 | |
4430 | 250 static uint32_t vidix_draw_slice_32(uint8_t *image[], int stride[], int w,int h,int x,int y) |
251 { | |
252 uint8_t *src; | |
253 uint8_t *dest; | |
254 unsigned bespitch,apitch; | |
255 int i; | |
256 apitch = vidix_play.dest.pitch.y-1; | |
257 bespitch = (w*4 + apitch) & ~apitch; | |
258 dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.y; | |
259 dest += bespitch*y + x; | |
260 src = image[0]; | |
261 for(i=0;i<h;i++){ | |
262 memcpy(dest,src,w*4); | |
263 src+=stride[0]; | |
264 dest += bespitch; | |
265 } | |
266 | |
267 return 0; | |
268 } | |
269 | |
4454 | 270 static uint32_t vidix_draw_slice_32_fast(uint8_t *image[], int stride[], int w,int h,int x,int y) |
271 { | |
272 uint8_t *src; | |
273 uint8_t *dest; | |
274 unsigned bespitch,apitch; | |
275 int i; | |
276 apitch = vidix_play.dest.pitch.y-1; | |
277 bespitch = (w*4 + apitch) & ~apitch; | |
278 dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.y; | |
279 dest += bespitch*y + x; | |
280 src = image[0]; | |
281 memcpy(dest,src,h*bespitch); | |
282 return 0; | |
283 } | |
284 | |
4430 | 285 static uint32_t vidix_draw_slice_24(uint8_t *image[], int stride[], int w,int h,int x,int y) |
286 { | |
287 uint8_t *src; | |
288 uint8_t *dest; | |
289 unsigned bespitch,apitch; | |
290 int i; | |
291 apitch = vidix_play.dest.pitch.y-1; | |
292 bespitch = (w*3 + apitch) & ~apitch; | |
293 dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.y; | |
294 dest += bespitch*y + x; | |
295 src = image[0]; | |
296 for(i=0;i<h;i++){ | |
297 memcpy(dest,src,w*3); | |
298 src+=stride[0]; | |
299 dest += bespitch; | |
300 } | |
301 | |
302 return 0; | |
303 } | |
4010 | 304 |
4454 | 305 static uint32_t vidix_draw_slice_24_fast(uint8_t *image[], int stride[], int w,int h,int x,int y) |
306 { | |
307 uint8_t *src; | |
308 uint8_t *dest; | |
309 unsigned bespitch,apitch; | |
310 int i; | |
311 apitch = vidix_play.dest.pitch.y-1; | |
312 bespitch = (w*3 + apitch) & ~apitch; | |
313 dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.y; | |
314 dest += bespitch*y + x; | |
315 src = image[0]; | |
316 memcpy(dest,src,h*bespitch); | |
317 return 0; | |
318 } | |
319 | |
4010 | 320 uint32_t vidix_draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y) |
321 { | |
4454 | 322 printf("vosub_vidix: Error unoptimized draw_slice was called\nExiting..."); |
323 vidix_term(); | |
324 exit( EXIT_FAILURE ); | |
325 return 0; | |
4010 | 326 } |
327 | |
328 uint32_t vidix_draw_frame(uint8_t *image[]) | |
329 { | |
4454 | 330 int stride[1]; |
4010 | 331 if(verbose > 1) printf("vosub_vidix: vidix_draw_frame() was called\n"); |
332 /* Note it's very strange but sometime for YUY2 draw_frame is called */ | |
333 if(src_format == IMGFMT_YV12 || src_format == IMGFMT_I420 || src_format == IMGFMT_IYUV) | |
4442
49c410f359e0
return error if unknown depth given. more informative error messages. dont exit if draw_frame was called with Planar YUV, only warn the user
alex
parents:
4434
diff
changeset
|
334 printf("vosub_vidix: draw_frame for YUV420 called, frame cannot be written\n"); |
4010 | 335 else |
4430 | 336 if(src_format == IMGFMT_RGB32 || src_format == IMGFMT_BGR32) |
337 stride[0] = vidix_play.src.w*4; | |
338 else | |
339 if(src_format == IMGFMT_RGB24 || src_format == IMGFMT_BGR24) | |
340 stride[0] = vidix_play.src.w*3; | |
341 else | |
4010 | 342 stride[0] = vidix_play.src.w*2; |
4454 | 343 return vo_server->draw_slice(image,stride,vidix_play.src.w,vidix_play.src.h, |
344 vidix_play.src.x,vidix_play.src.y); | |
4010 | 345 } |
346 | |
347 void vidix_flip_page(void) | |
348 { | |
349 if(verbose > 1) printf("vosub_vidix: vidix_flip_page() was called\n"); | |
350 if(vo_doublebuffering) | |
351 { | |
4032 | 352 vdlPlaybackFrameSelect(vidix_handler,next_frame); |
4010 | 353 next_frame=(next_frame+1)%vidix_play.num_frames; |
354 } | |
355 } | |
356 | |
357 static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) | |
358 { | |
359 UNUSED(x0); | |
360 UNUSED(y0); | |
361 UNUSED(w); | |
362 UNUSED(h); | |
363 UNUSED(src); | |
364 UNUSED(srca); | |
365 UNUSED(stride); | |
366 } | |
367 | |
368 static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) | |
369 { | |
4032 | 370 uint32_t apitch,bespitch; |
4010 | 371 void *lvo_mem; |
4032 | 372 lvo_mem = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.y; |
373 apitch = vidix_play.dest.pitch.y-1; | |
4010 | 374 switch(vidix_play.fourcc){ |
375 case IMGFMT_YV12: | |
376 case IMGFMT_IYUV: | |
377 case IMGFMT_I420: | |
4745
398e3663ed71
Allow using direct rendering with any HW pitches (even on matrox g400).
nick
parents:
4744
diff
changeset
|
378 bespitch = (vidix_play.src.w + apitch) & (~apitch); |
4010 | 379 vo_draw_alpha_yv12(w,h,src,srca,stride,lvo_mem+bespitch*y0+x0,bespitch); |
380 break; | |
381 case IMGFMT_YUY2: | |
4745
398e3663ed71
Allow using direct rendering with any HW pitches (even on matrox g400).
nick
parents:
4744
diff
changeset
|
382 bespitch = (vidix_play.src.w*2 + apitch) & (~apitch); |
398e3663ed71
Allow using direct rendering with any HW pitches (even on matrox g400).
nick
parents:
4744
diff
changeset
|
383 vo_draw_alpha_yuy2(w,h,src,srca,stride,lvo_mem+bespitch*y0+2*x0,bespitch); |
4010 | 384 break; |
385 case IMGFMT_UYVY: | |
4745
398e3663ed71
Allow using direct rendering with any HW pitches (even on matrox g400).
nick
parents:
4744
diff
changeset
|
386 bespitch = (vidix_play.src.w*2 + apitch) & (~apitch); |
398e3663ed71
Allow using direct rendering with any HW pitches (even on matrox g400).
nick
parents:
4744
diff
changeset
|
387 vo_draw_alpha_yuy2(w,h,src,srca,stride,lvo_mem+bespitch*y0+2*x0+1,bespitch); |
4010 | 388 break; |
4430 | 389 case IMGFMT_RGB32: |
390 case IMGFMT_BGR32: | |
4745
398e3663ed71
Allow using direct rendering with any HW pitches (even on matrox g400).
nick
parents:
4744
diff
changeset
|
391 bespitch = (vidix_play.src.w*4 + apitch) & (~apitch); |
398e3663ed71
Allow using direct rendering with any HW pitches (even on matrox g400).
nick
parents:
4744
diff
changeset
|
392 vo_draw_alpha_rgb32(w,h,src,srca,stride,lvo_mem+y0*bespitch+4*x0,bespitch); |
4430 | 393 break; |
394 case IMGFMT_RGB24: | |
395 case IMGFMT_BGR24: | |
4745
398e3663ed71
Allow using direct rendering with any HW pitches (even on matrox g400).
nick
parents:
4744
diff
changeset
|
396 bespitch = (vidix_play.src.w*3 + apitch) & (~apitch); |
398e3663ed71
Allow using direct rendering with any HW pitches (even on matrox g400).
nick
parents:
4744
diff
changeset
|
397 vo_draw_alpha_rgb24(w,h,src,srca,stride,lvo_mem+y0*bespitch+3*x0,bespitch); |
4430 | 398 break; |
399 case IMGFMT_RGB16: | |
400 case IMGFMT_BGR16: | |
4745
398e3663ed71
Allow using direct rendering with any HW pitches (even on matrox g400).
nick
parents:
4744
diff
changeset
|
401 bespitch = (vidix_play.src.w*2 + apitch) & (~apitch); |
398e3663ed71
Allow using direct rendering with any HW pitches (even on matrox g400).
nick
parents:
4744
diff
changeset
|
402 vo_draw_alpha_rgb16(w,h,src,srca,stride,lvo_mem+y0*bespitch+2*x0,bespitch); |
4430 | 403 break; |
404 case IMGFMT_RGB15: | |
405 case IMGFMT_BGR15: | |
4745
398e3663ed71
Allow using direct rendering with any HW pitches (even on matrox g400).
nick
parents:
4744
diff
changeset
|
406 bespitch = (vidix_play.src.w*2 + apitch) & (~apitch); |
398e3663ed71
Allow using direct rendering with any HW pitches (even on matrox g400).
nick
parents:
4744
diff
changeset
|
407 vo_draw_alpha_rgb15(w,h,src,srca,stride,lvo_mem+y0*bespitch+2*x0,bespitch); |
4430 | 408 break; |
4010 | 409 default: |
410 draw_alpha_null(x0,y0,w,h,src,srca,stride); | |
411 } | |
412 } | |
413 | |
414 void vidix_draw_osd(void) | |
415 { | |
416 if(verbose > 1) printf("vosub_vidix: vidix_draw_osd() was called\n"); | |
417 /* TODO: hw support */ | |
418 vo_draw_text(vidix_play.src.w,vidix_play.src.h,draw_alpha); | |
419 } | |
420 | |
421 uint32_t vidix_query_fourcc(uint32_t format) | |
422 { | |
423 if(verbose > 1) printf("vosub_vidix: query_format was called: %x (%s)\n",format,vo_format_name(format)); | |
424 vidix_fourcc.fourcc = format; | |
425 vdlQueryFourcc(vidix_handler,&vidix_fourcc); | |
4372 | 426 if (vidix_fourcc.depth == VID_DEPTH_NONE) return(0); |
4270
178c84b1090e
clearing safely the buffer, queryfourcc returns 0x2 (hw accel, noconv.), setting eq only if drivers i able
alex
parents:
4255
diff
changeset
|
427 return(0x2); /* hw support without conversion */ |
4010 | 428 } |
4240 | 429 |
4255 | 430 int vidix_grkey_support(void) |
431 { | |
4270
178c84b1090e
clearing safely the buffer, queryfourcc returns 0x2 (hw accel, noconv.), setting eq only if drivers i able
alex
parents:
4255
diff
changeset
|
432 return(vidix_fourcc.flags & VID_CAP_COLORKEY); |
4255 | 433 } |
434 | |
4240 | 435 int vidix_grkey_get(vidix_grkey_t *gr_key) |
436 { | |
437 return(vdlGetGrKeys(vidix_handler, gr_key)); | |
438 } | |
439 | |
440 int vidix_grkey_set(const vidix_grkey_t *gr_key) | |
441 { | |
442 return(vdlSetGrKeys(vidix_handler, gr_key)); | |
443 } | |
4372 | 444 |
445 static int vidix_get_bes_da(bes_da_t *info) | |
446 { | |
447 if(!video_on) return EPERM; | |
448 info->dest.x = vidix_play.src.x; | |
449 info->dest.y = vidix_play.src.y; | |
450 info->dest.w = vidix_play.src.w; | |
451 info->dest.h = vidix_play.src.h; | |
452 info->dest.pitch.y = vidix_play.dest.pitch.y; | |
453 info->dest.pitch.u = vidix_play.dest.pitch.u; | |
454 info->dest.pitch.v = vidix_play.dest.pitch.v; | |
455 info->flags = vidix_play.flags; | |
456 info->frame_size = vidix_play.frame_size; | |
457 info->num_frames = vidix_play.num_frames; | |
458 memcpy(info->offsets,vidix_play.offsets,sizeof(unsigned)*vidix_play.num_frames); | |
459 memcpy(&info->offset,&vidix_play.offset,sizeof(vidix_yuv_t)); | |
460 info->dga_addr = vidix_play.dga_addr; | |
461 return 0; | |
462 } | |
4379 | 463 |
464 static int vidix_get_video_eq(vidix_video_eq_t *info) | |
465 { | |
466 if(!video_on) return EPERM; | |
467 return vdlPlaybackGetEq(vidix_handler, info); | |
468 } | |
469 | |
470 static int vidix_set_video_eq(const vidix_video_eq_t *info) | |
471 { | |
472 if(!video_on) return EPERM; | |
473 return vdlPlaybackSetEq(vidix_handler, info); | |
474 } | |
475 | |
476 static int vidix_get_num_fx(unsigned *info) | |
477 { | |
478 if(!video_on) return EPERM; | |
479 return vdlQueryNumOemEffects(vidix_handler, info); | |
480 } | |
481 | |
482 static int vidix_get_oem_fx(vidix_oem_fx_t *info) | |
483 { | |
484 if(!video_on) return EPERM; | |
485 return vdlGetOemEffect(vidix_handler, info); | |
486 } | |
487 | |
488 static int vidix_set_oem_fx(const vidix_oem_fx_t *info) | |
489 { | |
490 if(!video_on) return EPERM; | |
491 return vdlSetOemEffect(vidix_handler, info); | |
492 } | |
493 | |
494 static int vidix_set_deint(const vidix_deinterlace_t *info) | |
495 { | |
496 if(!video_on) return EPERM; | |
497 return vdlPlaybackSetDeint(vidix_handler, info); | |
498 } | |
4454 | 499 |
500 int vidix_init(unsigned src_width,unsigned src_height, | |
501 unsigned x_org,unsigned y_org,unsigned dst_width, | |
502 unsigned dst_height,unsigned format,unsigned dest_bpp, | |
503 unsigned vid_w,unsigned vid_h,const void *info) | |
504 { | |
505 size_t i,awidth; | |
4741 | 506 int err,is_422_planes_eq; |
4745
398e3663ed71
Allow using direct rendering with any HW pitches (even on matrox g400).
nick
parents:
4744
diff
changeset
|
507 uint32_t sstride,dstride; |
4454 | 508 if(verbose > 1) |
509 printf("vosub_vidix: vidix_init() was called\n" | |
510 "src_w=%u src_h=%u dest_x_y_w_h = %u %u %u %u\n" | |
511 "format=%s dest_bpp=%u vid_w=%u vid_h=%u\n" | |
512 ,src_width,src_height,x_org,y_org,dst_width,dst_height | |
513 ,vo_format_name(format),dest_bpp,vid_w,vid_h); | |
514 | |
515 if(((vidix_cap.maxwidth != -1) && (vid_w > vidix_cap.maxwidth)) || | |
516 ((vidix_cap.minwidth != -1) && (vid_w < vidix_cap.minwidth)) || | |
517 ((vidix_cap.maxheight != -1) && (vid_h > vidix_cap.maxheight)) || | |
518 ((vidix_cap.minwidth != -1 ) && (vid_h < vidix_cap.minheight))) | |
519 { | |
520 printf("vosub_vidix: video server has unsupported resolution (%dx%d), supported: %dx%d-%dx%d\n", | |
521 vid_w, vid_h, vidix_cap.minwidth, vidix_cap.minheight, | |
522 vidix_cap.maxwidth, vidix_cap.maxheight); | |
523 return -1; | |
524 } | |
525 | |
526 err = 0; | |
527 switch(dest_bpp) | |
528 { | |
529 case 1: err = ((vidix_fourcc.depth & VID_DEPTH_1BPP) != VID_DEPTH_1BPP); break; | |
530 case 2: err = ((vidix_fourcc.depth & VID_DEPTH_2BPP) != VID_DEPTH_2BPP); break; | |
531 case 4: err = ((vidix_fourcc.depth & VID_DEPTH_4BPP) != VID_DEPTH_4BPP); break; | |
532 case 8: err = ((vidix_fourcc.depth & VID_DEPTH_8BPP) != VID_DEPTH_8BPP); break; | |
533 case 12:err = ((vidix_fourcc.depth & VID_DEPTH_12BPP) != VID_DEPTH_12BPP); break; | |
4540 | 534 case 15:err = ((vidix_fourcc.depth & VID_DEPTH_15BPP) != VID_DEPTH_15BPP); break; |
4454 | 535 case 16:err = ((vidix_fourcc.depth & VID_DEPTH_16BPP) != VID_DEPTH_16BPP); break; |
536 case 24:err = ((vidix_fourcc.depth & VID_DEPTH_24BPP) != VID_DEPTH_24BPP); break; | |
537 case 32:err = ((vidix_fourcc.depth & VID_DEPTH_32BPP) != VID_DEPTH_32BPP); break; | |
538 default: err=1; break; | |
539 } | |
540 if(err) | |
541 { | |
542 printf("vosub_vidix: video server has unsupported color depth by vidix (%d)\n" | |
543 ,vidix_fourcc.depth); | |
544 return -1; | |
545 } | |
546 if((dst_width > src_width || dst_height > src_height) && (vidix_cap.flags & FLAG_UPSCALER) != FLAG_UPSCALER) | |
547 { | |
548 printf("vosub_vidix: vidix driver can't upscale image (%d%d -> %d%d)\n", | |
549 src_width, src_height, dst_width, dst_height); | |
550 return -1; | |
551 } | |
552 if((dst_width > src_width || dst_height > src_height) && (vidix_cap.flags & FLAG_DOWNSCALER) != FLAG_DOWNSCALER) | |
553 { | |
554 printf("vosub_vidix: vidix driver can't downscale image (%d%d -> %d%d)\n", | |
555 src_width, src_height, dst_width, dst_height); | |
556 return -1; | |
557 } | |
558 image_width = src_width; | |
559 image_height = src_height; | |
560 src_format = format; | |
561 memset(&vidix_play,0,sizeof(vidix_playback_t)); | |
562 vidix_play.fourcc = format; | |
563 vidix_play.capability = vidix_cap.flags; /* every ;) */ | |
564 vidix_play.blend_factor = 0; /* for now */ | |
565 /* display the full picture. | |
566 Nick: we could implement here zooming to a specified area -- alex */ | |
567 vidix_play.src.x = vidix_play.src.y = 0; | |
568 vidix_play.src.w = src_width; | |
569 vidix_play.src.h = src_height; | |
570 vidix_play.dest.x = x_org; | |
571 vidix_play.dest.y = y_org; | |
572 vidix_play.dest.w = dst_width; | |
573 vidix_play.dest.h = dst_height; | |
4929 | 574 vidix_play.num_frames=vo_doublebuffering?NUM_FRAMES-1:1; |
4454 | 575 vidix_play.src.pitch.y = vidix_play.src.pitch.u = vidix_play.src.pitch.v = 0; |
576 if(info) | |
577 { | |
578 switch(((const vo_tune_info_t *)info)->pitch[0]) | |
579 { | |
580 case 2: | |
581 case 4: | |
582 case 8: | |
583 case 16: | |
584 case 32: | |
585 case 64: | |
586 case 128: | |
587 case 256: vidix_play.src.pitch.y = ((const vo_tune_info_t *)info)->pitch[0]; | |
588 break; | |
589 default: break; | |
590 } | |
591 switch(((const vo_tune_info_t *)info)->pitch[1]) | |
592 { | |
593 case 2: | |
594 case 4: | |
595 case 8: | |
596 case 16: | |
597 case 32: | |
598 case 64: | |
599 case 128: | |
600 case 256: vidix_play.src.pitch.u = ((const vo_tune_info_t *)info)->pitch[1]; | |
601 break; | |
602 default: break; | |
603 } | |
604 switch(((const vo_tune_info_t *)info)->pitch[2]) | |
605 { | |
606 case 2: | |
607 case 4: | |
608 case 8: | |
609 case 16: | |
610 case 32: | |
611 case 64: | |
612 case 128: | |
613 case 256: vidix_play.src.pitch.v = ((const vo_tune_info_t *)info)->pitch[2]; | |
614 break; | |
615 default: break; | |
616 } | |
617 } | |
618 if((err=vdlConfigPlayback(vidix_handler,&vidix_play))!=0) | |
619 { | |
620 printf("vosub_vidix: Can't configure playback: %s\n",strerror(err)); | |
621 return -1; | |
622 } | |
4895 | 623 printf("vosub_vidix: using %d buffers\n", vidix_play.num_frames); |
4454 | 624 |
625 vidix_mem = vidix_play.dga_addr; | |
626 | |
627 /* select first frame */ | |
628 next_frame = 0; | |
629 // vdlPlaybackFrameSelect(vidix_handler,next_frame); | |
630 | |
631 /* clear every frame with correct address and frame_size */ | |
632 for (i = 0; i < vidix_play.num_frames; i++) | |
633 memset(vidix_mem + vidix_play.offsets[i], 0x80, | |
634 vidix_play.frame_size); | |
635 /* tune some info here */ | |
4745
398e3663ed71
Allow using direct rendering with any HW pitches (even on matrox g400).
nick
parents:
4744
diff
changeset
|
636 sstride = src_width*2; |
398e3663ed71
Allow using direct rendering with any HW pitches (even on matrox g400).
nick
parents:
4744
diff
changeset
|
637 dstride = (src_width*2+(vidix_play.dest.pitch.y-1))&~(vidix_play.dest.pitch.y-1); |
398e3663ed71
Allow using direct rendering with any HW pitches (even on matrox g400).
nick
parents:
4744
diff
changeset
|
638 is_422_planes_eq = sstride == dstride; |
4454 | 639 if(src_format == IMGFMT_YV12 || src_format == IMGFMT_I420 || src_format == IMGFMT_IYUV) |
640 vo_server->draw_slice = vidix_draw_slice_420; | |
641 else | |
642 if(src_format == IMGFMT_RGB32 || src_format == IMGFMT_BGR32) | |
643 vo_server->draw_slice = | |
4741 | 644 is_422_planes_eq ? |
4454 | 645 vidix_draw_slice_32_fast: |
646 vidix_draw_slice_32; | |
647 else | |
648 if(src_format == IMGFMT_RGB24 || src_format == IMGFMT_BGR24) | |
649 vo_server->draw_slice = | |
4741 | 650 is_422_planes_eq ? |
4454 | 651 vidix_draw_slice_24_fast: |
652 vidix_draw_slice_24; | |
653 else | |
654 vo_server->draw_slice = | |
4741 | 655 is_422_planes_eq ? |
4454 | 656 vidix_draw_slice_422_fast: |
657 vidix_draw_slice_422; | |
658 return 0; | |
659 } | |
660 | |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4540
diff
changeset
|
661 uint32_t vidix_control(uint32_t request, void *data, ...) |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4540
diff
changeset
|
662 { |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4540
diff
changeset
|
663 switch (request) { |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4540
diff
changeset
|
664 case VOCTRL_QUERY_VAA: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4540
diff
changeset
|
665 vidix_query_vaa((vo_vaa_t*)data); |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4540
diff
changeset
|
666 return VO_TRUE; |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4540
diff
changeset
|
667 case VOCTRL_QUERY_FORMAT: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4540
diff
changeset
|
668 return vidix_query_fourcc(*((uint32_t*)data)); |
4739 | 669 case VOCTRL_SCREENSHOT: |
670 return (*server_control)(request,data); | |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4540
diff
changeset
|
671 } |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4540
diff
changeset
|
672 return VO_NOTIMPL; |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4540
diff
changeset
|
673 } |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4540
diff
changeset
|
674 |
4454 | 675 int vidix_preinit(const char *drvname,void *server) |
676 { | |
677 int err; | |
678 if(verbose > 1) printf("vosub_vidix: vidix_preinit(%s) was called\n",drvname); | |
679 if(vdlGetVersion() != VIDIX_VERSION) | |
680 { | |
681 printf("vosub_vidix: You have wrong version of VIDIX library\n"); | |
682 return -1; | |
683 } | |
684 vidix_handler = vdlOpen(LIBDIR"/vidix/", | |
685 drvname ? drvname[0] == ':' ? &drvname[1] : drvname[0] ? drvname : NULL : NULL, | |
686 TYPE_OUTPUT, | |
687 verbose); | |
688 if(vidix_handler == NULL) | |
689 { | |
690 printf("vosub_vidix: Couldn't find working VIDIX driver\n"); | |
691 return -1; | |
692 } | |
693 if((err=vdlGetCapability(vidix_handler,&vidix_cap)) != 0) | |
694 { | |
695 printf("vosub_vidix: Couldn't get capability: %s\n",strerror(err)); | |
696 return -1; | |
697 } | |
698 printf("vosub_vidix: Using: %s by %s\n",vidix_cap.name,vidix_cap.author); | |
699 /* we are able to tune up this stuff depend on fourcc format */ | |
700 ((vo_functions_t *)server)->draw_slice=vidix_draw_slice; | |
701 ((vo_functions_t *)server)->draw_frame=vidix_draw_frame; | |
702 ((vo_functions_t *)server)->flip_page=vidix_flip_page; | |
703 ((vo_functions_t *)server)->draw_osd=vidix_draw_osd; | |
4739 | 704 server_control = ((vo_functions_t *)server)->control; |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4540
diff
changeset
|
705 ((vo_functions_t *)server)->control=vidix_control; |
4454 | 706 vo_server = server; |
707 return 0; | |
708 } |