summaryrefslogtreecommitdiffstats
path: root/core
Commit message (Collapse)AuthorAgeFilesLines
* core: move contents to mpvcore (1/2)Stefano Pigozzi2013-08-0667-25203/+0
| | | | | | | | | | core is used in many unix systems for core dumps. For that reason some tools work under the assumption that the file is indeed a core dump (for example autoconf does this). This commit just renames the files. The following one will change all the includes to fix compilation. This is done this way because git has a easier time tracing file changes if there is a pure rename commit.
* mp_msg: fix typo in commentwm42013-08-051-1/+1
|
* stream_radio: fix some thingswm42013-08-052-3/+3
| | | | | | | | | Using the radio set/step channel commands would have crashed (that was broken for about a year, nobody ever noticed). The "capture" part of a radio:// URI was incorrectly passed (this was broken quite recently). Still couldn't test it fully. I have no radio device. I suspect nobody uses this feature or will ever use it again.
* core: change speed option/property to doublewm42013-08-055-15/+16
| | | | | | | | | | | | | The --speed option and the speed property used float. Change them to double. Change the commands that manipulate the property (speed_mult/add) to double as well. Since the cycle command shares code with the add command, we change that as well. The reason for this change is that this allows better control over speed, such as stepping by semitones. Using floats is also just plain unnecessary.
* demux_lavf: make avio buffer configurablewm42013-08-041-0/+1
| | | | | | Perhaps not very useful, but reserved for situations when a user reports awful latency and experimentation/debugging might be required to find out why or to fix it (happens often).
* option: fix inverted --mouseinput optionwm42013-08-031-1/+1
| | | | Also fixes --no-mouseinput.
* command: make vf and af commands more verbosewm42013-08-031-2/+20
| | | | | | On success, print the filter chain on the OSD. Otherwise, show an error message on the OSD (just enough so that the user knows whether the command worked).
* command: add vf/af propertieswm42013-08-032-1/+61
|
* command: split filter changing in two functionswm42013-08-031-39/+49
| | | | | One function sets a raw filter list, the other allows "editing" the filter list.
* options: don't make options set during playback file local (e.g. --vf)wm42013-08-027-81/+67
| | | | | | | | | | | | | | | | Refactor file local options handling: instead of making all options implicitly file local between loading a file and terminating playback, explicitly make options file local which are required to be file local. Or in other words, introduce a M_SETOPT_BACKUP flag, which forces file local-ness when setting an option, and use this for file local command line options, per-file config files, and per-protocol/extension/vo/ao profiles. In particular, this changes the "vf" input command such that video filters stay permanent even when going to the next file in the playlist. The underlying reason for this is that the "vf" command uses the option setting command. This influences the "af" command as well.
* m_option.c: fix typo in messagewm42013-08-021-1/+1
|
* m_config: minor simplificationwm42013-08-021-11/+10
| | | | | The optstruct parameter in the m_config_parse_option functions was not needed.
* Remove m_structwm42013-08-025-207/+0
| | | | Not needed anymore.
* stream: redo URL parsing, replace m_struct usage with m_configwm42013-08-022-229/+0
| | | | | | | | | | | | | Move the URL parsing code from m_option.c to stream.c, and simplify it dramatically. This code originates from times when http code used this, but now it's just relict from other stream implementations reusing this code. Remove the unused bits and simplify the rest. stream_vcd is insane, and the priv struct is different on every platform, so drop the URL parsing. This means you can't specify a track anymore, only the device. (Does anyone use stream_vcd? Not like this couldn't be fixed, but it doesn't seem worth the effort, especially because it'd require potentially touching platform specific code.)
* mplayer: add more verbose exit codesAndre D2013-08-023-17/+61
|
* audio/out: add support for new logging APIStefano Pigozzi2013-08-011-2/+3
|
* video/out: use new mp_msg stuff for vo.c and vo_openglwm42013-07-311-1/+1
| | | | The first step; also serves as example.
* mp_msg: introduce new log functions and macroswm42013-07-315-66/+255
| | | | | | | | | | | | | | | | | | | | | | | This has two goals: 1. Getting rid of global variables to make the core library-safe. 2. Getting rid of all the MSGT_* constants and the inconsistent prefixes spread throughout the source code. Both goals are not immediately reached with this commit. It's a huge transition that will take time. There are over >2500 mp_msg calls in the source, which all have to be replaced for this to work. The inconsistent prefixes are in particular annoying. Lots of code manually prefixes messages, e.g. mp_msg(MSGT_VO, MSGL_V, "[vo] ..."). Sometimes the prefixes don't even follow this convention (for example vo_direct3d.c uses "<vo_direct3d>" as prefix). This commit allows automatically adding prefixes on request, so consistency will hopefully improve. For now, this commit adds unused stuff, and behavior should not change. In mplayer.c, move the GetCpuCaps() call, because that used mp_msg() before mp_msg_init() was run.
* options: handle presets directly in m_configwm42013-07-315-32/+46
| | | | | This means that "mpv -vo opengl-hq:help" will actually show the correct defaults, instead those of plain vo_opengl.
* m_option: fix skipping of missing -vo/-ao entrieswm42013-07-311-3/+9
| | | | | | | | | The -vo/-ao options support skipping of unknown entries for the sake of allowing using the same config on possibly very different systems, which have different sets of VO/AOs available. Unfortunately skipping didn't quite work, possibly a rebase error when this was originally committed. Fix it.
* m_config: remove alias informationwm42013-07-312-24/+12
| | | | | | | | | | | | We don't need to store anymore whether an option is aliased by another option (which is what the alias_owner member did). Also, that member had a really bad name. This also removes some unneeded code from config_destroy(). Calling m_option_free() is always ok; this just skipped the call if it did nothing. In particular, it's ok to call m_option_free() on the same pointer multiple times. (Maybe that function is misnamed, and it should be m_option_clear().)
* m_config: store file local backup options differentlywm42013-07-312-16/+31
| | | | | | | | | | | File local options need to backup the global option value while a file is played. Instead of keeping a pointer in m_config_option for the backup value, put it into a separate list. This reduces per-option overhead for a rarely used obscure feature. (This implementation would have been a bit dumb in pre-mpv m_config, because there local options were the default, and _all_ options were backed up when starting playback of a file. This is not the case anymore, and normally only a very small number of options are backed up by default.)
* m_config: make m_profile struct non-publicwm42013-07-312-13/+11
|
* command: silence a warningwm42013-07-291-0/+2
| | | | | This is unreachable code, but the compiler doesn't always determine this. This change shuts up the warning in these cases.
* vdpau: split off decoder parts, use "new" libavcodec vdpau hwaccel APIwm42013-07-281-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the decoder parts from vo_vdpau.c to a new file vdpau_old.c. This file is named so because because it's written against the "old" libavcodec vdpau pseudo-decoder (e.g. "h264_vdpau"). Add support for the "new" libavcodec vdpau support. This was recently added and replaces the "old" vdpau parts. (In fact, Libav is about to deprecate and remove the "old" API without deprecation grace period, so we have to support it now. Moreover, there will probably be no Libav release which supports both, so the transition is even less smooth than we could hope, and we have to support both the old and new API.) Whether the old or new API is used is checked by a configure test: if the new API is found, it is used, otherwise the old API is assumed. Some details might be handled differently. Especially display preemption is a bit problematic with the "new" libavcodec vdpau support: it wants to keep a pointer to a specific vdpau API function (which can be driver specific, because preemption might switch drivers). Also, surface IDs are now directly stored in AVFrames (and mp_images), so they can't be forced to VDP_INVALID_HANDLE on preemption. (This changes even with older libavcodec versions, because mp_image always uses the newer representation to make vo_vdpau.c simpler.) Decoder initialization in the new code tries to deal with codec profiles, while the old code always uses the highest profile per codec. Surface allocation changes. Since the decoder won't call config() in vo_vdpau.c on video size change anymore, we allow allocating surfaces of arbitrary size instead of locking it to what the VO was configured. The non-hwdec code also has slightly different allocation behavior now. Enabling the old vdpau special decoders via e.g. --vd=lavc:h264_vdpau doesn't work anymore (a warning suggesting the --hwdec option is printed instead).
* m_config: try to print min/max values as integers in --list-optionswm42013-07-281-2/+2
| | | | | This switched to exponential representation too soon, and large integer values looked bad in the --list-options output.
* m_config: hide no-* opts in --list-options, simplify positional suboptswm42013-07-282-19/+23
| | | | | | | All these --no-... options in --list-options made the output rather unreadable, so hide them. Make the code for finding positional parameters (which are supposed to skip these no-* options) slightly simpler too.
* options: print default values in --list-optionswm42013-07-281-0/+24
| | | | | | | | | | Do this by recreating the m_config from scratch, which then must contain the default values. This doesn't quite work with legacy options using global variables: the default values get lost, so using --list-options will print the value as set by the config file. This also introduces a memory leak for string options backed by global variables. All of these issues will be eventually fixed by moving all options to structs.
* m_config: refactor some thingswm42013-07-287-146/+121
| | | | | | | | | | | | | | Change how m_config is initialized. Make it more uniform; now all m_config structs are intialized in exactly the same way. Make sure there's only a single m_option[] array defining the options, and keep around the pointer to the optstruct default value, and the optstruct size as well. This will allow reconstructing the option default values in the following commit. In particular, stop pretending that the handling of some special options (like --profile, --v, and some others) is in any way elegant, and make them explicit hacks. This is really more readable and easier to understand than what was before, and simplifies the code.
* core: make mpctx->opts a pointerwm42013-07-287-131/+132
| | | | | | | | Prevents some awkwardness in a later commit, and makes the code more uniform with other places where MPOpts is accessed. This is a pretty annoying commit (touches tons of lines all over the place), but it hurts only once.
* command: mark special options as unavailablewm42013-07-281-0/+2
| | | | | Special options (like -v, -playlist, etc.) don't have data associated with them, so reading them with the "options" property makes no sense.
* options: simplify --correct-pts handlingwm42013-07-263-11/+2
| | | | | | Remove the (now unused) code for determining correct-pts mode based on the demuxer in use. Change its description in the manpage to reflect what this option does now.
* command: allow printing time properties with millisecondswm42013-07-261-9/+35
| | | | | | | | | | | | | | Doing e.g. show_text "${time-pos/full}" will show the time formatted with a milliseconds part. This is actually special cased for a few properties which use CONF_TYPE_TIME, instead of making all properties using CONF_TYPE_TIME respect this. This is a technical limitation. I'm not entirely happy with this approach, so I'll leave it undocumented. It's relatively ok, but he fact that it's special-cased to some properties is not elegant. So for now, this is just a hack to make ChrisK2 happy (hi there).
* command: add pseudo-property that allows you to read global optionswm42013-07-261-0/+27
| | | | | | | | | | | | The "options" pseudo-property allows reading global like this: show_text ${options/name} Where "name" maps to the option "--name". This allows retrieving option values that are not properties. Write-access is not possible: this is reserved for normal properties. Note: it is possible that we'll change this again, and don't require the "options/" prefix to access options.
* m_property: fix non-sense codewm42013-07-261-1/+2
| | | | Undefined behavior.
* getch2, mplayer: Always call load_termcapDiogo Franco (Kovensky)2013-07-251-2/+0
| | | | | getch2 now deals with the cases where we don't have termcap. Add a dummy load_termcap to getch2-win so we don't get linking errors on mingw.
* mp_msg: Support colors on cygwinDiogo Franco (Kovensky)2013-07-241-1/+1
| | | | | A cygwin mpv will usually run inside mintty, and even if it were to be run in a regular console window, the cygwin dll emulates ANSI escapes.
* m_config: don't override profile option if not requiredwm42013-07-242-1/+4
| | | | | | | The --profile top-level option is handled specially in m_config.c. But this code also broke sub-options that happened to be named "profile" (e.g. when trying to use "-af-add=bs2b=profile=cmoy"). Handle it specially only if it's the top-level --profile option.
* input: fix dangling pointer issues with multi-part commandswm42013-07-241-5/+8
| | | | | | | This didn't setup the linked list of sub-commands for multi-part commands ("a ; b ; c") correctly. Also, the new commands were attached to the allocation of the _old_ command instead of the new one. (Wow, whatever the hell I was (not) thinking when I wrote this code.)
* mplayer: remove dead codewm42013-07-241-2/+0
| | | | | Attached pictures are now handled specially and on a separate codepath, so this hack is not needed anymore. Remove it from the normal codepath.
* Fix some -Wshadow warningswm42013-07-234-26/+26
| | | | | | In general, this warning can hint to actual bugs. We don't enable it yet, because it would conflict with some unmerged code, and we should check with clang too (this commit was done by testing with gcc).
* options: make legacy hacks for AFs/VFs more explicitwm42013-07-222-1/+3
| | | | | This means that AOs/VOs with no options set do not take the legacy option parsing path, but instead report that they have no options.
* Remove subopt-helperwm42013-07-222-402/+0
| | | | Finally not used by anything anymore. Farewell.
* mplayer: cosmetics: move functionwm42013-07-221-32/+25
| | | | Also get rid of the useless comment.
* av_log: restore handling of prefixes and line breakswm42013-07-221-2/+7
| | | | | | | Commit 9a83d03 accidentally removed this. (Overlooked "static"?) The handling of this rather sucks. Maybe a better solution will be possible once we clean up the mp_msg code.
* core: make --demuxer not affect external subtitleswm42013-07-221-1/+1
| | | | | | This also affects --audiofile. The previous behavior wasn't really useful. There are even separate switches for that: --audio-demuxer and --sub-demuxer.
* audio/filter: use new option APIwm42013-07-227-103/+101
| | | | | | | | | | | | | Make the VF/VO/AO option parser available to audio filters. No audio filter uses this yet, but it's still a quite intrusive change. In particular, the commands for manipulating filters at runtime completely change. We delete the old code, and use the same infrastructure as for video filters. (This forces complete reinitialization of the filter chain, which hopefully isn't a problem for any use cases. The old code forced reinitialization too, but it could potentially allow a filter to cache things; e.g. consider loaded ladspa plugins and such.)
* options: move --colorkey option to vo_xvwm42013-07-222-6/+0
|
* options: remove --mixer and --mixer-channel, turn them into alsa/oss suboptswm42013-07-212-4/+0
| | | | | | These two options were supported by ALSA and OSS only. Further, their values were specific to the respective audio systems, so it doesn't make sense to keep them as top-level options.
* options: hide encoding AO/VO in help outputwm42013-07-212-2/+6
| | | | | These can't be used manually. Encoding is enabled with -o instead, and the encoding AO/VO is selected using internal mechanisms.
* options: use new option code for --aowm42013-07-213-15/+7
| | | | This requires completely refactoring the AO creation code too.
* mplayer: simplify AO creationwm42013-07-211-13/+22
| | | | | | The AO creation part was split into two separate parts (one calling ao_create and one calling ao_init). This didn't really have good reasons, and obfuscates how AO creation works. Put them together.
* options: use new code for parsing --vowm42013-07-213-8/+7
| | | | | | | | | Nothing should change from user perspective. mpv --vo=opengl:help now works. Remove the vo_opengl inline help text. The new code can list option names for you, but that's it. Refer to the manpage if you have trouble.
* options: add some features to video filter parserwm42013-07-212-9/+80
| | | | | | | | | | | | | | | | | | This is in preparation of making VOs and AOs use the parser which originally was for video filters only. The --vo and --ao options have several very annoying features, which are added here: - They can skip unknown video outputs (might be useful if a config file is supposed to work on several systems, where not all VOs/AOs are available everywhere) - The trailing "," in "-vo a,b," was significant, and meant that if "a" and "b" don't work, try the normal autoprobe order as fallback - There were deprecated VO names (like "gl3" and "gl"), which have to be handled with the option parser - Separating VO/VF names and options is different ("-vf foo=opts" vs. "-vo foo:opts") - vo_opengl.c provides opengl-hq as opengl + preset options
* m_option: fix memory leak on error pathwm42013-07-211-2/+4
|
* m_config: improve option list output a bitwm42013-07-212-19/+27
| | | | | | | | This is printed with --list-options or e.g. --vf=lavfi=help. Note that in theory, the options should be able to print their own help, and we shouldn't special case certain types (like m_option_type_choice in the commit). But that is too hairy for now, so we don't do it.
* options: use m_config for options instead of m_structwm42013-07-216-97/+163
| | | | | | | | | | | | | | | | | | For some reason, both m_config and m_struct are somewhat similar, except that m_config is much more powerful. m_config is used for VOs and some other things, so to unify them. We plan to kick out m_struct and use m_config for everything. (Unfortunately, m_config is also a bit more bloated, so this commit isn't all that great, but it will allow to reduce the option parser mess somewhat.) This commit also switches all video filters to use the option macros. One reason is that m_struct and m_config, even though they both use m_option, store the offsets of the option fields differently (sigh...), meaning the options defined for either are incompatible. It's easier to switch everything in one go. This commit will allow using the -vf option parser for other things, like VOs and AOs.
* command: fix switching tracks backwards if there's only one trackwm42013-07-211-1/+2
| | | | This remained stuck at no selection.
* input: Ignore spurious mouse movesDiogo Franco (Kovensky)2013-07-211-0/+4
| | | | | | | | | | | | Windows generates WM_MOUSEMOVE messages internally whenever the window manager wants to know where the mouse is[1] and broadcasts that to everyone; w32_common doesn't check whether the position is different and just (indirectly) calls this. Do the check on input.c since it's possible some other VO or frontend also do the same thing. [1]: http://blogs.msdn.com/b/oldnewthing/archive/2003/10/01/55108.aspx
* mp_msg: fixes windows code that assumes sizeof(DWORD) == sizeof(long)Diogo Franco (Kovensky)2013-07-201-1/+1
|
* m_option: remove unused definitionswm42013-07-201-9/+0
|
* video: remove fullscreen flags chaoswm42013-07-183-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a MPOpts fullscreen field, a mp_vo_opts.fs field, and VOFLAG_FULLSCREEN. Remove all these and introduce a mp_vo_opts.fullscreen flag instead. When VOs receive VOCTRL_FULLSCREEN, they are supposed to set the current fullscreen mode to the state in mp_vo_opts.fullscreen. They also should do this implicitly on config(). VOs which are capable of doing so can update the mp_vo_opts.fullscreen if the actual fullscreen mode changes (e.g. if the user uses the window manager controls). If fullscreen mode switching fails, they can also