vo_aa: configurable now

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1519 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
folke 2001-08-14 19:00:00 +00:00
parent fe55d26666
commit dca17b4044
2 changed files with 49 additions and 10 deletions

View File

@ -49,6 +49,13 @@ extern int ao_pcm_waveheader;
extern char *mDisplayName;
#endif
#ifdef HAVE_AA
extern int aaopt_osdcolor;
extern int aaopt_extended;
extern int aaopt_eight;
extern char aaopt_driver;
#endif
struct config conf[]={
/* name, pointer, type, flags, min, max */
{"include", cfg_include, CONF_TYPE_FUNC_PARAM, 0, 0, 0}, /* this must be the first!!! */
@ -194,7 +201,15 @@ struct config conf[]={
#ifdef HAVE_LIRC
{"lircconf", &lirc_configfile, CONF_TYPE_STRING, 0, 0, 0},
#endif
#ifdef HAVE_AA
{"aaosdfont", &aaopt_osdcolor, CONF_TYPE_INT, CONF_RANGE, 0, 5 },
{"aaextended", &aaopt_extended, CONF_TYPE_FLAG, 0, 0, 1 },
{"aaeight", &aaopt_eight, CONF_TYPE_FLAG, 0, 0, 1 },
{"aadriver", &aaopt_driver, CONF_TYPE_STRING, 0, 0, 0 },
#endif
{"noidx", &index_mode, CONF_TYPE_FLAG, 0, -1, 0},
{"idx", &index_mode, CONF_TYPE_FLAG, 0, -1, 1},
{"forceidx", &index_mode, CONF_TYPE_FLAG, 0, -1, 2},

View File

@ -75,10 +75,18 @@ static int *sty;
double accum;
/* our version of the playmodes :) */
static char * osdmodes[] ={ ">", "\"", "#", "-" , "+" };
static char * osdmodes[] ={ "|>", "||", ">>", "[]" , ">>" };
extern void mplayer_put_key(int code);
/* to disable stdout outputs when curses/linux mode */
extern int quiet;
/* config options */
int aaopt_extended = 0;
int aaopt_eight = 0;
int aaopt_osdcolor = AA_SPECIAL;
char *aaopt_driver = NULL;
void
resize(void){
@ -199,8 +207,15 @@ init(uint32_t width, uint32_t height, uint32_t d_width,
aa_recommendhidisplay("curses");
aa_recommendhidisplay("X11");
aa_recommendlowdisplay("linux");
/* options ? */
if (aaopt_eight) aa_defparams.supported|=AA_EIGHT;
if (aaopt_extended && !aaopt_eight) aa_defparams.supported|=AA_EXTENDED;
if (aaopt_driver!=NULL){
aa_recommendhidisplay(aaopt_driver);
}
c = aa_autoinit(&aa_defparams);
aa_resizehandler(c, (void *)resize);
@ -223,8 +238,10 @@ init(uint32_t width, uint32_t height, uint32_t d_width,
aa_hidecursor(c);
p = aa_getrenderparams();
if ((strstr(c->driver->name,"curses")) || (strstr(c->driver->name,"libux")))
if ((strstr(c->driver->name,"curses")) || (strstr(c->driver->name,"linux"))){
freopen("/dev/null", "w", stderr);
quiet=1; /* disable mplayer outputs */
}
image_height = height;
image_width = width;
@ -246,7 +263,12 @@ init(uint32_t width, uint32_t height, uint32_t d_width,
printf(
"\n"
"\tAA-MPlayer Keys:\n"
"Options\n"
"\t-aaosdfont 0=normal, 1=dark, 2=bold, 3-boldfont, 4=reverse, 5=special\n"
"\t-aaextended use use all 256 characters\n"
"\t-aaeight use eight bit ascii\n"
"\n"
"AA-MPlayer Keys:\n"
"\t1 : fast rendering\n"
"\t2 : dithering\n"
"\t3 : invert image\n"
@ -329,10 +351,10 @@ printosd()
*/
if (vo_osd_text){
if (vo_osd_text[0]-1<=5)
aa_puts(c, 0,0, AA_BOLDFONT, osdmodes[vo_osd_text[0]-1]);
else aa_puts(c, 0,0, AA_BOLDFONT, "?");
aa_puts(c,1,0, AA_BOLDFONT, vo_osd_text+1);
aa_puts(c,strlen(vo_osd_text),0, AA_BOLDFONT, " ");
aa_puts(c, 0,0, aaopt_osdcolor, osdmodes[vo_osd_text[0]-1]);
else aa_puts(c, 0,0, aaopt_osdcolor, "?");
aa_puts(c,2,0, aaopt_osdcolor, vo_osd_text+1);
aa_puts(c,strlen(vo_osd_text)+1,0, aaopt_osdcolor, " ");
}
}
@ -505,8 +527,10 @@ uninit(void) {
free(stx);
free(sty);
if (convertbuf!=NULL) free(convertbuf);
if (strstr(c->driver->name,"curses") || strstr(c->driver->name,"libux"))
if (strstr(c->driver->name,"curses") || strstr(c->driver->name,"libux")){
freopen("/dev/tty", "w", stderr);
quiet=0; /* enable mplayer outputs */
}
}
static void