annotate libvo/vo_aa.c @ 5584:f1519e4447a0

obsolete
author arpi
date Sat, 13 Apr 2002 01:42:23 +0000
parents 302fe25185c4
children 125d667e9eac
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
2 * MPlayer
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
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
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
5 *
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
6 * by Folke Ashberg <folke@ashberg.de>
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
7 *
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
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
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
10 *
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
11 */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
12
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
13 #include <stdio.h>
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
14 #include <stdlib.h>
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
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
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
18
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
19 #include <limits.h>
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
20 #include <math.h>
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
21 #include <stdarg.h>
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
22 #include <time.h>
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
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
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
25
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
26 #include "config.h"
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
27 #include "video_out.h"
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
28 #include "video_out_internal.h"
2732
ae79207a3055 Move yuv2rgb to postprocess
nick
parents: 2498
diff changeset
29 #include "../postproc/rgb2rgb.h"
5295
302fe25185c4 moved font_laod.h
arpi
parents: 5027
diff changeset
30 #include "font_load.h"
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
31 #include "sub.h"
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
32
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
33 #include "linux/keycodes.h"
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
34 #include <aalib.h>
1537
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
35 #include "cfgparser.h"
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
36
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
37 #define RGB 0
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
38 #define BGR 1
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
39
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
40 #define DO_INC(val,max,step) if (val + step <=max) val+=step; else val=max;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
41 #define DO_DEC(val,min,step) if (val - step >=min) val-=step; else val=min;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
42
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
43 #define MESSAGE_DURATION 3
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
44 #define MESSAGE_SIZE 512
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
45 #define MESSAGE_DEKO " +++ %s +++ "
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
46
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
47 LIBVO_EXTERN(aa)
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
48
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
49 static vo_info_t vo_info = {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
50 "AAlib",
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
51 "aa",
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
52 "Folke Ashberg <folke@ashberg.de>",
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
53 ""
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
54 };
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
55
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
56 /* aa's main context we use */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
57 aa_context *c;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
58 aa_renderparams *p;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
59 static int fast =0;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
60 /* used for YV12 streams for the converted RGB image */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
61 uint8_t * convertbuf=NULL;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
62
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
63 /* image infos */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
64 static int image_format, bpp=24;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
65 static int image_width;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
66 static int image_height;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
67 static int bppmul;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
68
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
69 /* osd stuff */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
70 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
71 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
72 char osdmessagetext[MESSAGE_SIZE];
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
73 char posbar[MESSAGE_SIZE];
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
74 static int osdx, osdy;
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
75 int aaconfigmode=1;
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
76 /* for resizing/scaling */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
77 static int *stx;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
78 static int *sty;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
79 double accum;
1551
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
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
81 char * osdbuffer=NULL;
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
82 #endif
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
83
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
84 /* our version of the playmodes :) */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
85
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
86 extern void mplayer_put_key(int code);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
87
1518
e0ceb814471d vo_aa: configurable now
folke
parents: 1511
diff changeset
88 /* to disable stdout outputs when curses/linux mode */
e0ceb814471d vo_aa: configurable now
folke
parents: 1511
diff changeset
89 extern int quiet;
e0ceb814471d vo_aa: configurable now
folke
parents: 1511
diff changeset
90
1537
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
91 /* configuration */
1518
e0ceb814471d vo_aa: configurable now
folke
parents: 1511
diff changeset
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
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
97
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
98 void
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
99 resize(void){
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
100 /*
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
101 * this function is called by aa lib if windows resizes
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
102 * further during init, because here we have to calculate
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
103 * a little bit
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
104 */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
105
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
106 int i;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
107 aa_resize(c);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
108
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
109 showosdmessage=0;
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
110 osdy=aa_scrheight(c) - ( aa_scrheight(c)/10 );
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
111
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
112 /* now calculating the needed values for resizing */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
113
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
114 /* We only need to use floating point to determine the correct
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
115 stretch vector for one line's worth. */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
116 stx = (int *) malloc(sizeof(int) * image_width);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
117 sty = (int *) malloc(sizeof(int) * image_height);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
118 accum = 0;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
119 for (i=0; (i < image_width); i++) {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
120 int got;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
121 accum += (double)aa_imgwidth(c)/(double)image_width;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
122 got = (int) floor(accum);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
123 stx[i] = got;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
124 accum -= got;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
125 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
126 accum = 0;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
127 for (i=0; (i < image_height); i++) {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
128 int got;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
129 accum += (double)aa_imgheight(c)/(double)image_height;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
130 got = (int) floor(accum);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
131 sty[i] = got;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
132 accum -= got;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
133 }
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
134 #ifdef USE_OSD
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
135 if (osdbuffer!=NULL) free(osdbuffer);
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
136 osdbuffer=malloc(aa_scrwidth(c) * aa_scrheight(c));
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
137 #endif
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
138 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
139
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
140 void
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
141 osdmessage(int duration, int deko, char *fmt, ...)
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
142 {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
143 /*
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
144 * for outputting a centered string at the bottom
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
145 * of our window for a while
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
146 */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
147 va_list ar;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
148 char m[MESSAGE_SIZE];
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
149 va_start(ar, fmt);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
150 vsprintf(m, fmt, ar);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
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);
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
154 showosdmessage=1;
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
155 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
156 osdx=(aa_scrwidth(c) / 2) - (strlen(osdmessagetext) / 2 ) ;
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
157 posbar[0]='\0';
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
158 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
159
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
160 void
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
161 osdpercent(int duration, int deko, int min, int max, int val, char * desc, char * unit)
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
162 {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
163 /*
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
164 * prints a bar for setting values
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
165 */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
166 float step;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
167 int where;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
168 char m[MESSAGE_SIZE];
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
169 int i;
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
170
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
171
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
172 step=(float)aa_scrwidth(c) /(float)(max-min);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
173 where=(val-min)*step;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
174 sprintf(m,"%s: %i%s",desc, val, unit);
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
175 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
176 else strcpy(osdmessagetext, m);
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
177 posbar[0]='|';
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
178 posbar[aa_scrwidth(c)-1]='|';
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
179 for (i=0;i<aa_scrwidth(c);i++){
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
180 if (i==where) posbar[i]='#';
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
181 else posbar[i]='-';
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
182 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
183 if (where!=0) posbar[0]='|';
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
184 if (where!=(aa_scrwidth(c)-1) ) posbar[aa_scrwidth(c)-1]='|';
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
185 /* snipp */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
186 posbar[aa_scrwidth(c)]='\0';
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
187 showosdmessage=1;
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
188 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
189 osdx=(aa_scrwidth(c) / 2) - (strlen(osdmessagetext) / 2 ) ;
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
190 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
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 {
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
195 /*
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
196 * 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
197 */
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
198 if (vo_osd_text)
2498
38bb41c48d1f never declare variables in *.h files, pls
nick
parents: 1577
diff changeset
199 aa_printf(c, 0, 0 , aaopt_osdcolor, "%s %s ", __sub_osd_names_short[vo_osd_text[0]], vo_osd_text+1);
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
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
202 void
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
203 printosdprogbar(){
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
204 /* 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
205 if (vo_osd_progbar_type!=-1){
2498
38bb41c48d1f never declare variables in *.h files, pls
nick
parents: 1577
diff changeset
206 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
207 }
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
208 }
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
209 static uint32_t
4433
df8e0f71cc3c new info for tuning
nick
parents: 4352
diff changeset
210 config(uint32_t width, uint32_t height, uint32_t d_width,
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
211 uint32_t d_height, uint32_t fullscreen, char *title,
4433
df8e0f71cc3c new info for tuning
nick
parents: 4352
diff changeset
212 uint32_t format,const vo_tune_info_t *info) {
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
213 /*
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
214 * main init
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
215 * called by mplayer
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
216 */
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
217 FILE * fp;
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
218 char fname[12];
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
219 int fd, vt, major, minor;
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
220 struct stat sbuf;
1576
2dff06ebfbb4 now linux/curses detection works
folke
parents: 1575
diff changeset
221 char * hidis = NULL;
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
222 int i;
1577
440782e33c81 aalib 1.4.X incombatibility fixed
folke
parents: 1576
diff changeset
223 extern aa_linkedlist *aa_displayrecommended;
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
224
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
225 switch(format) {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
226 case IMGFMT_BGR24:
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
227 bpp = 24;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
228 break;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
229 case IMGFMT_RGB24:
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
230 bpp = 24;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
231 break;
4674
5a7eb882bb19 rgb/bgr 32bpp and IYUV/I420 support
alex
parents: 4596
diff changeset
232 case IMGFMT_BGR32:
5a7eb882bb19 rgb/bgr 32bpp and IYUV/I420 support
alex
parents: 4596
diff changeset
233 bpp = 32;
5a7eb882bb19 rgb/bgr 32bpp and IYUV/I420 support
alex
parents: 4596
diff changeset
234 break;
5a7eb882bb19 rgb/bgr 32bpp and IYUV/I420 support
alex
parents: 4596
diff changeset
235 case IMGFMT_RGB32:
5a7eb882bb19 rgb/bgr 32bpp and IYUV/I420 support
alex
parents: 4596
diff changeset
236 bpp = 32;
5a7eb882bb19 rgb/bgr 32bpp and IYUV/I420 support
alex
parents: 4596
diff changeset
237 break;
5a7eb882bb19 rgb/bgr 32bpp and IYUV/I420 support
alex
parents: 4596
diff changeset
238 case IMGFMT_IYUV:
5a7eb882bb19 rgb/bgr 32bpp and IYUV/I420 support
alex
parents: 4596
diff changeset
239 case IMGFMT_I420:
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
240 case IMGFMT_YV12:
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
241 bpp = 24;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
242 /* YUV ? then initialize what we will need */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
243 convertbuf=malloc(width*height*3);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
244 yuv2rgb_init(24,MODE_BGR);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
245 break;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
246 default:
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
247 return 1;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
248 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
249 bppmul=bpp/8;
1537
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
250
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
251
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
252 /* initializing of aalib */
1518
e0ceb814471d vo_aa: configurable now
folke
parents: 1511
diff changeset
253
1577
440782e33c81 aalib 1.4.X incombatibility fixed
folke
parents: 1576
diff changeset
254 hidis=aa_getfirst(&aa_displayrecommended);
1575
2766b0d3863d osd problem with YV12 fixed
folke
parents: 1572
diff changeset
255 if ( hidis==NULL ){
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
256 /* check /dev/vcsa<vt> */
1575
2766b0d3863d osd problem with YV12 fixed
folke
parents: 1572
diff changeset
257 /* check only, if no driver is explicit set */
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
258 fd = dup (fileno (stderr));
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
259 fstat (fd, &sbuf);
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
260 major = sbuf.st_rdev >> 8;
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
261 vt = minor = sbuf.st_rdev & 0xff;
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
262 close (fd);
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
263 sprintf (fname, "/dev/vcsa%i", vt);
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
264 fp = fopen (fname, "w+");
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
265 if (fp==NULL){
1576
2dff06ebfbb4 now linux/curses detection works
folke
parents: 1575
diff changeset
266 fprintf(stderr,"VO: [aa] cannot open %s for writing,"
2dff06ebfbb4 now linux/curses detection works
folke
parents: 1575
diff changeset
267 "so we'll not use linux driver\n", fname);
1575
2766b0d3863d osd problem with YV12 fixed
folke
parents: 1572
diff changeset
268 aa_recommendlowdisplay("linux");
1576
2dff06ebfbb4 now linux/curses detection works
folke
parents: 1575
diff changeset
269 aa_recommendhidisplay("curses");
2dff06ebfbb4 now linux/curses detection works
folke
parents: 1575
diff changeset
270 aa_recommendhidisplay("X11");
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
271 }else fclose(fp);
1577
440782e33c81 aalib 1.4.X incombatibility fixed
folke
parents: 1576
diff changeset
272 } else aa_recommendhidisplay(hidis);
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
273 c = aa_autoinit(&aa_defparams);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
274 aa_resizehandler(c, (void *)resize);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
275
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
276 if (c == NULL) {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
277 printf("Can not intialize aalib\n");
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
278 return 0;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
279 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
280 if (!aa_autoinitkbd(c,0)) {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
281 printf("Can not intialize keyboard\n");
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
282 aa_close(c);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
283 return 0;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
284 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
285 /*
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
286 if (!aa_autoinitmouse(c,0)) {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
287 printf("Can not intialize mouse\n");
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
288 aa_close(c);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
289 return 0;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
290 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
291 */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
292 aa_hidecursor(c);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
293 p = aa_getrenderparams();
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
294
1520
c156984e545e write fault error fixed
folke
parents: 1518
diff changeset
295 if ((strstr(c->driver->name,"Curses")) || (strstr(c->driver->name,"Linux"))){
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
296 freopen("/dev/null", "w", stderr);
1518
e0ceb814471d vo_aa: configurable now
folke
parents: 1511
diff changeset
297 quiet=1; /* disable mplayer outputs */
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
298 /* disable console blanking */
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
299 printf("\033[9;0]");
1518
e0ceb814471d vo_aa: configurable now
folke
parents: 1511
diff changeset
300 }
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
301
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
302 image_height = height;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
303 image_width = width;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
304 image_format = format;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
305
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
306 /* needed by prepare_image */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
307 stx = (int *) malloc(sizeof(int) * image_width);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
308 sty = (int *) malloc(sizeof(int) * image_height);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
309
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
310 /* nothing will change its size, be we need some values initialized */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
311 resize();
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
312
1554
db379aa38e51 define USE_OSD / USE_SUB fixes
folke
parents: 1553
diff changeset
313 #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
314 /* now init out own 'font' (to use vo_draw_text_sub without edit them) */
1572
25c2ee4de8b1 vo_font SEGFAULT fixed
arpi
parents: 1554
diff changeset
315 vo_font=malloc(sizeof(font_desc_t));//if(!desc) return NULL;
25c2ee4de8b1 vo_font SEGFAULT fixed
arpi
parents: 1554
diff changeset
316 memset(vo_font,0,sizeof(font_desc_t));
25c2ee4de8b1 vo_font SEGFAULT fixed
arpi
parents: 1554
diff changeset
317 vo_font->pic_a[0]=malloc(sizeof(raw_file));
25c2ee4de8b1 vo_font SEGFAULT fixed
arpi
parents: 1554
diff changeset
318 vo_font->pic_b[0]=malloc(sizeof(raw_file));
25c2ee4de8b1 vo_font SEGFAULT fixed
arpi
parents: 1554
diff changeset
319
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
320 vo_font->spacewidth=1;
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
321 vo_font->charspace=0;
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
322 vo_font->height=1;
1572
25c2ee4de8b1 vo_font SEGFAULT fixed
arpi
parents: 1554
diff changeset
323 vo_font->pic_a[0]->bmp=malloc(255);
25c2ee4de8b1 vo_font SEGFAULT fixed
arpi
parents: 1554
diff changeset
324 vo_font->pic_b[0]->bmp=malloc(255);
25c2ee4de8b1 vo_font SEGFAULT fixed
arpi
parents: 1554
diff changeset
325 vo_font->pic_a[0]->w=1;
25c2ee4de8b1 vo_font SEGFAULT fixed
arpi
parents: 1554
diff changeset
326 vo_font->pic_a[0]->h=1;
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
327 for (i=1; i<256; i++){
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
328 vo_font->width[i]=1;
1572
25c2ee4de8b1 vo_font SEGFAULT fixed
arpi
parents: 1554
diff changeset
329 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
330 vo_font->start[i]=i;
1572
25c2ee4de8b1 vo_font SEGFAULT fixed
arpi
parents: 1554
diff changeset
331 vo_font->pic_a[0]->bmp[i]=i;
25c2ee4de8b1 vo_font SEGFAULT fixed
arpi
parents: 1554
diff changeset
332 vo_font->pic_b[0]->bmp[i]=i;
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
333 };
1554
db379aa38e51 define USE_OSD / USE_SUB fixes
folke
parents: 1553
diff changeset
334 #endif
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
335 /* say hello */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
336 osdmessage(5, 1, "Welcome to ASCII ARTS MPlayer");
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
337
1537
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
338 printf("VO: [aa] screendriver: %s\n", c->driver->name);
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
339 printf("VO: [aa] keyboarddriver: %s\n", c->kbddriver->name);
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
340 //printf("VO: mousedriver: %s\n", c->mousedriver->name);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
341
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
342 printf(
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
343 "\n"
1537
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
344 "Important Options\n"
1518
e0ceb814471d vo_aa: configurable now
folke
parents: 1511
diff changeset
345 "\t-aaextended use use all 256 characters\n"
e0ceb814471d vo_aa: configurable now
folke
parents: 1511
diff changeset
346 "\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
347 "\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
348 "\t-aahelp to see all options provided by aalib\n"
1518
e0ceb814471d vo_aa: configurable now
folke
parents: 1511
diff changeset
349 "\n"
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
350 "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
351 "\t1 : contrast -\n"
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
352 "\t2 : contrast +\n"
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
353 "\t3 : brightness -\n"
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
354 "\t4 : brightness +\n"
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
355 "\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
356 "\t6 : dithering\n"
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
357 "\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
358 "\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
359
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
360 "\n"
1527
187aa4b576a7 Fix OSD, small misspelling.
atmos4
parents: 1520
diff changeset
361 "All other keys are MPlayer defaults.\n"
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
362
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
363
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
364 );
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
365
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
366 return 0;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
367 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
368
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
369 static uint32_t
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
370 query_format(uint32_t format) {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
371 /*
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
372 * ...are we able to... ?
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
373 * called by mplayer
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
374 */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
375 switch(format){
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
376 case IMGFMT_YV12:
5027
0c7a6a9d2243 32bpp support not implemented - do not lie
arpi
parents: 4737
diff changeset
377 case IMGFMT_RGB24:
0c7a6a9d2243 32bpp support not implemented - do not lie
arpi
parents: 4737
diff changeset
378 case IMGFMT_BGR24:
0c7a6a9d2243 32bpp support not implemented - do not lie
arpi
parents: 4737
diff changeset
379 // case IMGFMT_RGB32:
0c7a6a9d2243 32bpp support not implemented - do not lie
arpi
parents: 4737
diff changeset
380 // case IMGFMT_BGR32:
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
381 return 1;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
382 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
383 return 0;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
384 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
385
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
386 static const vo_info_t*
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
387 get_info(void) {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
388 /* who i am? */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
389 return (&vo_info);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
390 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
391
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
392 int
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
393 prepare_image(uint8_t *data, int inx, int iny, int outx, int outy){
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
394 /*
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
395 * copies an RGB-Image to the aalib imagebuffer
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
396 * also scaling an grayscaling is done here
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
397 * show_image calls us
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
398 */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
399
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
400 int value;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
401 int x, y;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
402 int tox, toy;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
403 int ydest;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
404 int i;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
405 int pos;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
406
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
407 toy = 0;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
408 for (y=0; (y < (0 + iny)); y++) {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
409 for (ydest=0; (ydest < sty[y-0]); ydest++) {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
410 tox = 0;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
411 for (x=0; (x < (0 + inx)); x++) {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
412 if (!stx[x - 0]) {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
413 continue;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
414 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
415 pos=3*(inx*y)+(3*x);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
416 value=(data[pos]+data[pos+1]+data[pos+2])/3;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
417 for (i=0; (i < stx[x - 0]); i++) {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
418 //printf("ToX: %i, ToY %i, i=%i, stx=%i, x=%i\n", tox, toy, i, stx[x], x);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
419 c->imagebuffer[(toy*outx) +tox]=value;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
420 tox++;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
421 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
422 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
423 toy++;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
424 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
425 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
426 return 0;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
427 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
428
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
429 void
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
430 show_image(uint8_t * src){
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
431 /*
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
432 * every frame (flip_page/draw_frame) we will be called
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
433 */
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
434 #ifdef USE_OSD
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
435 int i;
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
436 #endif
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
437
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
438 /* events? */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
439 check_events();
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
440
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
441 /* RGB->gray , scaling/resizing, stores data in aalib imgbuf */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
442 prepare_image( src, image_width, image_height,
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
443 aa_imgwidth(c), aa_imgheight(c) );
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
444
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
445 /* Now 'ASCIInate' the image */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
446 if (fast)
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
447 aa_fastrender(c, 0, 0, aa_scrwidth(c), aa_scrheight(c) );
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
448 else
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
449 aa_render(c, p, 0, 0, aa_scrwidth(c), aa_scrheight(c));
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
450
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
451 /* do we have to put *our* (messages, progbar) osd to aa's txtbuf ? */
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
452 if (showosdmessage)
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
453 {
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
454 if (time(NULL)>=stoposd ) showosdmessage=0;
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
455 /* update osd */
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
456 aa_puts(c, osdx, osdy, AA_SPECIAL, osdmessagetext);
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
457 /* posbar? */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
458 if (posbar[0]!='\0')
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
459 aa_puts(c, 0, osdy + 1, AA_SPECIAL, posbar);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
460 }
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
461 /* OSD time & playmode , subtitles */
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
462 #ifdef USE_OSD
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
463 printosdtext();
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
464 /* now write the subtitle osd buffer */
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
465 for (i=0;i<aa_scrwidth(c)*aa_scrheight(c);i++){
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
466 if (osdbuffer[i]){
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
467 c->textbuffer[i]=osdbuffer[i];
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
468 c->attrbuffer[i]=aaopt_subcolor;
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
469 }
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 #endif
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
472
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
473 /* print out */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
474 aa_flush(c);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
475 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
476
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
477 static uint32_t
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
478 draw_frame(uint8_t *src[]) {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
479 /*
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
480 * RGB-Video's Only
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
481 * src[0] is handled by prepare_image
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
482 */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
483 show_image(src[0]);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
484 return 0;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
485 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
486
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
487 static uint32_t
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
488 draw_slice(uint8_t *src[], int stride[],
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
489 int w, int h, int x, int y) {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
490 /*
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
491 * for MPGEGS YV12
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
492 * draw a rectangle converted to RGB to a
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
493 * temporary RGB Buffer
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
494 */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
495 uint8_t *dst;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
496
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
497 dst = convertbuf+(image_width * y + x) * 3;
4674
5a7eb882bb19 rgb/bgr 32bpp and IYUV/I420 support
alex
parents: 4596
diff changeset
498 if ((image_format == IMGFMT_IYUV) || (image_format == IMGFMT_I420))
5a7eb882bb19 rgb/bgr 32bpp and IYUV/I420 support
alex
parents: 4596
diff changeset
499 {
5a7eb882bb19 rgb/bgr 32bpp and IYUV/I420 support
alex
parents: 4596
diff changeset
500 uint8_t *src_i420[3];
5a7eb882bb19 rgb/bgr 32bpp and IYUV/I420 support
alex
parents: 4596
diff changeset
501
5a7eb882bb19 rgb/bgr 32bpp and IYUV/I420 support
alex
parents: 4596
diff changeset
502 src_i420[0] = src[0];
5a7eb882bb19 rgb/bgr 32bpp and IYUV/I420 support
alex
parents: 4596
diff changeset
503 src_i420[1] = src[2];
5a7eb882bb19 rgb/bgr 32bpp and IYUV/I420 support
alex
parents: 4596
diff changeset
504 src_i420[2] = src[1];
5a7eb882bb19 rgb/bgr 32bpp and IYUV/I420 support
alex
parents: 4596
diff changeset
505 src = src_i420;
5a7eb882bb19 rgb/bgr 32bpp and IYUV/I420 support
alex
parents: 4596
diff changeset
506 }
5a7eb882bb19 rgb/bgr 32bpp and IYUV/I420 support
alex
parents: 4596
diff changeset
507
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
508 yuv2rgb(dst,src[0],src[1],src[2],w,h,image_width*3,stride[0],stride[1]);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
509
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
510 return 0;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
511 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
512
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
513 static void
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
514 flip_page(void) {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
515 /*
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
516 * wow! another ready Image, so draw it !
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
517 */
4674
5a7eb882bb19 rgb/bgr 32bpp and IYUV/I420 support
alex
parents: 4596
diff changeset
518 if(image_format == IMGFMT_YV12 || image_format == IMGFMT_IYUV || image_format == IMGFMT_I420)
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
519 show_image(convertbuf);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
520 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
521
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
522 static void
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
523 check_events(void) {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
524 /*
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
525 * any events?
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
526 * called by show_image and mplayer
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
527 */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
528 int key;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
529 while ((key=aa_getevent(c,0))!=AA_NONE ){
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
530 if (key>255){
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
531 /* some conversations */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
532 switch (key) {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
533 case AA_UP:
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
534 mplayer_put_key(KEY_UP);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
535 break;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
536 case AA_DOWN:
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
537 mplayer_put_key(KEY_DOWN);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
538 break;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
539 case AA_LEFT:
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
540 mplayer_put_key(KEY_LEFT);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
541 break;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
542 case AA_RIGHT:
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
543 mplayer_put_key(KEY_RIGHT);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
544 break;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
545 case AA_ESC:
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
546 mplayer_put_key(KEY_ESC);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
547 break;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
548 case 65765:
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
549 mplayer_put_key(KEY_PAGE_UP);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
550 break;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
551 case 65766:
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
552 mplayer_put_key(KEY_PAGE_DOWN);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
553 break;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
554 default:
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
555 continue; /* aa lib special key */
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
556 break;
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
557 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
558 }
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
559 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
560 aaconfigmode=!aaconfigmode;
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
561 osdmessage(MESSAGE_DURATION, 1, "aa config 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
562 aaconfigmode==1 ? "on. use keys 1-7" : "off");
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
563 }
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
564 if (aaconfigmode==1) {
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
565 switch (key) {
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
566 /* AA image controls */
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
567 case '1': /* contrast */
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
568 DO_DEC(p->contrast,0,1);
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
569 osdpercent(MESSAGE_DURATION, 1, 0, 255, p->contrast, "AA-Contrast", "");
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
570 break;
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
571 case '2': /* contrast */
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
572 DO_INC(p->contrast,255,1);
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
573 osdpercent(MESSAGE_DURATION, 1, 0, 255, p->contrast, "AA-Contrast", "");
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
574 break;
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
575 case '3': /* brightness */
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
576 DO_DEC(p->bright,0,1);
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
577 osdpercent(MESSAGE_DURATION, 1, 0, 255, p->bright, "AA-Brightnes", "");
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
578 break;
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
579 case '4': /* brightness */
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
580 DO_INC(p->bright,255,1);
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
581 osdpercent(MESSAGE_DURATION, 1, 0, 255, p->bright, "AA-Brightnes", "");
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
582 break;
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
583 case '5':
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
584 fast=!fast;
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
585 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
586 break;
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
587 case '6':
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
588 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
589 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
590 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
591 }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
592 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
593 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
594 }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
595 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
596 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
597 }
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
598 break;
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
599 case '7':
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
600 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
601 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
602 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
603 break;
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
604
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
605 default :
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
606 /* 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
607 * 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
608 */
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
609 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
610 break;
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
611 }
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
612 }// aaconfigmode
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
613 else mplayer_put_key(key);
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
614 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
615 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
616
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
617 static void
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
618 uninit(void) {
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
619 /*
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
620 * THE END
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
621 */
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
622 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
623 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
624 quiet=0; /* enable mplayer outputs */
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
625 }
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
626 #ifdef USE_OSD
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
627 if (osdbuffer!=NULL) free(osdbuffer);
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
628 #endif
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
629 aa_close(c);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
630 free(stx);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
631 free(sty);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
632 if (convertbuf!=NULL) free(convertbuf);
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
633 }
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
634
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
635 #ifdef USE_OSD
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
636 static void draw_alpha(int x,int y, int w,int h, unsigned char* src, unsigned char *srca, int stride){
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
637 /* alpha, hm, grr, only the char into our osdbuffer */
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
638 int pos;
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
639 pos=(x)+(y)*(aa_scrwidth(c));
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
640 osdbuffer[pos]=src[0];
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
641 }
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
642
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
643
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
644
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
645 #endif
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
646
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
647 static void
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
648 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
649 #ifdef USE_OSD
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
650 /*
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
651 * the subtiles are written into a own osdbuffer
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
652 * because draw_osd is called after show_image/flip_page
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
653 * the osdbuffer is written the next show_image/flip_page
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
654 * into aatextbuf
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
655 */
1575
2766b0d3863d osd problem with YV12 fixed
folke
parents: 1572
diff changeset
656 char * vo_osd_text_save;
2766b0d3863d osd problem with YV12 fixed
folke
parents: 1572
diff changeset
657 int vo_osd_progbar_type_save;
2766b0d3863d osd problem with YV12 fixed
folke
parents: 1572
diff changeset
658
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
659 memset(osdbuffer,0,aa_scrwidth(c)*aa_scrheight(c));
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
660 printosdprogbar();
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
661 /* let vo_draw_text only write subtitle */
1575
2766b0d3863d osd problem with YV12 fixed
folke
parents: 1572
diff changeset
662 vo_osd_text_save=vo_osd_text; /* we have to save the osd_text */
2766b0d3863d osd problem with YV12 fixed
folke
parents: 1572
diff changeset
663 vo_osd_text=NULL;
2766b0d3863d osd problem with YV12 fixed
folke
parents: 1572
diff changeset
664 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
665 vo_osd_progbar_type=-1;
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
666 vo_draw_text(aa_scrwidth(c), aa_scrheight(c), draw_alpha);
1575
2766b0d3863d osd problem with YV12 fixed
folke
parents: 1572
diff changeset
667 vo_osd_text=vo_osd_text_save;
2766b0d3863d osd problem with YV12 fixed
folke
parents: 1572
diff changeset
668 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
669 #endif
1511
f29e0c2bb675 Added cool aalib vo driver.
atmos4
parents:
diff changeset
670 }
1537
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
671
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
672 int
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
673 getcolor(char * s){
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
674 int i;
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
675 char * rest;
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
676 if (s==NULL) return -1;
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
677 i=strtol(s, &rest, 10);
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
678 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
679 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
680 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
681 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
682 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
683 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
684 else return -1;
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
685 }
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
686
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
687 int
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
688 vo_aa_parseoption(struct config * conf, char *opt, char *param){
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
689 /* 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
690 char *pseudoargv[4];
1537
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
691 int pseudoargc;
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
692 char * x, *help;
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
693 int i;
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
694 /* do WE need it ? */
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
695 if (!strcasecmp(opt, "aaosdcolor")){
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
696 if (param==NULL) return ERR_MISSING_PARAM;
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
697 if ((i=getcolor(param))==-1) return ERR_OUT_OF_RANGE;
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
698 aaopt_osdcolor=i;
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
699 return 1;
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
700 }else if (!strcasecmp(opt, "aasubcolor")){
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
701 if ((i=getcolor(param))==-1) return ERR_OUT_OF_RANGE;
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
702 aaopt_subcolor=i;
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
703 return 1;
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
704 }else if (!strcasecmp(opt, "aahelp")){
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
705 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
706 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
707 x=strtok(help,"-");
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
708 printf(x);
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
709 while ((x=strtok(NULL, "-"))){
1537
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
710 if (*(x-2)==' ') printf("-aa");
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
711 else printf("-");
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
712 printf("%s", x);
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
713 }
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
714 printf(
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
715 "\n"
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
716 "\n"
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
717 "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
718 " -aaosdcolor set osd color\n"
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
719 " -aasubcolor set subtitle color\n"
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
720 " the color params are:\n"
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
721 " 0 : normal\n"
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
722 " 1 : dark\n"
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
723 " 2 : bold\n"
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
724 " 3 : boldfont\n"
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
725 " 4 : reverse\n"
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
726 " 6 : special\n"
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
727 "\n\n"
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
728 " dT8 8Tb\n"
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
729 " dT 8 8 Tb\n"
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
730 " dT 8 8 Tb\n"
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
731 " <PROJECT><PROJECT>\n"
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
732 " dT 8 8 Tb\n"
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
733 " dT 8 8 Tb\n"
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
734 "\n"
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
735
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
736 );
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
737 exit(0);
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
738
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
739 }else{
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
740 /* parse param to aalib */
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
741 pseudoargv[1]=malloc(strlen(opt));
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
742 pseudoargv[3]=NULL;
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
743 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
744 if (param!=NULL){
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
745 pseudoargv[2]=param;
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
746 pseudoargc=3;
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
747 }else{
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
748 pseudoargv[2]=NULL;
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
749 pseudoargc=2;
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
750 }
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
751 fprintf(stderr,"VO: [aa] ");
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
752 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
753 if (i!=1){
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
754 return ERR_MISSING_PARAM;
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
755 }
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
756 if (pseudoargv[1]!=NULL){
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
757 /* 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
758 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
759 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
760 }
1551
267816fbdab3 vo_aa: +subtitles, +progressbar, key violation with mplayer keys fixed, +consoleblanking disabled, +/dev/vcsa checking
folke
parents: 1538
diff changeset
761 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
762 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
763
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
764 }
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
765 return ERR_NOT_AN_OPTION;
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
766
7bdf6a585b67 All aalib options can be passed to aalib (-aaXXX), also -aahelp is new
folke
parents: 1527
diff changeset
767 }
4258
31ed0b5d8126 Added reverting support for -aa* options
albeu
parents: 4094
diff changeset
768
31ed0b5d8126 Added reverting support for -aa* options
albeu
parents: 4094
diff changeset
769 void
31ed0b5d8126 Added reverting support for -aa* options
albeu
parents: 4094
diff changeset
770 vo_aa_revertoption(config_t* opt,char* param) {
31ed0b5d8126 Added reverting support for -aa* options
albeu
parents: 4094
diff changeset
771 if (!strcasecmp(opt, "aaosdcolor"))
31ed0b5d8126 Added reverting support for -aa* options
albeu
parents: 4094
diff changeset
772 aaopt_osdcolor= AA_SPECIAL;
31ed0b5d8126 Added reverting support for -aa* options
albeu
parents: 4094
diff changeset
773 else if (!strcasecmp(opt, "aasubcolor"))
31ed0b5d8126 Added reverting support for -aa* options
albeu
parents: 4094
diff changeset
774 aaopt_subcolor= AA_SPECIAL;
31ed0b5d8126 Added reverting support for -aa* options
albeu
parents: 4094
diff changeset
775 }
31ed0b5d8126 Added reverting support for -aa* options
albeu
parents: 4094
diff changeset
776
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4258
diff changeset
777 static uint32_t preinit(const char *arg)
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4258
diff changeset
778 {
4737
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4674
diff changeset
779 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
780 {
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4674
diff changeset
781 printf("vo_aa: Unknown subdevice: %s\n",arg);
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4674
diff changeset
782 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
783 }
32e1f5042f65 I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents: 4674
diff changeset
784 return 0;
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4258
diff changeset
785 }
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4258
diff changeset
786
4596
c35d7ce151b3 10000hl to Holm... control MUST BE static...
arpi
parents: 4592
diff changeset
787 static uint32_t control(uint32_t request, void *data, ...)
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4258
diff changeset
788 {
4592
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4433
diff changeset
789 switch (request) {
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4433
diff changeset
790 case VOCTRL_QUERY_FORMAT:
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4433
diff changeset
791 return query_format(*((uint32_t*)data));
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4433
diff changeset
792 }
5fbfd8545c3b query_ stuff replaced by new control() - patch by David Holm
arpi
parents: 4433
diff changeset
793 return VO_NOTIMPL;
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4258
diff changeset
794 }