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