summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfolke <folke@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-08-14 19:00:00 +0000
committerfolke <folke@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-08-14 19:00:00 +0000
commitdca17b4044b1bb0a2bcf1e162165b52c5a5f304b (patch)
tree20b5c02ab9b03751d26c11b3eea97d222df0ff91
parentfe55d26666ef0b0e5756b87613c9ac9afb994ccf (diff)
downloadmpv-dca17b4044b1bb0a2bcf1e162165b52c5a5f304b.tar.bz2
mpv-dca17b4044b1bb0a2bcf1e162165b52c5a5f304b.tar.xz
vo_aa: configurable now
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1519 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--cfg-mplayer.h17
-rw-r--r--libvo/vo_aa.c42
2 files changed, 49 insertions, 10 deletions
diff --git a/cfg-mplayer.h b/cfg-mplayer.h
index b277989081..9e99852a1c 100644
--- a/cfg-mplayer.h
+++ b/cfg-mplayer.h
@@ -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},
diff --git a/libvo/vo_aa.c b/libvo/vo_aa.c
index ed9c0092c7..f3be9b7c52 100644
--- a/libvo/vo_aa.c
+++ b/libvo/vo_aa.c
@@ -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