annotate libvo/vo_aa.c @ 4969:db86fcf25ede

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