Mercurial > mplayer.hg
annotate libvo/vo_aa.c @ 14671:222d5ed2c49d
DGA works only with x11
author | reimar |
---|---|
date | Sun, 06 Feb 2005 20:56:16 +0000 |
parents | e047e70a9767 |
children | b3274e6b88ef |
rev | line source |
---|---|
1538
f3f4fc77fd88
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new. fixed wrong char
folke
parents:
1537
diff
changeset
|
1 /* |
1511 | 2 * MPlayer |
3 * | |
1553
12551899e83f
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking +header change
folke
parents:
1551
diff
changeset
|
4 * Video driver for AAlib - 1.0 |
1511 | 5 * |
6 * by Folke Ashberg <folke@ashberg.de> | |
7 * | |
8 * Code started: Sun Aug 12 2001 | |
1553
12551899e83f
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking +header change
folke
parents:
1551
diff
changeset
|
9 * Version 1.0 : Thu Aug 16 2001 |
1511 | 10 * |
11 */ | |
12 | |
13 #include <stdio.h> | |
14 #include <stdlib.h> | |
15 | |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
16 #include <sys/stat.h> |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
17 #include <unistd.h> |
1511 | 18 |
19 #include <limits.h> | |
20 #include <math.h> | |
21 #include <stdarg.h> | |
22 #include <time.h> | |
23 #include <string.h> | |
4737
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4674
diff
changeset
|
24 #include <errno.h> |
1511 | 25 |
26 #include "config.h" | |
27 #include "video_out.h" | |
28 #include "video_out_internal.h" | |
5870 | 29 #include "aspect.h" |
13787
e047e70a9767
Handle "xxx.h" vs "../xxx.h" include paths in a consistent way.
diego
parents:
10595
diff
changeset
|
30 #include "postproc/swscale.h" |
e047e70a9767
Handle "xxx.h" vs "../xxx.h" include paths in a consistent way.
diego
parents:
10595
diff
changeset
|
31 #include "libmpcodecs/vf_scale.h" |
5295 | 32 #include "font_load.h" |
1511 | 33 #include "sub.h" |
34 | |
9380 | 35 #include "osdep/keycodes.h" |
1511 | 36 #include <aalib.h> |
9756 | 37 #include "m_option.h" |
5870 | 38 #include "mp_msg.h" |
1511 | 39 |
40 | |
41 #define MESSAGE_DURATION 3 | |
42 #define MESSAGE_SIZE 512 | |
43 #define MESSAGE_DEKO " +++ %s +++ " | |
44 | |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7625
diff
changeset
|
45 static vo_info_t info = { |
1511 | 46 "AAlib", |
47 "aa", | |
5870 | 48 "Alban Bedel <albeu@free.fr> and Folke Ashberg <folke@ashberg.de>", |
1511 | 49 "" |
50 }; | |
51 | |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7625
diff
changeset
|
52 LIBVO_EXTERN(aa) |
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7625
diff
changeset
|
53 |
1511 | 54 /* aa's main context we use */ |
55 aa_context *c; | |
56 aa_renderparams *p; | |
57 static int fast =0; | |
5870 | 58 /* used for the sws */ |
59 static uint8_t * image[3]; | |
60 static int image_stride[3]; | |
1511 | 61 |
62 /* image infos */ | |
5870 | 63 static int image_format; |
1511 | 64 static int image_width; |
65 static int image_height; | |
5870 | 66 static int image_x, image_y; |
67 static int screen_x, screen_y; | |
68 static int screen_w, screen_h; | |
69 static int src_width; | |
70 static int src_height; | |
1511 | 71 |
72 /* osd stuff */ | |
73 time_t stoposd = 0; | |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
74 static int showosdmessage = 0; |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
75 char osdmessagetext[MESSAGE_SIZE]; |
1511 | 76 char posbar[MESSAGE_SIZE]; |
77 static int osdx, osdy; | |
5870 | 78 static int osd_text_length = 0; |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
79 int aaconfigmode=1; |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
80 #ifdef USE_OSD |
5870 | 81 font_desc_t* vo_font_save = NULL; |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
82 #endif |
9496 | 83 static struct SwsContext *sws=NULL; |
1511 | 84 |
85 /* our version of the playmodes :) */ | |
86 | |
87 extern void mplayer_put_key(int code); | |
88 | |
1518 | 89 /* to disable stdout outputs when curses/linux mode */ |
90 extern int quiet; | |
91 | |
1537
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
92 /* configuration */ |
1518 | 93 int aaopt_osdcolor = AA_SPECIAL; |
1537
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
94 int aaopt_subcolor = AA_SPECIAL; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
95 |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
96 extern struct aa_hardware_params aa_defparams; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
97 extern struct aa_renderparams aa_defrenderparams; |
1511 | 98 |
99 void | |
100 resize(void){ | |
101 /* | |
102 * this function is called by aa lib if windows resizes | |
103 * further during init, because here we have to calculate | |
104 * a little bit | |
105 */ | |
106 | |
107 aa_resize(c); | |
108 | |
5870 | 109 aspect_save_screenres(aa_imgwidth(c),aa_imgheight(c)); |
110 image_height = aa_imgheight(c); //src_height; | |
111 image_width = aa_imgwidth(c); //src_width; | |
112 | |
113 aspect(&image_width,&image_height,A_ZOOM); | |
114 | |
115 image_x = (aa_imgwidth(c) - image_width) / 2; | |
116 image_y = (aa_imgheight(c) - image_height) / 2; | |
117 screen_w = image_width * aa_scrwidth(c) / aa_imgwidth(c); | |
118 screen_h = image_height * aa_scrheight(c) / aa_imgheight(c); | |
119 screen_x = (aa_scrwidth(c) - screen_w) / 2; | |
120 screen_y = (aa_scrheight(c) - screen_h) / 2; | |
121 | |
9496 | 122 if(sws) sws_freeContext(sws); |
123 sws = sws_getContextFromCmdLine(src_width,src_height,image_format, | |
6522 | 124 image_width,image_height,IMGFMT_Y8); |
5870 | 125 |
6809
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
126 image[0] = aa_image(c) + image_y * aa_imgwidth(c) + image_x; |
5870 | 127 image[1] = NULL; |
6522 | 128 image[2] = NULL; |
5870 | 129 |
6809
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
130 image_stride[0] = aa_imgwidth(c); |
5870 | 131 image_stride[1] = 0; |
6522 | 132 image_stride[2] = 0; |
5870 | 133 |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
134 showosdmessage=0; |
1511 | 135 |
136 } | |
137 | |
138 void | |
139 osdmessage(int duration, int deko, char *fmt, ...) | |
140 { | |
141 /* | |
142 * for outputting a centered string at the bottom | |
143 * of our window for a while | |
144 */ | |
145 va_list ar; | |
146 char m[MESSAGE_SIZE]; | |
5870 | 147 unsigned int old_len = strlen(osdmessagetext); |
148 | |
1511 | 149 va_start(ar, fmt); |
150 vsprintf(m, fmt, ar); | |
151 va_end(ar); | |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
152 if (deko==1) sprintf(osdmessagetext, MESSAGE_DEKO , m); |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
153 else strcpy(osdmessagetext, m); |
5870 | 154 |
155 if(old_len > strlen(osdmessagetext)) { | |
156 memset(c->textbuffer + osdy * aa_scrwidth(c) + osdx,' ',old_len); | |
157 memset(c->attrbuffer + osdy * aa_scrwidth(c) + osdx,0,old_len); | |
158 } | |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
159 showosdmessage=1; |
1511 | 160 stoposd = time(NULL) + duration; |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
161 osdx=(aa_scrwidth(c) / 2) - (strlen(osdmessagetext) / 2 ) ; |
1511 | 162 posbar[0]='\0'; |
163 } | |
164 | |
165 void | |
166 osdpercent(int duration, int deko, int min, int max, int val, char * desc, char * unit) | |
167 { | |
168 /* | |
169 * prints a bar for setting values | |
170 */ | |
171 float step; | |
172 int where; | |
173 int i; | |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
174 |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
175 |
1511 | 176 step=(float)aa_scrwidth(c) /(float)(max-min); |
177 where=(val-min)*step; | |
5870 | 178 osdmessage(duration,deko,"%s: %i%s",desc, val, unit); |
1511 | 179 posbar[0]='|'; |
180 posbar[aa_scrwidth(c)-1]='|'; | |
181 for (i=0;i<aa_scrwidth(c);i++){ | |
182 if (i==where) posbar[i]='#'; | |
183 else posbar[i]='-'; | |
184 } | |
185 if (where!=0) posbar[0]='|'; | |
186 if (where!=(aa_scrwidth(c)-1) ) posbar[aa_scrwidth(c)-1]='|'; | |
5870 | 187 |
1511 | 188 posbar[aa_scrwidth(c)]='\0'; |
5870 | 189 |
1511 | 190 } |
191 | |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
192 void |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
193 printosdtext() |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
194 { |
5870 | 195 if(osd_text_length > 0 && !vo_osd_text) { |
196 memset(c->textbuffer,' ',osd_text_length); | |
197 memset(c->attrbuffer,0,osd_text_length); | |
198 osd_text_length = 0; | |
199 } | |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
200 /* |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
201 * places the mplayer status osd |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
202 */ |
6757
f72fc85934e5
10L bugs founds by Jindrich Makovicka <makovicki at KMLinux dot fjfi dot cvuti dot cz>
albeu
parents:
6522
diff
changeset
|
203 if (vo_osd_text && vo_osd_text[0] != 0) { |
5870 | 204 int len; |
205 if(vo_osd_text[0] < 32) { | |
206 len = strlen(__sub_osd_names_short[vo_osd_text[0]]) + strlen(vo_osd_text+1) + 2; | |
207 aa_printf(c, 0, 0 , aaopt_osdcolor, "%s %s ", __sub_osd_names_short[vo_osd_text[0]], vo_osd_text+1); | |
208 } else { | |
209 len = strlen(vo_osd_text) + 1; | |
210 aa_printf(c, 0, 0 , aaopt_osdcolor, "%s ",vo_osd_text); | |
211 } | |
212 | |
213 if(len < osd_text_length) { | |
214 memset(c->textbuffer + len,' ',osd_text_length - len); | |
215 memset(c->attrbuffer + len,0,osd_text_length - len); | |
216 } | |
217 osd_text_length = len; | |
218 | |
219 } | |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
220 } |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
221 |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
222 void |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
223 printosdprogbar(){ |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
224 /* print mplayer osd-progbar */ |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
225 if (vo_osd_progbar_type!=-1){ |
2498 | 226 osdpercent(1,1,0,255,vo_osd_progbar_value, __sub_osd_names[vo_osd_progbar_type], ""); |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
227 } |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
228 } |
1511 | 229 static uint32_t |
4433 | 230 config(uint32_t width, uint32_t height, uint32_t d_width, |
1511 | 231 uint32_t d_height, uint32_t fullscreen, char *title, |
7124
eca7dbad0166
finally removed query_vaa, bes_da and vo_tune_info - the obsoleted libvo api
alex
parents:
6809
diff
changeset
|
232 uint32_t format) { |
1511 | 233 /* |
234 * main init | |
235 * called by mplayer | |
236 */ | |
5870 | 237 |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
238 int i; |
1511 | 239 |
5870 | 240 aspect_save_orig(width,height); |
241 aspect_save_prescale(d_width,d_height); | |
1511 | 242 |
5870 | 243 src_height = height; |
244 src_width = width; | |
1511 | 245 image_format = format; |
246 | |
247 /* nothing will change its size, be we need some values initialized */ | |
248 resize(); | |
249 | |
1554 | 250 #ifdef USE_OSD |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
251 /* now init out own 'font' (to use vo_draw_text_sub without edit them) */ |
5870 | 252 if(!vo_font_save) vo_font_save = vo_font; |
253 if(vo_font == vo_font_save) { | |
254 vo_font=malloc(sizeof(font_desc_t));//if(!desc) return NULL; | |
255 memset(vo_font,0,sizeof(font_desc_t)); | |
256 vo_font->pic_a[0]=malloc(sizeof(raw_file)); | |
9176 | 257 memset(vo_font->pic_a[0],0,sizeof(raw_file)); |
5870 | 258 vo_font->pic_b[0]=malloc(sizeof(raw_file)); |
9176 | 259 memset(vo_font->pic_b[0],0,sizeof(raw_file)); |
1572 | 260 |
7140
b9ce54c7f30f
add Jindrich Makovicka <makovick@KMLinux.fjfi.cvut.cz> freetype patch
pontscho
parents:
7124
diff
changeset
|
261 #ifdef HAVE_FREETYPE |
b9ce54c7f30f
add Jindrich Makovicka <makovick@KMLinux.fjfi.cvut.cz> freetype patch
pontscho
parents:
7124
diff
changeset
|
262 vo_font->dynamic = 0; |
b9ce54c7f30f
add Jindrich Makovicka <makovick@KMLinux.fjfi.cvut.cz> freetype patch
pontscho
parents:
7124
diff
changeset
|
263 #endif |
b9ce54c7f30f
add Jindrich Makovicka <makovick@KMLinux.fjfi.cvut.cz> freetype patch
pontscho
parents:
7124
diff
changeset
|
264 |
5870 | 265 vo_font->spacewidth=1; |
266 vo_font->charspace=0; | |
267 vo_font->height=1; | |
268 vo_font->pic_a[0]->bmp=malloc(255); | |
9176 | 269 vo_font->pic_a[0]->pal=NULL; |
5870 | 270 vo_font->pic_b[0]->bmp=malloc(255); |
9176 | 271 vo_font->pic_b[0]->pal=NULL; |
5870 | 272 vo_font->pic_a[0]->w=1; |
273 vo_font->pic_a[0]->h=1; | |
274 for (i=0; i<255; i++){ | |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
275 vo_font->width[i]=1; |
1572 | 276 vo_font->font[i]=0; |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
277 vo_font->start[i]=i; |
1572 | 278 vo_font->pic_a[0]->bmp[i]=i; |
279 vo_font->pic_b[0]->bmp[i]=i; | |
5870 | 280 } |
281 } | |
1554 | 282 #endif |
1511 | 283 /* say hello */ |
7625 | 284 osdmessage(5, 1, "Welcome to ASCII ART MPlayer"); |
1511 | 285 |
5870 | 286 mp_msg(MSGT_VO,MSGL_V,"VO: [aa] screendriver: %s\n", c->driver->name); |
287 mp_msg(MSGT_VO,MSGL_V,"VO: [aa] keyboarddriver: %s\n", c->kbddriver->name); | |
1511 | 288 |
5870 | 289 mp_msg(MSGT_VO,MSGL_INFO, |
1511 | 290 "\n" |
1537
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
291 "Important Options\n" |
1518 | 292 "\t-aaextended use use all 256 characters\n" |
293 "\t-aaeight use eight bit ascii\n" | |
1537
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
294 "\t-aadriver set recommended aalib driver (X11,curses,linux)\n" |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
295 "\t-aahelp to see all options provided by aalib\n" |
1518 | 296 "\n" |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
297 "AA-MPlayer Keys\n" |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
298 "\t1 : contrast -\n" |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
299 "\t2 : contrast +\n" |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
300 "\t3 : brightness -\n" |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
301 "\t4 : brightness +\n" |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
302 "\t5 : fast rendering\n" |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
303 "\t6 : dithering\n" |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
304 "\t7 : invert image\n" |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
305 "\ta : toggles between aa and mplayer control\n" |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
306 |
1511 | 307 "\n" |
1527 | 308 "All other keys are MPlayer defaults.\n" |
1511 | 309 |
310 | |
311 ); | |
312 | |
313 return 0; | |
314 } | |
315 | |
316 static uint32_t | |
317 query_format(uint32_t format) { | |
318 /* | |
319 * ...are we able to... ? | |
320 * called by mplayer | |
5870 | 321 * All input format supported by the sws |
1511 | 322 */ |
323 switch(format){ | |
324 case IMGFMT_YV12: | |
5870 | 325 case IMGFMT_I420: |
326 case IMGFMT_IYUV: | |
327 case IMGFMT_IYU2: | |
328 case IMGFMT_BGR32: | |
5027 | 329 case IMGFMT_BGR24: |
5870 | 330 case IMGFMT_BGR16: |
331 case IMGFMT_BGR15: | |
332 case IMGFMT_RGB32: | |
333 case IMGFMT_RGB24: | |
334 case IMGFMT_Y8: | |
335 case IMGFMT_Y800: | |
6210 | 336 return VFCAP_CSP_SUPPORTED|VFCAP_SWSCALE |
6205 | 337 #ifdef USE_OSD |
338 | VFCAP_OSD | |
339 #endif | |
340 ; | |
1511 | 341 } |
342 return 0; | |
343 } | |
344 | |
345 static uint32_t | |
346 draw_frame(uint8_t *src[]) { | |
5870 | 347 int stride[3] = { 0 , 0 , 0 }; |
348 | |
349 switch(image_format) { | |
350 case IMGFMT_BGR15: | |
351 case IMGFMT_BGR16: | |
352 stride[0] = src_width*2; | |
353 break; | |
354 case IMGFMT_IYU2: | |
355 case IMGFMT_BGR24: | |
356 stride[0] = src_width*3; | |
357 break; | |
358 case IMGFMT_BGR32: | |
359 stride[0] = src_width*4; | |
360 break; | |
361 } | |
362 | |
9697 | 363 sws_scale_ordered(sws,src,stride,0,src_height,image,image_stride); |
5870 | 364 |
365 /* Now 'ASCIInate' the image */ | |
366 if (fast) | |
367 aa_fastrender(c, screen_x, screen_y, screen_w + screen_x, screen_h + screen_y ); | |
368 else | |
369 aa_render(c, p,screen_x, screen_y, screen_w + screen_x, screen_h + screen_y ); | |
370 | |
371 return 0; | |
1511 | 372 } |
373 | |
374 static uint32_t | |
375 draw_slice(uint8_t *src[], int stride[], | |
376 int w, int h, int x, int y) { | |
5870 | 377 |
378 int dx1 = screen_x + (x * screen_w / src_width); | |
379 int dy1 = screen_y + (y * screen_h / src_height); | |
380 int dx2 = screen_x + ((x+w) * screen_w / src_width); | |
381 int dy2 = screen_y + ((y+h) * screen_h / src_height); | |
382 | |
9697 | 383 sws_scale_ordered(sws,src,stride,y,h,image,image_stride); |
1511 | 384 |
5870 | 385 /* Now 'ASCIInate' the image */ |
386 if (fast) | |
387 aa_fastrender(c, dx1, dy1, dx2, dy2 ); | |
388 else | |
389 aa_render(c, p,dx1, dy1, dx2, dy2 ); | |
4674 | 390 |
5870 | 391 |
392 return 0; | |
1511 | 393 } |
394 | |
395 static void | |
396 flip_page(void) { | |
5870 | 397 |
398 /* do we have to put *our* (messages, progbar) osd to aa's txtbuf ? */ | |
399 if (showosdmessage) | |
400 { | |
401 if (time(NULL)>=stoposd ) { | |
402 showosdmessage=0; | |
403 if(osdmessagetext) { | |
404 memset(c->textbuffer + osdy * aa_scrwidth(c) + osdx,' ',strlen(osdmessagetext)); | |
405 memset(c->attrbuffer + osdy * aa_scrwidth(c) + osdx ,0,strlen(osdmessagetext)); | |
406 osdmessagetext[0] = '\0'; | |
407 } | |
408 if(posbar) { | |
409 memset(c->textbuffer + (osdy+1) * aa_scrwidth(c),' ',strlen(posbar)); | |
410 memset(c->attrbuffer + (osdy+1) * aa_scrwidth(c),0,strlen(posbar)); | |
411 } | |
412 } else { | |
413 /* update osd */ | |
414 aa_puts(c, osdx, osdy, AA_SPECIAL, osdmessagetext); | |
415 /* posbar? */ | |
416 if (posbar[0]!='\0') | |
417 aa_puts(c, 0, osdy + 1, AA_SPECIAL, posbar); | |
418 } | |
419 } | |
420 /* OSD time & playmode , subtitles */ | |
421 #ifdef USE_OSD | |
422 printosdtext(); | |
423 #endif | |
424 | |
425 | |
426 /* print out */ | |
427 aa_flush(c); | |
1511 | 428 } |
429 | |
430 static void | |
431 check_events(void) { | |
432 /* | |
433 * any events? | |
434 * called by show_image and mplayer | |
435 */ | |
436 int key; | |
437 while ((key=aa_getevent(c,0))!=AA_NONE ){ | |
438 if (key>255){ | |
439 /* some conversations */ | |
440 switch (key) { | |
441 case AA_UP: | |
442 mplayer_put_key(KEY_UP); | |
443 break; | |
444 case AA_DOWN: | |
445 mplayer_put_key(KEY_DOWN); | |
446 break; | |
447 case AA_LEFT: | |
448 mplayer_put_key(KEY_LEFT); | |
449 break; | |
450 case AA_RIGHT: | |
451 mplayer_put_key(KEY_RIGHT); | |
452 break; | |
453 case AA_ESC: | |
454 mplayer_put_key(KEY_ESC); | |
455 break; | |
456 case 65765: | |
457 mplayer_put_key(KEY_PAGE_UP); | |
458 break; | |
459 case 65766: | |
460 mplayer_put_key(KEY_PAGE_DOWN); | |
461 break; | |
462 default: | |
463 continue; /* aa lib special key */ | |
464 break; | |
465 } | |
466 } | |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
467 if (key=='a' || key=='A'){ |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
468 aaconfigmode=!aaconfigmode; |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
469 osdmessage(MESSAGE_DURATION, 1, "aa config mode is now %s", |
5870 | 470 aaconfigmode==1 ? "on. use keys 5-7" : "off"); |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
471 } |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
472 if (aaconfigmode==1) { |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
473 switch (key) { |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
474 /* AA image controls */ |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
475 case '5': |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
476 fast=!fast; |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
477 osdmessage(MESSAGE_DURATION, 1, "Fast mode is now %s", fast==1 ? "on" : "off"); |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
478 break; |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
479 case '6': |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
480 if (p->dither==AA_FLOYD_S){ |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
481 p->dither=AA_NONE; |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
482 osdmessage(MESSAGE_DURATION, 1, "Dithering: Off"); |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
483 }else if (p->dither==AA_NONE){ |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
484 p->dither=AA_ERRORDISTRIB; |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
485 osdmessage(MESSAGE_DURATION, 1, "Dithering: Error Distribution"); |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
486 }else if (p->dither==AA_ERRORDISTRIB){ |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
487 p->dither=AA_FLOYD_S; |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
488 osdmessage(MESSAGE_DURATION, 1, "Dithering: Floyd Steinberg"); |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
489 } |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
490 break; |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
491 case '7': |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
492 p->inversion=!p->inversion; |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
493 osdmessage(MESSAGE_DURATION, 1, "Invert mode is now %s", |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
494 p->inversion==1 ? "on" : "off"); |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
495 break; |
1511 | 496 |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
497 default : |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
498 /* nothing if we're interested in? |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
499 * the mplayer should handle it! |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
500 */ |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
501 mplayer_put_key(key); |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
502 break; |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
503 } |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
504 }// aaconfigmode |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
505 else mplayer_put_key(key); |
1511 | 506 } |
507 } | |
508 | |
509 static void | |
510 uninit(void) { | |
511 /* | |
512 * THE END | |
5870 | 513 */ |
514 | |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
515 if (strstr(c->driver->name,"Curses") || strstr(c->driver->name,"Linux")){ |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
516 freopen("/dev/tty", "w", stderr); |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
517 } |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
518 #ifdef USE_OSD |
5870 | 519 if(vo_font_save) { |
520 free(vo_font->pic_a[0]->bmp); | |
521 free(vo_font->pic_a[0]); | |
522 free(vo_font->pic_b[0]->bmp); | |
523 free(vo_font->pic_b[0]); | |
524 free(vo_font); | |
525 vo_font = vo_font_save; | |
526 vo_font_save = NULL; | |
527 } | |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
528 #endif |
1511 | 529 aa_close(c); |
530 } | |
531 | |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
532 #ifdef USE_OSD |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
533 static void draw_alpha(int x,int y, int w,int h, unsigned char* src, unsigned char *srca, int stride){ |
7140
b9ce54c7f30f
add Jindrich Makovicka <makovick@KMLinux.fjfi.cvut.cz> freetype patch
pontscho
parents:
7124
diff
changeset
|
534 int i,j; |
b9ce54c7f30f
add Jindrich Makovicka <makovick@KMLinux.fjfi.cvut.cz> freetype patch
pontscho
parents:
7124
diff
changeset
|
535 for (i = 0; i < h; i++) { |
b9ce54c7f30f
add Jindrich Makovicka <makovick@KMLinux.fjfi.cvut.cz> freetype patch
pontscho
parents:
7124
diff
changeset
|
536 for (j = 0; j < w; j++) { |
b9ce54c7f30f
add Jindrich Makovicka <makovick@KMLinux.fjfi.cvut.cz> freetype patch
pontscho
parents:
7124
diff
changeset
|
537 if (src[i*stride+j] > 0) { |
b9ce54c7f30f
add Jindrich Makovicka <makovick@KMLinux.fjfi.cvut.cz> freetype patch
pontscho
parents:
7124
diff
changeset
|
538 c->textbuffer[x + j + (y+i)*aa_scrwidth(c)] = src[i*stride+j]; |
b9ce54c7f30f
add Jindrich Makovicka <makovick@KMLinux.fjfi.cvut.cz> freetype patch
pontscho
parents:
7124
diff
changeset
|
539 c->attrbuffer[x + j + (y+i)*aa_scrwidth(c)] = aaopt_subcolor; |
b9ce54c7f30f
add Jindrich Makovicka <makovick@KMLinux.fjfi.cvut.cz> freetype patch
pontscho
parents:
7124
diff
changeset
|
540 } |
b9ce54c7f30f
add Jindrich Makovicka <makovick@KMLinux.fjfi.cvut.cz> freetype patch
pontscho
parents:
7124
diff
changeset
|
541 } |
b9ce54c7f30f
add Jindrich Makovicka <makovick@KMLinux.fjfi.cvut.cz> freetype patch
pontscho
parents:
7124
diff
changeset
|
542 } |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
543 } |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
544 |
5870 | 545 static void clear_alpha(int x0,int y0, int w,int h) { |
546 int l; | |
547 | |
548 for(l = 0 ; l < h ; l++) { | |
549 memset(c->textbuffer + (y0 + l) * aa_scrwidth(c) + x0,' ',w); | |
550 memset(c->attrbuffer + (y0 + l) * aa_scrwidth(c) + x0,0,w); | |
551 } | |
552 } | |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
553 |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
554 |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
555 #endif |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
556 |
1511 | 557 static void |
558 draw_osd(void){ | |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
559 #ifdef USE_OSD |
1575 | 560 char * vo_osd_text_save; |
561 int vo_osd_progbar_type_save; | |
562 | |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
563 printosdprogbar(); |
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
564 /* let vo_draw_text only write subtitle */ |
1575 | 565 vo_osd_text_save=vo_osd_text; /* we have to save the osd_text */ |
566 vo_osd_text=NULL; | |
567 vo_osd_progbar_type_save=vo_osd_progbar_type; | |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
568 vo_osd_progbar_type=-1; |
5870 | 569 vo_remove_text(aa_scrwidth(c), aa_scrheight(c),clear_alpha); |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
570 vo_draw_text(aa_scrwidth(c), aa_scrheight(c), draw_alpha); |
1575 | 571 vo_osd_text=vo_osd_text_save; |
572 vo_osd_progbar_type=vo_osd_progbar_type_save; | |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
573 #endif |
1511 | 574 } |
1537
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
575 |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
576 int |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
577 getcolor(char * s){ |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
578 int i; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
579 char * rest; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
580 if (s==NULL) return -1; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
581 i=strtol(s, &rest, 10); |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
582 if ((rest==NULL || strlen(rest)==0) && i>=0 && i<=5) return i; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
583 if (!strcasecmp(s, "normal")) return AA_NORMAL; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
584 else if (!strcasecmp(s, "dim")) return AA_DIM; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
585 else if (!strcasecmp(s, "bold")) return AA_BOLD; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
586 else if (!strcasecmp(s, "boldfont")) return AA_BOLDFONT; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
587 else if (!strcasecmp(s, "special")) return AA_SPECIAL; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
588 else return -1; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
589 } |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
590 |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
591 int |
9756 | 592 vo_aa_parseoption(m_option_t * conf, char *opt, char *param){ |
1537
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
593 /* got an option starting with aa */ |
4094
f2abd12e9231
'mplayer -aadriver stdout' segfault fixed by Fredrik Kuivinen <freku045@student.liu.se>
arpi
parents:
2732
diff
changeset
|
594 char *pseudoargv[4]; |
1537
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
595 int pseudoargc; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
596 char * x, *help; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
597 int i; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
598 /* do WE need it ? */ |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
599 if (!strcasecmp(opt, "aaosdcolor")){ |
9756 | 600 if (param==NULL) return M_OPT_MISSING_PARAM; |
601 if ((i=getcolor(param))==-1) return M_OPT_OUT_OF_RANGE; | |
1537
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
602 aaopt_osdcolor=i; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
603 return 1; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
604 }else if (!strcasecmp(opt, "aasubcolor")){ |
9756 | 605 if ((i=getcolor(param))==-1) return M_OPT_OUT_OF_RANGE; |
1537
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
606 aaopt_subcolor=i; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
607 return 1; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
608 }else if (!strcasecmp(opt, "aahelp")){ |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
609 printf("Here are the aalib options:\n"); |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
610 help=strdup(aa_help); /* aa_help is const :( */ |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
611 x=strtok(help,"-"); |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
612 printf(x); |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
613 while ((x=strtok(NULL, "-"))){ |
1537
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
614 if (*(x-2)==' ') printf("-aa"); |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
615 else printf("-"); |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
616 printf("%s", x); |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
617 } |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
618 printf( |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
619 "\n" |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
620 "\n" |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
621 "Additional options vo_aa provides:\n" |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
622 " -aaosdcolor set osd color\n" |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
623 " -aasubcolor set subtitle color\n" |
7625 | 624 " the color parameters are:\n" |
1537
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
625 " 0 : normal\n" |
7625 | 626 " 1 : dim\n" |
1537
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
627 " 2 : bold\n" |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
628 " 3 : boldfont\n" |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
629 " 4 : reverse\n" |
7625 | 630 " 5 : special\n" |
1537
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
631 "\n\n" |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
632 " dT8 8Tb\n" |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
633 " dT 8 8 Tb\n" |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
634 " dT 8 8 Tb\n" |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
635 " <PROJECT><PROJECT>\n" |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
636 " dT 8 8 Tb\n" |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
637 " dT 8 8 Tb\n" |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
638 "\n" |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
639 |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
640 ); |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
641 exit(0); |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
642 |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
643 }else{ |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
644 /* parse param to aalib */ |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
645 pseudoargv[1]=malloc(strlen(opt)); |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
646 pseudoargv[3]=NULL; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
647 sprintf(pseudoargv[1], "-%s", opt+2); |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
648 if (param!=NULL){ |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
649 pseudoargv[2]=param; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
650 pseudoargc=3; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
651 }else{ |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
652 pseudoargv[2]=NULL; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
653 pseudoargc=2; |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
654 } |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
655 fprintf(stderr,"VO: [aa] "); |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
656 i=aa_parseoptions(&aa_defparams, &aa_defrenderparams, &pseudoargc, pseudoargv); |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
657 if (i!=1){ |
9756 | 658 return M_OPT_MISSING_PARAM; |
1537
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
659 } |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
660 if (pseudoargv[1]!=NULL){ |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
661 /* aalib has given param back */ |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
662 fprintf(stderr," Parameter -%s accepted\n", opt); |
1537
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
663 return 0; /* param could be the filename */ |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
664 } |
1551
267816fbdab3
vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents:
1538
diff
changeset
|
665 fprintf(stderr," Parameter -%s %s accepted\n", opt, ((param==NULL) ? "" : param) ); |
1537
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
666 return 1; /* all opt & params accepted */ |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
667 |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
668 } |
10595
522afd56703c
100l to albeu for his english grammar, and 10l to me becouse I noticed that lately (my backward compatibilty macro uses M_OPT_UNKNOWN)
alex
parents:
10233
diff
changeset
|
669 return M_OPT_UNKNOWN; |
1537
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
670 |
7bdf6a585b67
All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents:
1527
diff
changeset
|
671 } |
4258 | 672 |
673 void | |
9756 | 674 vo_aa_revertoption(m_option_t* opt,char* param) { |
5870 | 675 if (!strcasecmp(param, "aaosdcolor")) |
4258 | 676 aaopt_osdcolor= AA_SPECIAL; |
5870 | 677 else if (!strcasecmp(param, "aasubcolor")) |
4258 | 678 aaopt_subcolor= AA_SPECIAL; |
679 } | |
680 | |
4352 | 681 static uint32_t preinit(const char *arg) |
682 { | |
5870 | 683 char * hidis = NULL; |
684 struct stat sbuf; | |
685 int fd, vt, major, minor; | |
686 FILE * fp; | |
687 char fname[12]; | |
688 extern aa_linkedlist *aa_displayrecommended; | |
689 | |
4737
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4674
diff
changeset
|
690 if(arg) |
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4674
diff
changeset
|
691 { |
5870 | 692 mp_msg(MSGT_VO,MSGL_ERR,"vo_aa: Unknown subdevice: %s\n",arg); |
4737
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4674
diff
changeset
|
693 return ENOSYS; |
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4674
diff
changeset
|
694 } |
5870 | 695 |
696 /* initializing of aalib */ | |
697 | |
698 hidis=aa_getfirst(&aa_displayrecommended); | |
699 if ( hidis==NULL ){ | |
700 /* check /dev/vcsa<vt> */ | |
701 /* check only, if no driver is explicit set */ | |
702 fd = dup (fileno (stderr)); | |
703 fstat (fd, &sbuf); | |
704 major = sbuf.st_rdev >> 8; | |
705 vt = minor = sbuf.st_rdev & 0xff; | |
706 close (fd); | |
707 sprintf (fname, "/dev/vcsa%2.2i", vt); | |
708 fp = fopen (fname, "w+"); | |
709 if (fp==NULL){ | |
710 fprintf(stderr,"VO: [aa] cannot open %s for writing," | |
711 "so we'll not use linux driver\n", fname); | |
712 aa_recommendlowdisplay("linux"); | |
713 aa_recommendhidisplay("curses"); | |
714 aa_recommendhidisplay("X11"); | |
715 }else fclose(fp); | |
716 } else aa_recommendhidisplay(hidis); | |
717 c = aa_autoinit(&aa_defparams); | |
718 | |
719 if (c == NULL) { | |
7625 | 720 mp_msg(MSGT_VO,MSGL_ERR,"Cannot initialize aalib\n"); |
5870 | 721 return VO_ERROR; |
722 } | |
723 if (!aa_autoinitkbd(c,0)) { | |
7625 | 724 mp_msg(MSGT_VO,MSGL_ERR,"Cannot initialize keyboard\n"); |
5870 | 725 aa_close(c); |
726 return VO_ERROR; | |
727 } | |
728 | |
729 aa_resizehandler(c, (void *)resize); | |
730 aa_hidecursor(c); | |
731 p = aa_getrenderparams(); | |
732 | |
733 if ((strstr(c->driver->name,"Curses")) || (strstr(c->driver->name,"Linux"))){ | |
734 freopen("/dev/null", "w", stderr); | |
735 /* disable console blanking */ | |
736 printf("\033[9;0]"); | |
737 } | |
738 | |
739 memset(image,0,3*sizeof(uint8_t)); | |
740 osdmessagetext[0] = '\0'; | |
741 osdx = osdy = 0; | |
742 | |
4737
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4674
diff
changeset
|
743 return 0; |
4352 | 744 } |
745 | |
4596 | 746 static uint32_t control(uint32_t request, void *data, ...) |
4352 | 747 { |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
748 switch (request) { |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
749 case VOCTRL_QUERY_FORMAT: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
750 return query_format(*((uint32_t*)data)); |
6809
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
751 case VOCTRL_SET_EQUALIZER: { |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
752 va_list ap; |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
753 int val; |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
754 |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
755 va_start(ap, data); |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
756 val = va_arg(ap, int); |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
757 va_end(ap); |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
758 |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
759 if(strcmp((char*)data,"contrast") == 0) |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
760 p->contrast = ( val + 100 ) * 64 / 100; |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
761 else if(strcmp((char*)data,"brightness") == 0) |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
762 p->bright = ( val + 100) * 128 / 100; |
5870 | 763 return VO_TRUE; |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
764 } |
6809
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
765 case VOCTRL_GET_EQUALIZER: { |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
766 va_list ap; |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
767 int* val; |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
768 |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
769 va_start(ap, data); |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
770 val = va_arg(ap, int*); |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
771 va_end(ap); |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
772 |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
773 if(strcmp((char*)data,"contrast") == 0) |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
774 *val = (p->contrast - 64) * 100 / 64; |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
775 else if(strcmp((char*)data,"brightness") == 0) |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
776 *val = (p->bright - 128) * 100 / 128; |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
777 |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
778 return VO_TRUE; |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
779 } |
0250f691037e
10L bugs founds by Jindrich Makovicka <makovick at MLinux dot fjfi dot cvut dotcz>
albeu
parents:
6757
diff
changeset
|
780 } |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
781 return VO_NOTIMPL; |
4352 | 782 } |