| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
I don't like this function at all, but it's basically a trick to get the
input's mp_log instance in a case the mp_input_parse_cmd_strv() is
almost certainly not going to output anything. But still make it
somewhat more consistent with mp_input_parse_cmd_strv() - why force the
caller to always use MP_ON_OSD_AUTO?
|
|
|
|
|
|
| |
Both X11 and Wayland support the same format for drag & drop operations
(text/uri-list), and the code for that was copied from x11_common.c to
wayland_common.c. Factor it out.
|
|
|
|
|
| |
event.c will be used to feed the input queue with 'global' events that don't
mesh well with the usual check_events path in mpv.
|
|
|
|
| |
To get rid of mp_append_utf8_buffer().
|
|
|
|
|
|
|
|
|
|
|
| |
This code is shared between input.conf parser and option parser. Until
now, the performance didn't really matter. But I want to use this code
for JSON parsing too, and since JSON will have to be parsed a lot, it
should probably try to avoid realloc'ing too much.
This commit moves parsing of C-style escaped strings into a common
function, and allows using it in a way realloc can be completely
avoided, if the already allocated buffer is large enough.
|
|
|
|
|
|
| |
stream_read_complete() fails if the file is larger than the requested
maximum size. But input.c didn't check for this case, and no indication
that something went wrong was printed.
|
| |
|
|
|
|
| |
Rearrange the code in an attempt to make its organization more logical.
|
|
|
|
| |
This is mostly just moving code around.
|
|
|
|
| |
Same for companion functions.
|
|
|
|
| |
Also get rid of MSGL_HINT and the many MSGL_DBG* levels.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's a single mp_msg() in path.c, but all path lookup functions seem
to depend on it, so we get a rat-tail of stuff we have to change. This
is probably a good thing though, because we can have the path lookup
functions also access options, so we could allow overriding the default
config path, or ignore the MPV_HOME environment variable, and such
things.
Also take the chance to consistently add talloc_ctx parameters to the
path lookup functions.
Also, this change causes a big mess on configfiles.c. It's the same
issue: everything suddenly needs a (different) context argument. Make it
less wild by providing a mp_load_auto_profiles() function, which
isolates most of it to configfiles.c.
|
|
|
|
| |
We also drop some slave mode stuff from stream_vcd.
|
|
|
|
|
|
|
|
| |
Always pass around mp_log contexts in the option parser code. This of
course affects all users of this API as well.
In stream.c, pass a mp_null_log, because we can't do it properly yet.
This will be fixed later.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Until now, there were two functions to add input sources (stuff like
stdin input, slave mode, lirc, joystick). Unify them to a single
function (mp_input_add_fd()), and make sure the associated callbacks
always have a context parameter.
Change the lirc and joystick code such that they take store their state
in a context struct (probably worthless), and use the new mp_msg
replacements (the point of this refactoring).
Additionally, get rid of the ugly USE_FD0_CMD_SELECT etc. ifdeffery in
the terminal handling code.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
So you can pass a command as list of strings (each item is an argument),
instead of having to worry about escaping and such.
These functions also take an argument for the default command flags. In
particular, this allows setting saner defaults for commands sent by
program code.
Expose this to Lua as mp.send_commandv command (suggestions for a better
name welcome). The Lua version doesn't allow setting the default command
flags, but it can still use command prefixes. The default flags are
different from input.conf, and disable OSD and property expansion.
|
|
|
|
|
| |
"getch2" really tells nothing about what the heck this code does. It'd
be even worse when moving the rest of terminal handling code there.
|
|
|
|
|
|
|
| |
Remove these because I'm too lazy to convert them to proper
STREAM_CTRLs. Considering that probably nobody uses radio://, caring
about this is a complete waste of time. I will add these commands back
if someone asks for them, but I don't expect this to happen.
|
| |
|
|
|
|
|
|
|
|
|
| |
Since m_option.h and options.h are extremely often included, a lot of
files have to be changed.
Moving path.c/h to options/ is a bit questionable, but since this is
mainly about access to config files (which are also handled in
options/), it's probably ok.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Tis drops the silly lib prefixes, and attempts to organize the tree in
a more logical way. Make the top-level directory less cluttered as
well.
Renames the following directories:
libaf -> audio/filter
libao2 -> audio/out
libvo -> video/out
libmpdemux -> demux
Split libmpcodecs:
vf* -> video/filter
vd*, dec_video.* -> video/decode
mp_image*, img_format*, ... -> video/
ad*, dec_audio.* -> audio/decode
libaf/format.* is moved to audio/ - this is similar to how mp_image.*
is located in video/.
Move most top-level .c/.h files to core. (talloc.c/.h is left on top-
level, because it's external.) Park some of the more annoying files
in compat/. Some of these are relicts from the time mplayer used
ffmpeg internals.
sub/ is not split, because it's too much of a mess (subtitle code is
mixed with OSD display and rendering).
Maybe the organization of core is not ideal: it mixes playback core
(like mplayer.c) and utility helpers (like bstr.c/h). Should the need
arise, the playback core will be moved somewhere else, while core
contains all helper and common code.
|
|\
| |
| |
| |
| | |
Conflicts:
DOCS/man/en/options.rst
|
| |
| |
| |
| |
| |
| |
| | |
"screenshot" now maps to "screenshot subtitles" by default, instead of
"screenshot video". Swap the argument order: the more useful argument
should come first. Remove the compatibility aliases for numeric choices
(e.g. "screenshot 1 0" won't work anymore).
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds a new screenshot mode "subtitles", which basically takes the
video frame as decoded, and renders subtitles into it.
This may fail for some pixel formats, because libswscale sucks. If this
becomes ever a real problem, the code could be changed to convert the
image to RGBA first (or whatever the image writer wants), and then
render the subtitles into it. This would avoid the additional image
copy needed with vo_xv too. But for now, it seems better to go with the
current method in the common case: vo_opengl creates an image copy
anyway, and drawing bitmaps to yv12 is better, as no color space
conversion is involved in draw_bmp.c's up/downsampling conversion.
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
| |
Fix off-by-one error in range check.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35302 b3059339-0415-0410-9bf9-f77b7e298cf2
Conflicts:
input/input.c
This code is already quite different from mplayer-svn, but still the
same bug.
|
|
|
|
|
| |
mp_input_feed_key() didn't free the command, if it was discarded due
to the queue exceeding its maximum size.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
In input test mode, key bindings won't be executed, but are shown on the
OSD. The OSD includes various information, such as the name of the key,
the command itself, whether it's builtin, and the config file location
it was defined.
The input test mode can be enabled with "--input=test". No effort is
spent trying to react to key bindings that normally exit the player;
they are treated just like any other binding.
|
|
|
|
|
|
| |
If parsing a command fails, its location is printed. The location is
the path to the input.conf, and the line number of the key binding and
the associated input command.
|
|
|
|
|
|
|
|
|
| |
Always recognize input commands for optional features (like TV commands
etc.). If these features are disabled, the commands are parsed, but
simply do nothing.
This fixes annoying warnings on start with the default/builtin
input.conf, if certain optional features are not compiled.
|
|\
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
DOCS/man/en/vo.rst
etc/input.conf
input/input.c
m_property.c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Allow the values "up" and "down" as step argument for the cycle input
command. Previously, this argument was a float, which specified an
arbitrary step value and direction (similar to the add command).
Instead of "1" and "-1", "up" and "down" is to be used.
Float values are still accepted. That capability might be removed in the
future, as there's probably hardly any actual use for arbitrary step
values.
|
| |
| |
| |
| |
| | |
In theory, this could take over the role of the get_property slave
command, and is more general.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
This disables warning messages when the legacy input command bridge is
used. For now, user input.confs should just keep working as if nothing
has changed. The deprecation warnings will be enabled again at a later
point, and the legacy bridge will be eventually removed.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The "no-osd" prefix was introduced earlier to disable OSD selectively
based on the key binding. Extend this, and allow the user to force
display of an OSD bar ("osd-bar"), OSD message ("osd-msg") or both
("osd-msg-bar"). This changes mainly how property setting functions
behave.
The default behavior is still the same.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Allow using the choice type (as it used for command line) for arguments
of input commands. Change the magic integer arguments of some commands
(like seek) to use choices instead. The old numeric values are still
allowed (but only those which made sense before, not arbitrary
integers).
In order to do this, remove the input.c specific types (like
MP_CMD_ARG_INT) completely and specify commands using the m_option
types.
Also, add the special choice "-" to some arguments. It's supposed to
signify the default value, so arguments can be easily skipped. Maybe the
choice option should recognize this and not change the previous value,
but we'll leave this for later.
For now, leave compatibility integer values for all new choice
arguments, e.g. "0" maps to 0. We could let the choice option type do
this automatically, but we don't, because we want user input values and
internal mplayer values decoupled in general. The compatibility options
will be removed one day, too.
Also, remove optional args for strings - would require either annoying
additional code, or copying strings twice. It's not used, so remove it.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If a command is not found, warn about it at loading time (just like
other command parsing errors are printed at loading time).
Add an explicit "ignore" command. input.conf instructs users to use this
command to cancel out existing mapping. This clashed with the
warning added in this commit. Make "ignore" a real command and remove
the specialcasing for it from get_cmd_from_keys(). Now "ignore" is
ignored because it's not handled in command.c.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, both the command parser and property expansion
(m_properties_expand_string) handled escapes with '\'. Move all escape
handling into the command parser, and remove it from the property code.
This removes the need to escape strings twice for commands that use
property expansion.
The command parser is practically rewritten: it uses m_option for the
actual parsing, and reduces hackish C-string handling.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When input.conf is loaded, verify each command and print a warning if
it's invalid or uses legacy commands. This is done for both the user's
and the embedded config files.
The diff is a bit noisy, because mp_input_parse_cmd() is changed to take
a bstr as argument instead of a char*.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Now it depends on the command whether a property wraps around, or stops
at min/max valid property value.
For practically all properties, it's quite unambiguous what the "switch"
command should have done, and there's technically no need to replace it
with these new commands. More over, most properties that cycle are
boolean anyway. But it seems more orthogonal to make the difference
explicit, rather than hardcoding it. Having different commands also
makes it more explicit to the user what these commands do, both just due
to the naming, and what wrapping policy is used. The code is simpler
too.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Move the code for "switch_ratio" to the M_PROPERTY_SET case of the
"aspect" property. The rules are exactly the same, e.g. setting a ratio
smaller than 0.1 sets the pixel aspect ratio to 1:1. For now, we define
that writing "0" sets the PAR to 1:1, and disallow -1 (possibly reserve
it to reset to default aspect ratio).
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Replace --hardframedrop with --framedrop=hard. Rename the framedrop
property from "framedropping" to "framedrop" for the sake of making
command line options have the same name as their corresponding
property. Change the property to accept choice values instead of
numeric values.
Remove unused/forgotten auto_quality variable.
|
| |
| |
| |
| |
| | |
This could change the direction (i.e. invoke STEP_PROPERTY_DOWN), but
you can just pass a negative value as second argument instead.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
osd_show_[property_]text => show_text
osd_show_progression => show_progress
show_text, osd_show_property_text and osd_show_text both map to the
code for the previous osd_show_property_text. The only special thing
about osd_show_text is that you don't need to escape "$". Also,
unfortunately osd_show_property_text requires escaping things twice,
one time for the command parser, and the other time for the property
formatting code, while osd_show_text needed only one level of escaping.
|
| |
| |
| |
| | |
Redundant with set/switch commands.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Use "-" instead of "_" in property names. The intent is that property
names and options names should be the same (if they refer to the same
thing), and options use "-" as word separator.
Rename some other properties too, e.g. "switch_audio" -> "audio".
Add a way to translate the old property names to the new ones, similar
to the input command legacy bridge.
Update input.conf. Use the new property names, and don't use legacy
commands.
|
| |
| |
| |
| | |
The implementation for this command was removed in 2002.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| < |