summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* options: simplify somewhat by introducing a union for option valueswm42012-10-123-34/+37
| | | | | | | | The m_option_value union is supposed to contain a field for each possible option type (as long as it actually stores data). This helps avoiding silly temporary memory alocations. Using a pointer to an union and to a field of the union interchangeably should be allowed by standard C.
* options: accept "yes" and "no" only for flagswm42012-10-125-33/+25
| | | | | | | | | | This removes the alternative values like "off", "0", "false" etc., and also the non-English versions of these. This is done for general consistency. It's better to have a single way of doing things when multiple ways don't add singificant value. Also update some choices for consistency.
* commands: generally handle property formatting with m_optionwm42012-10-125-76/+84
| | | | | | | | | | | | | Use the m_option code by default to format property values, instead of having separate code in m_property. To facilitate that, add a pretty_print callback to option types. These format values in a more human readable and user friendly way, as opposed to the print callback, which produces parseable values. This also changes the strings used with flags. Instead of "enabled" and "disabled", flags are formatted as "yes" and "no". (We could use the pretty_print callback to deal with this, but we don't for consistency.)
* commands: remove pointless NULL checkswm42012-10-122-127/+4
| | | | | | Most property implementations checked whether the "arg" parameter was NULL. This is entirely pointless, because NULL is actually never pased. It was inconsistently done, too. Remove the checks.
* commands: handle property stepping in a generic waywm42012-10-125-282/+189
| | | | | | | | | | | | | | | | | | | | | Instead of forcing each property implementation implement its own logic for M_PROPERTY_STEP_UP/M_PROPERTY_STEP_DOWN, handle it in the generic property code. Rename the M_PROPERTY_STEP_UP command to M_PROPERTY_SWITCH (the other property command, M_PROPERTY_STEP_DOWN, isn't needed anymore: stepping downwards is done by passing a negative argument). Always use double as argument type; it makes the code easier, and covers all property types. Move the code which does the actual type-specific value stepping to m_option.c (the idea is that m_option handles types). Some properties still have custom handlers implemented with M_PROPERTY_SWITCH. They can't be mapped to the generic mechanism, because their value range is dynamic or entirely unknown. For some properties, the default step stride is changed to 1. This is no issue, because the default bindings in input.conf all use an explicit stride in the affected cases.
* options: remove CONF_TYPE_POSITIONwm42012-10-125-47/+16
| | | | | | | | | This was the option parser for the off_t C type. These days, off_t is always int64_t, so replace all its uses by int64_t and CONF_TYPE_INT64. Fix the --sstep option. It used CONF_TYPE_INT with an off_t variable, which will result in invalid memory accesses. Make it use type double instead, which seems to make more sense for this option.
* commands: rename "osdlevel" option and property, make it a choicewm42012-10-127-36/+9
| | | | | | | | | Rename both the option and property to "osd-level", which fits a bit better with the general naming scheme. Make it a choice instead of an integer range. I failed to come up with good names for the various levels, so leave them as-is. Remove the useless property handler for the "loop" property too.
* commands: replace --hardframedrop, change framedropping propertywm42012-10-129-36/+22
| | | | | | | | | | 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.
* commands: remove third parameter for "switch"wm42012-10-122-5/+2
| | | | | This could change the direction (i.e. invoke STEP_PROPERTY_DOWN), but you can just pass a negative value as second argument instead.
* commands: rename osd_show_[property_]text and osd_show_progressionwm42012-10-124-19/+12
| | | | | | | | | | | | 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.
* commands: remove speed_set/speed_incr commandswm42012-10-124-20/+5
| | | | Redundant with set/switch commands.
* commands: rename properties, update input.confwm42012-10-125-169/+203
| | | | | | | | | | | | | | 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.
* commands: remove unimplemented "use_master" commandwm42012-10-122-2/+0
| | | | The implementation for this command was removed in 2002.
* commands: change input commands to make OSD usage explicitwm42012-10-125-60/+89
| | | | | | | | | | | | | | | | | | | | Most input commands had their own policy whether to display an OSD message for user feedback or not. Some commands had two variants, one that showed an OSD message and one that didn't (e.g. step_property_osd and step_property). Change it such that all commands show a message on the OSD. Add a "no-osd" modifier that disables OSD for that command. Rename the "step_property" and "step_property_osd" command to "switch", and rename "set_property" and "set_property_osd" to "set". Note that commands which haven't used OSD before still don't use OSD. That will possibly be fixed later. (E.g. "screenshot" could display an OSD message instead of just printing a message on the terminal.) The chapter and edition properties still produce OSD messages even with "no-osd", because they don't map so well to the property_osd_display[] mechanism.
* commands: minor cleanup for property_osd_display arraywm42012-10-122-41/+40
| | | | | | Make the definition more compact and less confusing by omitting rarely used fields. Avoid having to initialize osd_id with -1 in every entry by making 0 an unused OSD ID instead.
* commands: simplify legacy command-to-property bridgewm42012-10-123-188/+63
| | | | | | | | | | | | | | | | | | | | | There are many input commands which are redundant to properties. They were parsed like normal commands, but set_property_command() in command.c handled them automatically using the property mechanism. This still required having the command specifications around, and the code in command.c was quite messy. Replace this with a text based replacement mechanism. Some corner cases are not handled: commands of form "seek_chapter 3 1" are supposed to set the "chapter" property to 3. This use is probably rare, and doesn't show up in the default input.conf. The reason compatibility is kept is because breaking input.conf is quite annoying, so a minimal effort is made to avoid this. Currently we print an annoying warning every time a legacy command is used, though. Also add a compatibility entry for "pt_step", which was removed some time ago. Variations in whitespace are not handled, but it's good enough to deal with old input.conf entries.
* commands: remove legacy slave mode get commandswm42012-10-126-348/+1
| | | | | | | | These have been replaced by properties. Also remove some other slave- mode specific get commands that can be replaced by property uses. The get_metadata() function didn't actually contain anything useful, and just replicated code from other parts of mplayer.
* mplayer: unbreak OSD with CONFIG_ENCODING undefinedwm42012-09-182-12/+1
| | | | | | | | | | | | | | Basically, the encoding code path wanted to set osdlevel=0 as default, while normal playback needs osdlevel=1. For this purpose, osdlevel was set to -1 (i.e. invalid) initially to detect whether the --osdlevel option was explicitly set. When encoding was not configured (CONFIG_ENCODING undefined), the osdlevel value was not set from -1 to 1 properly, and the OSD remained invisible by default. Fix this by getting rid of this logic. It shouldn't be needed, since osdlevel=1 never shows any OSD messages without user interaction. Should this ever change, we could still check whether encoding is in progress, or add another option to allow OSD rendering during encoding.
* options: rename noconfig to no-config, nocache to no-cachewm42012-09-181-2/+2
| | | | This how it's supposed to be. The manpage has the correct names.
* cocoa_common: make fullscreen menubar/dock hiding conditionalStefano Pigozzi2012-09-181-1/+9
| | | | | | | | | | cocoa_common was hiding the dock and menubar unconditionally when going fullscreen. This means they were hidden even if they weren't on the screen mplayer2 was going fullscreen on, resulting in poor user experience. Change the fullscreen function in the cocoa backend to check that mplayer2 is on the same screen as the menubar/dock before hiding them.
* encode: video encoding now supported using mencoder-like optionsRudolf Polzer2012-09-1826-33/+3208
|
* TOOLS: add a new file identifier toolRudolf Polzer2012-09-181-0/+165
| | | | | It can provide properties of a file to the user on stdout, or when sourced by a script, put them into its variables.
* commands: allow printing raw propertieswm42012-09-181-4/+9
| | | | | | | | | | | | Extend m_properties_expand_string() so that it can print properties as unformatted string. Normally, properties will be pretty-printed (intended for OSD and user interface purposes). Add the '=' modifier to the format string syntax that disables pretty-printing and returns them "raw". For example, "${=switch_audio}" will print the track number, instead of returning an OSD friendly string containing additional information like track title and language.
* vf_rectangle: remove as it is very dirty and we have a replacement nowRudolf Polzer2012-09-1810-209/+0
|
* vf_dlopen: vf_rectangle filter moved to dlopen (unix only)Rudolf Polzer2012-09-182-1/+348
| | | | It is unix only, because vf_dlopen filters have no way to receive input (yet)
* vf_dlopen: improve performance for 1-frame-for-1-frame filtersRudolf Polzer2012-09-182-22/+59
| | | | | | This is done by requesting a buffer from the next filter in the chain, instead of always allocating our own. This allows the next filter to e.g. ensure its own preferred memory layout.
* mplayer: selectively reset track selection when playing multiple fileswm42012-09-182-0/+46
| | | | | | | | | | | | | | | | | | | | Normally, video/audio/sub track selection is persistent across files played in the same mplayer instance. This is wanted, because settings should not be reset across files in general. However, if the track layout of a file is completely different from the previous, this will essentially select random tracks. In this case, keeping the track selection is confusing and unwanted. Reset the track selection to default if the track layout changes. The track layout is determined by number of tracks, track order, default flag, whether the track is an external subtitle, and track language. If a track layout change is detected when playing a new file, the -sid, -aid and -vid options are reset to "auto". This behavior is enabled only if the user selects tracks manually (via keybinds and the "switch_audio" slave properties etc.). If no user interactions take place, options specified on the command line will follow the old behavior.
* ad_dvdpcm: add back PCM decoder for DVDwm42012-09-184-0/+171
| | | | | | This is needed by demux_mpg (and possibly by demux_ts) for PCM playback. The decoder does the mapping from MPEG headers to the actual PCM format, and also unpacks sample data for 20/24 bit formats.
* core, timeline: cache external ordered chapter files tooStefano Pigozzi2012-09-189-28/+77
| | | | | | | | | | | | | | | | | | | | | | | Previously, Matroska source files other than the initially opened one were always accessed without caching. Enable cache for extra files too. A separate cache process/thread is started for each file, which is less than optimal but probably better than no caching if the user explicitly enabled cache. This commit only implements caching for Matroska ordered chapters (not for EDL timeline). To build the timeline we need to demux the files in the current directory to look for segments with matching uuid. This first demux is done with no cache since we don't need to read a lot of the stream. If the file is recognized as one of the needed sources it's reopened with cache enabled. Also move the stream_cache_size global variable to the options struct. Conflicts: cfg-mplayer.h mplayer.c stream/stream.h timeline/tl_matroska.c
* subs, vo_vdpau: support RGBA color for PGS subtitlesUoti Urpala2012-09-1811-52/+273
| | | | | | | | | | | | | | | | | | | | | | Support passing bitmap subtitles to VOs in full RGBA color, and implement this for libavcodec-decoded subtitle formats on decoding side and vo_vdpau on display side. Currently this is enabled for PGS (blu-ray) and DVB subtitles. VDPAU seems to have sampling issues similar to known GL ones when drawing a sub-rectangle from a larger texture with scaling, where adjacent pixels outside the specified source rectangle affect the result. As the bitmap subtitles may be scaled, add padding support to the bitmap packer code. In principle, this could be used for colored DVD subtitles too. However, the libavcodec DVD decoder lacks parts of the resolution and palette handling that are present in spudec.c. Conflicts: libvo/vo_gl.c sub/dec_sub.h sub/sd_lavc.c
* libmpdemux: add back demux_tswm42012-09-185-1/+3574
| | | | | | | | | | | | | | | | | Someone wanted this. Apparently both libavformat's TS demuxer and demux_ts are crap, and work/fail in different cases. This demuxer has been removed in 1fde09db6f4ce. All code added comes from the revision before that. Some required bits have been added in the commit before this one (re-adding demux_mpg), in particular the changes to video.c. stream_dvb will use this demuxer by default, otherwise demux_lavf is preferred (as it has been before). Some TS related command line options are not re-added. Closed captions might not work.
* libmpdemux: add back demux_mpgwm42012-09-1811-7/+2795
| | | | | | | | | | | | | | | | | | | | | Apparently this was needed for good DVD playback. This demuxer has been removed in 1fde09db6f4ce. All code added comes from the revision before that. Some other bits have been removed in later commits, and are added back as well. Usage of memalign() is replaced by av_malloc(). As far as I can tell, this memory is never free'd or reallocated, so no calls to av_free() have been added. The code re-added to video.c is plain horrible, full of code duplication, full of demuxer/codecs specifics, but apparently needed. Unrelated to re-adding the demuxer, re-add one codepath for DEMUXER_TYPE_TV, which was accidentally removed in the same commit demux_mpg was removed. The closed captions decoder is not re-added.
* options: change --vid, --aid, --sid optionswm42012-09-183-24/+17
| | | | | | | | | | | | The --vid, --aid, --sid options now accept the values 'off' and 'auto', instead of having the user deal with the numeric values -2 and -1. The numeric values are not allowed anymore. Remove the --audio option. It was probably meant as compensation option for --no-audio. There are no such options for sub/video, and it was not documented, so just remove it. The replacement is "--aid=auto". Also do some updates to the manpage.
* options: change --loop option, and extend choice option typewm42012-09-186-26/+90
| | | | | | | | | | | | | | | | | | | | | | The --loop option takes slightly different parameters now. --loop=0 used to mean looping forever. Now it means looping is disabled (this is more logical: 2 means playing 2 more times, 1 means playing 1 more time, and 0 should mean playing not again). Now --loop=inf must be used to enable looping forever. Extend choice types to allow an optional range of integers as values. If CONF_RANGE is added to the flags of a m_option_type_choice option, m_option.min/max specify a range of allowed integer values. This can be used to remove "special" values from make integer range options. These special values are unintuitive, and sometimes expose mplayer internals to the user. The (internal) choice values can be freely mixed with the specified integer value range. If there are overlaps, the choice values are preferred for conversion to/from strings. Also make sure the extension to choice options works with properties. Add the ability to step choice properties downwards, instead of just upwards.
* options: remove M_OPT_IMPLICIT_DEFAULTwm42012-09-183-21/+8
| | | | | | | | | This was to make an option without value use the option's default value (e.g. --term-osd is the same as --term-osd=auto). Make it simpler by handling this case as an empty choice. The flag was probably needed when option handling still did ambiguous argument parsing.
* options: remove -subalignwm42012-09-186-45/+0
| | | | | | It can't be re-implemented, because this isn't supported by libass. The -subalign option and the associated sub-align slave property did nothing. Remove them.
* configure: add version check for libquviwm42012-09-181-1/+1
| | | | | I do not know what exactly is the minimum working version. Require the latest version currently released, which is about half a year old.
* options: fix "--"wm42012-09-181-0/+5
| | | | | | | Handling this was accidentally forgotten when command line parsing was refactored. The added recursive call should be a tail recursion with all reasonable compilers, and it shouldn't be possible to provoke a stack overflow.
* rawaudio: use mplayer audio format for format optionwm42012-09-186-22/+31
| | | | | | | | | | | | | | | The rawaudio demuxer had a rather hard to use way to set the audio format with the --rawaudio=format=value option. The user had to pass a numeric value, which then was set as wFormatTag member in the WAVEFORMATEX header. Make it use the mplayer audio format (the same as --af=format=value). Add a new internal pseudo audio codec tag, which is hopefully unused, which makes ad_pcm use the value in wFormatTag as internal mplayer audio format. Playing non-PCM formats is disabled. (At least AC3 can be played directly.)
* dec_audio: do not overwrite sh_audio->wf->wFormatTagwm42012-09-181-8/+2
| | | | | | | | | No decoder actually used this value (except ad_acm, which was removed a while ago), so this change shouldn't have any bad consequences. ad_ffmpeg passes wf to libavcodec decoders, but only the extra data portion. This change is needed by the next commit.
* ad_pcm: add back raw decoderwm42012-09-184-0/+247
| | | | | | | | | | | This was removed in commit 6a26b4a66504. Add it back, because it was needed by demuxer_rawaudio and for PCM audio with demuxers other than demux_lavf. (In practice, this broke rawaudio and PCM-in-Matroska only.) Unlike with raw video, there is no single raw audio "decoder" in libavcodec. Instead of trying to mess raw audio input into ad_ffmpeg using a table to map audio formats to the respective libavcodec decoders, it seems advantageous to simply add back ad_pcm.
* core: remove duplicated format_time() functionswm42012-09-186-53/+32
| | | | | This was an on-going transition to make mplayer format all times in the same format.
* build: move mpcommon.c to version.cwm42012-09-183-5/+23
| | | | | | | | | | | | | mpcommon.c used to be the only file to include version.h. version.h is generated by the build system, and contains the git revision. Any time a commit is made (or the tree is rebased etc.), the file is rewritten, and mpcommon.c rebuilt. To make rebuilding less annoying, the definition of the version string is the only thing in mpcommon.c. Since I want to add other things to mpcommon.c, add a new file named version.c, that takes over mpcommon.c's role as described above. mpcommon.c doesn't include version.h anymore, and will be used to park code that doesn't really belong anywhere else.
* bluray: add bd:// as stream prefixwm42012-09-182-4/+4
| | | | The existing short prefix, br://, was not very intuitive.
* manpage: remove references to bitmap fontswm42012-09-182-7/+1
| | | | Support for bitmap fonts was removed a while ago.
* demuxer: remove ImageDesc fieldwm42012-09-183-23/+0
| | | | | | | | | | | | | | | | | | This was needed by the now-removed mov demuxer for QuickTime video, or to be more specific, the Sorenson 3 video codec. QuickTime can (probably) still decoded by libavcodec, but this field is not needed for this. The reference in demux_mkv was apparently for decoding QuickTime in Matroska, using binary QuickTime codecs (QTX stuff). It's possible that this has been broken with the binary codecs removal (see commit aebfbbf2bdd), because it removed related code from demux_mkv. On the other hand, the code section in question was enabled only if binary win32 codecs were enabled. The win32 codec loader worked on 32 bit x86 only. This means QuickTime-in-Matroska was broken on all other architectures, including 64 bit x86. Despite being possibly broken on a major platform, nobody has complained about it yet, and since I couldn't find a sample of such a mkv file, so don't bother with it.
* demuxer: do not set sub_utf8 optionwm42012-09-182-5/+0
| | | | | | | | demux_lavf and demux_mkv, which both support demuxing subtitles, set the global variable sub_utf8. This variable is connected with the -utf8 option, and should not be reset by code. Since demuxer subtitles are not influenced by this option (anymore?), this is unnecessary. Remove the code setting this variable from the demuxers.
* Remove VESA/FBDEV remains, clean up example.confwm42012-09-184-149/+5
| | | | | | Remove VESA and FBDEV specific code that was forgotten when the respective VOs were removed. Remove references to old or broken stuff from example.conf.
* subs: restore support for sub_step command with libasswm42012-09-183-10/+28
| | | | | | This was destroyed by Uoti Urpala in commit "subs: always use sub...". Features should be either kept working or completely removed, but not just crippled, which only inflates the code and frustrates users.
* subs, vo: do sub bitmap change detection by comparing IDsUoti Urpala2012-09-188-32/+39
| | | | | | | | | | | | | | | | | vo_vdpau and vo_gl cache the last subtitle bitmaps uploaded to video card in case they stay the same over multiple frames. Detecting whether the bitmaps have changed and should be re-uploaded was somewhat fragile. Change the VO API to provide a bitmap ID which can be compared with what the VO has to determine whether a new upload of the bitmaps is needed. Conflicts: libvo/vo_gl.c Note: the changes for vo_gl.c were not merged. Instead, eosd_packer is modified to use the new way of detecting EOSD changes. This takes care of vo_gl, vo_gl3 and vo_direct3d, which all render EOSD. They don't need to be updated in turn.
* vo_vdpau: split bitmap packing code into a separate fileUoti Urpala2012-09-184-146/+484
| | | | | | | | | | | | | | | | | | Split the vo_vdpau code that calculates how to pack all subtitle bitmaps into a larger surface into a separate file. This will allow using it in other VOs. Co