summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* sub: never decode subs to old OSD formatwm42012-10-1612-185/+191
| | | | | | | | | | | | | | | | | | | | | | | | | Instead, sd_lavc.c and spudec.c (the two image sub decoders) always output indexed/paletted images. For this purpose, add SUBBITMAP_INDEXED, and convert the subs to RGBA in img_convert.c instead. If a VO is used that supports the old OSD format only, the indexed bitmaps are converted to the old OSD format by abusing spudec.c in a similar way sd_lavc.c used to do. The main reason why spudec.c is used is because the images must not only be converted to the old format, but also properly scaled, cropped, and aligned (the asm code in libvo/osd.c requires this alignment). Remove support for the old format (packed variant) from the OpenGL VOs. (The packed formats were how the actual OSD format was handled in some GPU-driven VOs for a while.) Remove all conversions from old to new formats. Now all subtitle decoders and OSD renderers produce the new formats only. Add an evil hack to convert the new format (scaled+indexed bitmaps) to the old format. It creates a new spudec instance to convert images to grayscale and to scale them. This is temporary for VOs which don't support new OSD formats yet (vo_xv, vo_x11, vo_lavc).
* sub: cosmetics: move things aroundwm42012-10-1612-72/+76
| | | | | | | | | | | | | | | | | | Move sub-bitmap definitions from dec_sub.h to sub.h. While it's a bit odd that OSD data structures are in a file named sub.h, it's definitely way too strange to have them in a file about subtitle decoding. (Maybe sub.h/.c and the sub/ directory should be split out and renamed "osd" at a later point.) Remove including ass_mp.h (and the libass headers) where possible. Remove typedefs for mp_eosd_res and sub_bitmaps structs. Store a mp_eosd_res struct in osd_state instead of just w/h. Note that sbtitles might be rendered using different sizes/margins when filters are involved (the subtitle renderer is not supposed to use the OSD res directly, and the "dim" member removed in the previous commit is something different).
* sub: cleanup: don't pass parameters via global variableswm42012-10-167-42/+38
| | | | | | | | | | | Passing parameters from caller to subtitle renderer was done by temporarily setting certain members in the osd_state struct (which for all practical purposes are as good as global variables). This was the only purpose of these members. Rather than using such a messy way to pass parameter, put these into a struct sub_render_params. The struct was already introduced in earlier commits, and this commit just removes the parameter passing hack.
* sub: always go through sub.c for OSD renderingwm42012-10-167-56/+124
| | | | | | | | | | | | | | | | | | | | | | | Before this commit, vf_vo.c and vf_ass.c were manually calling the subtitle decoder to retrieve images to render. In particular, this circumvented the sub-bitmap conversion & caching layer in sub.c. Change this so that subtitle decoding isn't special anymore, and draws all subtitles with the normal OSD drawing API. This is also a step towards removing the need for vf_ass auto-insertion. In fact, if auto-insertion would be disabled now, VOs with "old" OSD rendering could still render ASS subtitles in monochrome, because there is still ASS -> old-OSD bitmap conversion in the sub.c mechanism. The code is written with the assumption that the subtitle rendering filter (vf_ass) can render all subtitle formats. Since vf_ass knows the ASS format only, rendering image subs (i.e. RGBA subs) with it simply fails. This means that with vo_xv (vf_ass auto-inserted), image subs wouldn't be rendered. Use a dumb hack to disable rendering subs with a filter, if we detect that the subs are not in ASS format. (Trying to render the subs first would probably result in purging the conversion cache on every frame.)
* sub, VO: remove vo_osd_resized() functionwm42012-10-168-18/+5
| | | | | | | | | | | VOs which could render the OSD in window size (as opposed to video size, like vo_xv) and which could cache the OSD called this when the window size changed. This was needed, because VOs used another OSD function to check whether the OSD changed before passing the new window size to the OSD code. This was really just an artifact of OSD change detection, and now that the affected VOs use the new OSD rendering API, it's done automatically.
* libvo: remove eosd_packer.cwm42012-10-163-330/+0
| | | | | | | | This contains about the same code as bitmap_packer.c. eosd_packer.c was added first, and then not merged for a year - then it was added as bitmap_packer.c with slightly different and incompatible interface. Now replacing eosd_packer.c with bitmap_packer.c is finally done. So much wasted work...
* vo_direct3d: use new OSD APIwm42012-10-161-287/+145
|
* vo_corevideo: add EOSDwm42012-10-161-101/+22
| | | | Completely untested.
* vo_gl: use gl_osd.cwm42012-10-163-295/+27
| | | | | | | | Side effect: no direct support for old OSD format anymore. Instead, sub.c converts sub-images in that format to the packed, alpha-inverted version. osd-color suboption is broken.
* vo_gl3: move OSD code to gl_osd.cwm42012-10-167-201/+449
| | | | | | | Other OpenGL-using VOs can use this. gl_osd.c includes some code for vo_gl.c. The next commit actually makes use of it.
* sub: remove logic for disabling hinting on scaled EOSDwm42012-10-1611-17/+8
| | | | | | | | | | | This was an extremely obscure setting, as it was used only with vo_gl if its scaled-osd suboption was used. If you really want this, you can set the desired ass-hinting value directly, and there will be literally no loss in functionality. Note that this didn't actually test whether the EOSD was scaled. Basically, it only checked whether vo_gl had the scaled-osd suboption set.
* vo_gl, options: remove doublebuffering option (--double)wm42012-10-166-31/+11
| | | | | | | | | | Useless. It complicated the code and caused flicker, and was useless otherwise. The manpage describes this option as "should not normally be used". One possibly useful effect from the point of view of the user was that vsync was disabled. You can do this with the --vsync option, or by changing X/driver settings directly.
* sub: make it easier to set DVD sub decoding with sd_lavcwm42012-10-163-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this commit, the player will still use spudec.c (the "old" DVD sub decoder), rather than ffmpeg. But it brings the changes needed to enable this down to a single line change: --- a/mplayer.c +++ b/mplayer.c @@ -1988,7 +1988,7 @@ static void reinit_subs(struct MPContext *mpctx) #endif vo_osd_changed(OSDTYPE_SUBTITLE); } else if (track->stream) { - if (mpctx->sh_sub->type == 'v') + if (mpctx->sh_sub->type == 'v' && false) init_vo_spudec(mpctx); else sub_init(mpctx->sh_sub, mpctx->osd); Also, copy the DVD resolution heuristics from spudec.c (from the spudec_new_scaled() function). I'm not sure if this is correct or even needed, but the sd_lavc codd explicitly reverted back to spudec with code carrying this comment: // Assume resolution heuristics only work for PGS and DVB so it seems likely that the required heuristics were missing, and that the spudec heuristics may make the DVD compatibility situation at least as good as with spudec. Note that it's unlikely that we enable sd_lavc for DVD subs by default, as there are other problems in combination with direct DVD playback.
* osd_libass: set RTL base direction to neutralwm42012-10-161-3/+6
| | | | | | | | | | | | | | | | We are using libass for OSD rendering. One problem with that is that libass has to be bug-compatible to VSFilter. This includes the setting for the default RTL base direction. Neutral would be most reasonable, but VSFilter assumes LTR. This commit forces the default to neutral. Unconfirmed whether this actually works as intended. See the following libass commits: 9dbd12d shaper: allow font encoding -1 for neutral base direction a80c45c shaper: always use LTR base direction by default
* sub, vo_gl3, vo_vdpau: exit early if there are no sub-images to drawwm42012-10-162-2/+2
| | | | | | | | | | | | libass may always return a full change if no subtitle images are rendered in some cases (empty tracks). Also, a full change despite empty sub-images list may be reported on initialization. Avoid invoking odd special cases in the VO code by always exiting early if the sub-image list is empty. Note that at least for OSD, the code in sub.c doesn't even send a request VOCTRL_DRAW_EOSD if the image list is empty. But the subtitle rendering code in vf_vo.c is independent from this (at least for now).
* sub: cleanup: remove vo_osd_probar_type/value global variableswm42012-10-165-18/+15
|
* sub: cosmetics: turn some defines into enumswm42012-10-162-28/+34
|
* mplayer: reset subtitles handled by dec_sub.c on seekwm42012-10-161-0/+2
| | | | This was somehow lost when merging this.
* vo_vdpau: use new EOSD for OSD, remove support for old OSD formatwm42012-10-161-180/+13
| | | | | | | | | | | | | | | | | | This allows vo_vdpau to render OSD directly, without the indirection through the old OSD API, and without the additional conversions. Remove support for the old OSD format. Only the mplayer DVD subtitle decoder still generates this format. Although the new OSD interface does support this format, remove it from vo_vdpau. It would be relatively hard to support it in the EOSD code, as it requires two surfaces. (These two surfaces are blended on top of each other to emulate the mplayer OSD format.) The correct way to implement direct support for DVD subs would consist of adding a paletted image format of some sort. But even sd_lavc converts paletted subtitle images to RGBA, so doing something special just for DVD subs is not worth it. This means the frontend (sub.c) converts the subtitles to RGBA if it detects that vo_vdpau does not support them natively.
* vo_vdpau: allow multiple EOSD rendererswm42012-10-161-34/+45
| | | | Preparation for using new OSD rendering method.
* sub: allow converting DVD subs to RGBAwm42012-10-164-6/+53
| | | | | | | | | | | | | | The mplayer DVD sub decoder is the only remaining OSD image producer that still requires the old mplayer OSD format (SUBBITMAP_OLD_PLANAR). To make supporting this format optional in VOs, add a step that allows converting these images to RGBA in case the VO doesn't have direct support for it. Note: the mplayer DVD sub decoder uses the old mplayer OSD format (SUBBITMAP_OLD_PLANAR), which is assumed to use premultiplied alpha. However, it seems DVDs allow only binary transparency, so the rendered result will be the same.
* sub: allow rendering OSD in ASS image format directly, simplifywm42012-10-1615-523/+600
| | | | | | | | | | | | | | | | | | | | | Before this commit, the OSD was drawn using libass, but the resulting bitmaps were converted to the internal mplayer OSD format. We want to get rid of the old OSD format, because it's monochrome, and can't even be rendered directly using modern video output methods (like with OpenGL/Direct3D/VDPAU). Change it so that VOs can get the ASS images directly, without additional conversions. (This also has the consequence that the OSD can render colors now.) Currently, this is vo_gl3 only. The other VOs still use the old method. Also, the old OSD format is still used for all VOs with DVD subtitles (spudec). Rewrite sub.c. Remove all the awkward flags and bounding boxes and change detection things. It turns out that much of that isn't needed. Move code related to converting subtitle images to img_convert.c. (It has to be noted that all of these conversions were already done before in some places, and that the new code actually makes less use of them.)
* vo_gl3: use old OSD using the emulation layerwm42012-10-161-97/+1
| | | | | This still renders the OSD using essentially the same mechanisms, except that the EOSD code for texture handling and rendering is reused.
* sub: add preliminary emulation layer to draw OSD with EOSDwm42012-10-162-0/+82
| | | | | | | | | This basically pushes the old OSD bitmaps via VOCTRL_DRAW_EOSD to the VO, instead of using the old callback-based interface. Future commits will change the code such that sub.c pushes images rendered by libass directly, rather than converting them to the old OSD format first.
* vo_gl3: support RGBA EOSDwm42012-10-165-99/+251
| | | | | This also adds support for multiple EOSD renderers. This capability is unused yet, but important for the following commits.
* sub: create sub_bitmap array even when using libasswm42012-10-1612-111/+130
| | | | | | | | | | | | | | One sub_bitmaps struct could contain either a libass ASS_Image list, or a mplayer native list of sub-bitmaps. This caused code duplication in vo_vdpau.c and bitmap_packer.c. Avoid this by creating such a sub_bitmap array even with libass. This basically copies the list and recreates it in mplayer's native format. It gets rid of the code duplication, and will make implementing extended subtitle and OSD rendering in other VOs easier. Also do some cosmetic changes and other preparations for the following commits.
* encoding examples: refuse upscaling when the target is an iPhoneRudolf Polzer2012-09-241-7/+7
| | | | | | This is ok, because the iPhone can handle any resolution. So there is no need to waste space on upscaling the iPhone can do at playback time as well.
* vf_scale: do the upscale detection AFTER calculating dimensionsRudolf Polzer2012-09-241-7/+8
| | | | | | Otherwise it heavily violates the manpage's description, and describing what it did before in the documentation is something too complicated to describe in the English language.
* mp_msg: make MSGL_STATUS use the same color as MSGL_INFOwm42012-09-231-1/+1
| | | | The green status line is annoying.
* demuxer: fix crash with demux_rawvideowm42012-09-231-2/+6
| | | | | | | | | | | | | | | rawvideo is a rather primitive demuxer that doesn't implement track switching. The problem was that during track switching the demuxer implementations normally set the stream IDs in order to do the switch, and since rawvideo obviously didn't do that, so the current stream in ds->sh / demuxer->video->sh was set to NULL. (The frontend always assumes track switching is successful, which is a reasonable assumption - failing due to missing video codecs etc. is in separate codepaths.) Later, demux_rawvideo_fill_buffer() in demux_rawvideo.c tried to dereference the NULL stream and crashed. Other trivial single-stream demuxers worked fine, because they didn't try to access ds->sh.
* options: handle alias options differentlywm42012-09-232-10/+9
| | | | | | | | | | | When setting an alias option, its value is not saved in the file-local options case. The ensure_backup function in m_config.c exits if it encounters an aliased option, because it should not be saved additionally to the original option. However, the original option is likely never saved in this case. Change it so that ensure_backup always accesses the original option. The original option is the one that first appears in the option list.
* options: simplify somewhat by introducing a union for option valueswm42012-09-233-20/+30
| | | | | | | | 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-09-235-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: fix parsing bugwm42012-09-231-1/+1
| | | | | When tabs are used as whitespace between command and the first string parameter, the string is not correctly terminated.
* ao_pulse: extend maximum settable volume beyond 100%wm42012-09-231-7/+8
| | | | | | The old maximum is 100%. Raise it to PA_VOLUME_UI_MAX, which is about 150%. PA_VOLUME_UI_MAX is the PulseAudio recommended UI-settable maximum volume, so it seems to be a good idea to use that.
* softvol, ao_pulse: prefer ao_pulse volume control by defaultwm42012-09-237-7/+35
| | | | | | | | | | | | | | | | | | --softvol is enabled by default. For most audio outputs, this is a good thing, as they have either their own (bad) soft volume implementation, or control the system mixer. With ao_pulse, the situation is a bit different: it supports per-application volume (i.e. volume control is not really global). More importantly, ao_pulse uses a rather large audio buffer, and changing the volume with mplayer's volume filter has a large delay. With the native ao_pulse volume control, it's instant, because PulseAudio's audio filtering happens at a later stage in its processing pipeline (inaccessible for mplayer). This means native volume control should really be allowed for ao_pulse, while it's the reverse for other audio outputs. Make --softvol a choice option, and add a new "auto" choice. This is default and will use PA's volume control with ao_pulse, and mplayer's volume filter otherwise (i.e. the old softvol behavior).
* configure: make --enable-openal use auto detectionwm42012-09-231-1/+1
| | | | | | | | | | | OpenAL is disabled by default, because it supposedly inteferes with some other configure tests and makes them fail silently. Previously, --enable-openal followed configure's utterly braindead semantics and disabled auto detection. However, since OpenAL was disabled by default, there was no easy way to enable OpenAL at all, even if it was explicitly requested. Solve this by making --enable-openal use auto detection.
* options: make cache option always per-filewm42012-09-233-6/+12
| | | | | | | | | | | When playing a network stream, the cache is automatically enabled. We don't want the cache to stay enabled when playback ends. (For example, the next file to be played could be a local file, and even if that is relatively contrieved, we want to do the right thing.) Introduced the flag M_OPT_LOCAL to force an option to be always file local. This allows enabling the old mplayer semantics on a per option basis.
* mplayer: fix abort command handlingwm42012-09-231-14/+10
| | | | | | | | | | Now it actually aborts, even if the abort command is not the first command. Make a policy change: commands before the abort command are silently thrown away. Previously, normal commands were run after the abort command finished (so they were run out of order). I'm not sure which way is the best, all things considered, but the new way is simpler.
* getch2: request at least 1 byte of input each readRudolf Polzer2012-09-191-1/+1
| | | | | | | | fixes issue with | less, where mplayer broke less's terminal expectations and made less quit Note this means that read() will be blocking again. Should be ok, as we always check via select() before reading.
* mp_msg: use stdout for all output except status; put status on stderrRudolf Polzer2012-09-191-2/+2
| | | | improves interaction with | less, | grep, ...
* mp_msg: enable --msgcolor by default; force it off if stdout is no ttyRudolf Polzer2012-09-191-7/+14
|
* 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