summaryrefslogtreecommitdiffstats
path: root/core
Commit message (Collapse)AuthorAgeFilesLines
* 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 set mp_vo_opts.fullscreen to the actual state. Note that the X11 backend does almost none of this, and it has a private fs flag to store the fullscreen flag, instead of getting it from the WM. (Possibly because it has to deal with broken WMs.) The fullscreen option has to be checked on config() to deal with the -fs option, especially with something like: mpv --fs file1.mkv --{ --no-fs file2.mkv --} (It should start in fullscreen mode, but go to windowed mode when playing file2.mkv.) Wayland changes by: Alexander Preisinger <alexander.preisinger@gmail.com> Cocoa changes by: Stefano Pigozzi <stefano.pigozzi@gmail.com>
* video: redo how colorspaces are handledwm42013-07-162-66/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of handling colorspaces with VFCTRLs/VOCTRLs, make them part of the normal video format negotiation. The colorspace is passed down like other video params with config/reconfig calls. Forcing colorspaces (via the --colormatrix options and properties) is handled differently too: if it's changed, completely reinit the video chain. This is slower and requires a precise seek to the same position to perform an update, but it's simpler and less bug-prone. Considering switching the colorspace at runtime by user-interaction is a rather obscure feature, this is a good change. The colorspace VFCTRLs and VOCTRLs are still kept. The VOs rely on it, and would have to be changed to get rid of them. We'll do that later, and convert them incrementally instead of in one go. Note that controlling the output range now always works on VO level. Basically, this means you can't get vf_scale to output full-range YUV for whatever reason. If that is really wanted, it should be a vf_scale option. the previous behavior didn't make too much sense anyway. This commit fixes a few bugs (such as playing RGB video and converting that to YUV with vf_scale - a recent commit broke this and forced the VO to display YUV as RGB if possible), and might introduce some new ones.
* core: move video refresh function to mplayer.cwm42013-07-163-5/+13
|
* mp_common: add MPMAX/MPMIN macroswm42013-07-151-0/+3
| | | | | | | | | | | From now on, usage of these macros is encouraged over using FFMAX and FFMIN. FFMAX and FFMIN are perfectly fine, and the added macros are actually exactly the same as the FFMAX and FFMIN definitions. But they require including libavutil headers, and certain differences between Libav and FFmpeg very often introduced breakages if these macros were somehow not defined because a header was not recursively included. Defining this macro on our own is the best way to escape from this annoying issue.
* Fix build on Libavwm42013-07-151-0/+1
| | | | Sigh, why does this happen all the time...
* sd_ass: scale blur by original video size if requestedwm42013-07-152-0/+3
|
* sd_add: add terrible hack for (xy-)vsfilter compatibilitywm42013-07-153-0/+10
| | | | | | Much has been said about this topic, we don't need to say even more. See additions to options.rst.
* demux_lavf: add terrible hack to make DVD playback just workwm42013-07-141-0/+1
| | | | | | | | | | | | | | | | | | DVD playback had some trouble with PTS resets: libavformat's genpts feature would try reading until EOF (worst case) to find a new usable PTS in case a packet's PTS is not set correctly. Especially with slow DVD access, this would make the player to appear frozen. Reimplement it partially in demux_lavf.c, and use that code in the DVD case. This is heavily "inspired" by the code in av_read_frame from libavformat/utils.c. The difference is that we stop reading if no PTS has been found after 50 packets (consider this a heuristic). Also, we don't bother with the PTS wrapping and last-frame-before-EOF handling. Even with normal PTS wraps, the player frontend will go to hell for the duration of a frame anyway, and should recover quickly after that. The terribleness of this commit is mostly that we duplicate libavformat functionality, and that we suddenly need a packet queue.
* Merge branch 'remove_old_demuxers'wm42013-07-1412-300/+201
|\ | | | | | | | | | | | | | | The merged branch doesn't actually just remove old demuxers, but also includes a branch of cleanups and some refactoring. Conflicts: stream/stream.c
| * mplayer: remove generic duration calculationwm42013-07-121-11/+1
| | | | | | | | | | | | | | | | | | | | | | This was useless for anything but the raw demuxers. In most cases, this would most likely lead to display of bogus duration values, because the bitrates used are per-track, not the total file bitrate. There was actually no case left where this code was helpful. Note that demux_lavf has its own code for this using the total file bitrate. Also, mplayer.c can calculate the playback percentage from current file position / current file size. This is not removed.
| * demux: assume correct-pts mode by defaultwm42013-07-121-3/+3
| | | | | | | | | | | | | | | | All demuxers make a reasonable effort to set packet timestamps, and thus support correct-pts mode. This commit also implicitly switches demux_rawvideo to correct-pts mode. We still allow demuxers to disable correct-pts mode in theory.
| * Cleanup some include statementswm42013-07-121-1/+0
| |
| * demux: rewrite probing and demuxer initializationwm42013-07-124-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Get rid of the strange and messy reliance on DEMUXER_TYPE_ constants. Instead of having two open functions for the demuxer callbacks (which somehow are both optional, but you can also decide to implement both...), just have one function. This function takes a parameter that tells the demuxer how strictly it should check for the file headers. This is a nice simplification and allows more flexibility. Remove the file extension code. This literally did nothing (anymore). Change demux_lavf so that we check our other builtin demuxers first before libavformat tries to guess by file extension.
| * mplayer: minor memory leak in error handling codewm42013-07-121-0/+1
| |
| * core: change open_stream and demux_open signaturewm42013-07-128-60/+17
| | | | | | | | | | | | | | | | | | | | | | This removes the dependency on DEMUXER_TYPE_* and the file_format parameter from the stream open functions. Remove some of the playlist handling code. It looks like this was needed only for loading linked mov files with demux_mov (which was removed long ago). Delete a minor bit of dead network-related code from stream.c as well.
| * core: completely change handling of attached picture pseudo videowm42013-07-112-16/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, we tried to play along with libavformat and tried to pretend that attached pictures are vide