Commit Graph

15 Commits

Author SHA1 Message Date
Cloud11665 f3a2275c24 vo_tct: add resize capability
No performance penalty added by getting the terminal size every frame.
2021-08-26 11:29:07 -07:00
Avi Halachmi (:avih) 36de2efebd vo_tct: fix --vo-tct-256
This is a regression from cbbd81bb (the previous commit):

print_seq1 (which prints a sequence with 1 parametric byte value) is
used with 256 colors output, and apparently was never tested.
Two issues were introduced at the offending commit:

1. The ";5" part was incorrectly removed from the strings
   ESC_COLOR256_{BG,FG} (affects both *nix and Windows).

2. On windows only - a semicolon was not used after the prefix.

Both issues resulted in an invalid 256 colors sequences and output.
2021-08-16 11:06:43 +03:00
Cloud11665 cbbd81bb4f vo_tct: optimize print function on non-windows platforms
Using fwrite on non-windows platforms yields a ~25% performance increase.
2021-08-16 02:29:25 +03:00
Avi Halachmi (:avih) 2b5c2c8e44 vo_tct: fix half-block on windows
On windows the UTF-8 strings are translated to wchar_t when printed to
the console, and some escape sequences are also translated, however,
this only works when printf is mapped to mp_printf, and for that to
happen we need to include osdep/io.h .
2021-08-16 01:16:34 +03:00
Avi Halachmi (:avih) 824e569fb5 vo_tct: don't leak the frame reference
The reference is allocated at reconfig (and leaked at least once), but
could theoretically be called more than once by mpv, or in the future
when the tct code is enhanced to hande e.g. pan-and-scan changes.
2020-11-29 14:15:51 +02:00
Avi Halachmi (:avih) d4233021c7 vo_tct: remove unused variable 2020-11-29 14:15:51 +02:00
Avi Halachmi (:avih) b036e56e67 video/out/vo_tct: query terminal size generically
terminal_get_size also works on windows. This is useful because now
tct also works on Windows with native VT console.
2020-04-23 23:25:41 +03:00
wm4 26f4f18c06 options: change option macros and all option declarations
Change all OPT_* macros such that they don't define the entire m_option
initializer, and instead expand only to a part of it, which sets certain
fields. This requires changing almost every option declaration, because
they all use these macros. A declaration now always starts with

   {"name", ...

followed by designated initializers only (possibly wrapped in macros).
The OPT_* macros now initialize the .offset and .type fields only,
sometimes also .priv and others.

I think this change makes the option macros less tricky. The old code
had to stuff everything into macro arguments (and attempted to allow
setting arbitrary fields by letting the user pass designated
initializers in the vararg parts). Some of this was made messy due to
C99 and C11 not allowing 0-sized varargs with ',' removal. It's also
possible that this change is pointless, other than cosmetic preferences.

Not too happy about some things. For example, the OPT_CHOICE()
indentation I applied looks a bit ugly.

Much of this change was done with regex search&replace, but some places
required manual editing. In particular, code in "obscure" areas (which I
didn't include in compilation) might be broken now.

In wayland_common.c the author of some option declarations confused the
flags parameter with the default value (though the default value was
also properly set below). I fixed this with this change.
2020-03-18 19:52:01 +01:00
Michael Forney 235fabcfae video/out/vo_tct: Use octal escape sequence instead of non-standard \e 2019-11-18 16:50:21 +01:00
wm4 835586513d sws_utils: shuffle around some shit
Purpose uncertain. I guess it's slightly better, maybe.

The move of the sws/zimg options from VO opts (vo_opt_list) to the
top-level option list is tricky. VO opts have some helper code in vo.c,
that sends VOCTRL_SET_PANSCAN to the VO on every VO opts change. That's
because updating certain VO options used to be this way (and not just
the panscan option). This isn't needed anymore for sws/zimg options, so
explicitly move them away.
2019-10-31 15:26:03 +01:00
wm4 ca67928d7a sws_utils: don't force callers to provide option struct
mp_sws_set_from_cmdline() has the only purpose to respect the --sws-
command line options. Instead of forcing callers to get the option
struct containing these, let callers pass mpv_global, and get it from
the option core code directly. This avoids minor annoyances later on.
2018-01-18 00:59:07 -08:00
rr- 326920a9bf vo_tct: check ioctl result 2017-02-20 14:19:57 +01:00
Avi Halachmi (:avih) 363982c774 vo_tct: support also 256 colors output 2016-10-25 00:03:01 +11:00
Avi Halachmi (:avih) 02d2c2cc97 vo_tct: optional custom size, support non-posix with 80x25 default
Also, replace the UTF8 half block char at the source code with C escape.
2016-10-25 00:03:01 +11:00
rr- dd02369c32 vo_tct: introduce modern caca alternative 2016-10-20 14:59:54 +02:00