summaryrefslogtreecommitdiffstats
path: root/libvo
Commit message (Collapse)AuthorAgeFilesLines
* mplayer: expand --title as property, remove --use-filename-titlewm42012-08-022-5/+4
| | | | | | | | | The --title option, which sets the GUI window caption, is now expanded as slave mode property string (like osd_show_property_text). Make the default value for --title include the filename. This makes a behavior similar to --use-filename-title the default. Remove the --use-filename-title option, as it's redundant now.
* osd: minor simplification of vo_osd_changed()wm42012-08-014-5/+5
| | | | | | | | | | | | | | | | | | vo_osd_changed() was a weird function: it was used both to query and mutate state, which is a bad combination. The VOs used it to query and reset the state, and the mplayer frontend mostly used it to set the state. In some cases, the frontend did both (that code used a variable "int hack" to backup the state and set it again). Simplify it and make the VOs use a vo_osd_has_changed() function to query whether the OSD bitmaps have to be recreated. vo_osd_changed() on the other hand is now used to update state only. The OSD change state is reset when osd_draw_text() is called. Update vo_corevideo.m to use vo_osd_resized() as well (forgotten change from libass-OSD merge). Simplify osd_set_text() and its usages.
* Remove dead codewm42012-08-016-46/+0
| | | | | | | | | | | | | This was done with the help of callcatcher [1]. Only functions which are statically known to be unused are removed. Some unused functions are not removed yet, because they might be needed in the near future (such as open_output_stream for the encode branch). There is one user visible change: the --subcc option did nothing, and is removed with this commit. [1] http://www.skynet.ie/~caolan/Packages/callcatcher.html
* vo_corevideo: remove font_load codeStefano Pigozzi2012-08-011-2/+0
| | | | | This was probably forgotten in the commit that removed the dependency on freetype.
* vo_gl3: support changing cmdlinewm42012-08-011-2/+82
|
* VO: add mechanisms to change VO commandline for VOs supporting itwm42012-08-011-0/+2
|
* Change <endian.h> include to <sys/types.h>wm42012-07-312-2/+2
| | | | | This seems to be more portable. Should fix compilation on OSX and FreeBSD. Apparently also works on MinGW-w64.
* mplayer: turn playtree into a list, and change per-file option handlingwm42012-07-311-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: - There is no playtree anymore. It's reduced to a simple list. - Options are now always global. You can still have per-file options, but these are optional and require special syntax. - The slave command pt_step has been removed, and playlist_next and playlist_prev added. (See etc/input.conf changes.) This is a user visible incompatible change, and will break slave-mode applications. - The pt_clear slave command is renamed to playlist_clear. - Playtree entries could have multiple files. This is not the case anymore, and playlist entries have always exactly one entry. Whenever something adds more than one file (like ASX playlists or dvd:// or dvdnav:// on the command line), all files are added as separate playlist entries. Note that some of the changes are quite deep and violent. Expect regressions. The playlist parsing code in particular is of low quality. I didn't try to improve it, and merely spent to least effort necessary to keep it somehow working. (Especially ASX playlist handling.) The playtree code was complicated and bloated. It was also barely used. Most users don't even know that mplayer manages the playlist as tree, or how to use it. The most obscure features was probably specifying a tree on command line (with '{' and '}' to create/close tree nodes). It filled the player code with complexity and confused users with weird slave commands like pt_up. Replace the playtree with a simple flat playlist. Playlist parsers that actually return trees are changed to append all files to the playlist pre-order. It used to be the responsibility of the playtree code to change per-file config options. Now this is done by the player core, and the playlist code is free of such details. Options are not per-file by default anymore. This was a very obscure and complicated feature that confused even experienced users. Consider the following command line: mplayer file1.mkv file2.mkv --no-audio file3.mkv This will disable the audio for file2.mkv only, because options are per-file by default. To make the option affect all files, you're supposed to put it before the first file. This is bad, because normally you don't need per-file options. They are very rarely needed, and the only reasonable use cases I can imagine are use of the encode backend (mplayer encode branch), or for debugging. The normal use case is made harder, and the feature is perceived as bug. Even worse, correct usage is hard to explain for users. Make all options global by default. The position of an option isn't significant anymore (except for options that compensate each other, consider --shuffle --no-shuffle). One other important change is that no options are reset anymore if a new file is started. If you change settings with slave mode commands, they will not be changed by playing a new file. (Exceptions include settings that are too file specific, like audio/subtitle stream selection.) There is still some need for per-file options. Debugging and encoding are use cases that profit from per-file options. Per-file profiles (as well as per-protocol and per-VO/AO options) need the implementation related mechanisms to backup and restore options when the playback file changes. Simplify the save-slot stuff, which is possible because there is no hierarchical play tree anymore. Now there's a simple backup field. Add a way to specify per-file options on command line. Example: mplayer f1.mkv -o0 --{ -o1 f2.mkv -o2 f3.mkv --} f4.mkv -o3 will have the following options per file set: f1.mkv, f4.mkv: -o0 -o3 f2.mkv, f3.mkv: -o0 -o3 -o1 -o2 The options --{ and --} start and end per-file options. All files inside the { } will be affected by the options equally (similar to how global options and multiple files are handled). When playback of a file starts, the per-file options are set according to the command line. When playback ends, the per-file options are restored to the values when playback started.
* libvo: remove exit_player_bad()wm42012-07-303-17/+12
| | | | | For some reason, these 3 VOs basically call exit() if something went wrong.
* vo_gl, vo_gl3: honor global --vsync optionwm42012-07-303-3/+3
| | | | | | | | | Both VOs will now by default try to set vsync according to the global vsync setting. By default, vsync is enabled, and passing --no-vsync will disable it. The --vsync option used to matter for vo_vesa only, but that VO has been removed.
* Rip out 3DNOW supportwm42012-07-302-187/+2
| | | | | | | | Ancient AMD specific enhancement to the MMX instruction set. Officually discontinued by AMD. Note that support for this was already disabled in the previous commit. This commit removes the actual code.
* Remove compile time/runtime CPU detection, and drop some platformswm42012-07-303-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mplayer had three ways of enabling CPU specific assembler routines: a) Enable them at compile time; crash if the CPU can't handle it. b) Enable them at compile time, but let the configure script detect your CPU. Your binary will only crash if you try to run it on a different system that has less features than yours. This was the default, I think. c) Runtime detection. The implementation of b) and c) suck. a) is not really feasible (it sucks for users). Remove all code related to this, and use libav's CPU detection instead. Now the configure script will always enable CPU specific features, and disable them at runtime if libav reports them not as available. One implication is that now the compiler is always expected to handle SSE (etc.) inline assembly at runtime, unless it's explicitly disabled. Only checks for x86 CPU specific features are kept, the rest is either unused or barely used. Get rid of all the dump -mpcu, -march etc. flags. Trust the compiler to select decent settings. Get rid of support for the following operating systems: - BSD/OS (some ancient BSD fork) - QNX (don't care) - BeOS (dead, Haiku support is still welcome) - AIX (don't care) - HP-UX (don't care) - OS/2 (dead, actual support has been removed a while ago) Remove the configure code for detecting the endianness. Instead, use the standard header <endian.h>, which can be used if _GNU_SOURCE or _BSD_SOURCE is defined. (Maybe these changes should have been in a separate commit.) Since this is a quite violent code removal orgy, and I'm testing only on x86 32 bit Linux, expect regressions.
* fastmemcpy.h: remove code duplicationwm42012-07-301-28/+2
| | | | | | | Remove the mem2agpcpy_pic function, which is obviously duplicated from the other function in this file. Untested, as this is only used by the directx and directfb2 VOs.
* libvo: remove custom assembler memcpy implementations (aka fastmemcpy)wm42012-07-303-697/+6
| | | | | | | | | | | | | | aclib[_template].c contained inline assembler versions of memcpy using MMX/SSE/3dnow etc. instructions. It's possible that this gave quite a speed a decade ago, but it's unlikely to have any use on modern systems. Also, libc implementations already have their own optimizations for the native memcpy function. I did not verify my assumptions eith benchmarks, so I could be wrong. Also note that some platforms have extremely crappy libc implementations, and it's well possible that these might suffer from a major performance loss (hello Windows). Unfortunately, I do not care.
* bstr: rename bstr() function to bstr0(), and typedef bstr to struct bstrwm42012-07-281-4/+4
| | | | | Replace all uses of bstr() with bstr0(). Also remove the ridiculous C++ workaround.
* osd: use libass for OSD renderingwm42012-07-284-29/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OSD will now be rendered with libass. The old rendering code, which used freetype/fontconfig and did text layout manually, is disabled. To re-enable the old code, use the --disable-libass-osd configure switch. Some switches do nothing with the new code enabled, such as -subalign, -sub-bg-alpha, -sub-bg-color, and many more. (The reason is mostly that the code for rendering unstyled subtitles with libass doesn't make any attempts to support them. Some of them could be supported in theory.) Teletext rendering is not implemented in the new OSD rendering code. I don't have any teletext sources for testing, and since teletext is being phased out world-wide, the need for this is questionable. Note that rendering is extremely inefficient, mostly because the libass output is blended with the extremely strange mplayer OSD format. This could be improved at a later point. Remove most OSD rendering from vo_aa.c, because that was extremely hacky, can't be made work with osd_libass, and didn't work anyway in my tests. Internally, some cleanup is done. Subtitle and OSD related variable declarations were literally all over the place. Move them to sub.h and sub.c, which were hoarding most of these declarations already. Make the player core in mplayer.c free of concerns like bitmap font loading. The old OSD rendering code has been moved to osd_ft.c. The font_load.c and font_load_ft.c are only needed and compiled if the old OSD rendering code is configured.
* libvo, libao: remove useless video and audio output driverswm42012-07-2841-17445/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of these have only limited use, and some of these have no use at all. Remove them. They make maintainance harder and nobody needs them. It's possible that many of the removed drivers were very useful a dozen of years ago, but now it's 2012. Note that some of these could be added back, in case they were more useful than I thought. But right now, they are just a burden. Reason for removal for each module: vo_3dfx, vo_dfbmga, vo_dxr3, vo_ivtv, vo_mga, vo_s3fb, vo_tdfxfb, vo_xmga, vo_tdfx_vid: All of these are for very specific and outdated hardware. Some of them require non-standard kernel drivers or do direct HW access. vo_dga: the most crappy and ancient way to get fast output on X. vo_aa: there's vo_caca for the same purpose. vo_ggi: this never lived, and is entirely useless. vo_mpegpes: for DVB cards, I can't test this and it's crappy. vo_fbdev, vo_fbdev2: there's vo_directfb2 vo_bl: what is this even? But it's neither important, nor alive. vo_svga, vo_vesa: you want to use this? You can't be serious. vo_wii: I can't test this, and who the hell uses this? vo_xvr100: some Sun thing. vo_xover: only useful in connection with xvr100. ao_nas: still alive, but I doubt it has any meaning today. ao_sun: Sun. ao_win32: use ao_dsound or ao_portaudio instead. ao_ivtv: removed along vo_ivtv. Also get rid of anything SDL related. SDL 1.x is total crap for video output, and will be replaced with SDL 2.x soon (perhaps), so if you want to use SDL, write output drivers for SDL 2.x. Additionally, I accidentally damaged Sun support, which made me completely remove Sun/Solaris support. Nobody cares about this anyway. Some left overs from previous commits removing modules were cleaned up.
* build: remove bin_to_header.py and use TOOLS/file2string.py insteadwm42012-07-281-1/+3
| | | | | | TOOLS/file2string.py was recently added upstream, so bin_to_header.py is not needed anymore. Also fix vo_gl3.c, since file2string.py works slightly different from my script.
* Merge remote-tracking branch 'origin/master'wm42012-07-289-188/+151
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .gitignore bstr.c cfg-mplayer.h defaultopts.c libvo/video_out.c The conflict in bstr.c is due to uau adding a bstr_getline function in commit 2ba8b91a97e7e8. This function already existed in this branch. While uau's function is obviously derived from mine, it's incompatible. His function preserves line breaks, while mine strips them. Add a bstr_strip_linebreaks function, fix all other uses of bstr_getline, and pick uau's implementation. In .gitignore, change vo_gl3_shaders.h to use an absolute path additional to resolving the merge conflict.
| * vo_sharedbuffer: remove from autoprobe listStefano Pigozzi2012-07-271-3/+3
| | | | | | | | | | | | This video output is headless and only intended to work with GUIs explicitly asking for it. This makes it useless to have it in the autoprobe list.
| * vo_corevideo, vo_sharedbuffer: put private state in vo->privStefano Pigozzi2012-07-272-81/+77
| | | | | | | | | | | | | | These VOs were already using a struct for all private data but the struct variable itself was static. Change them to store the address in vo->priv. Also change them to use the new automatic private data allocation and option parsing mechanism.
| * vo_vdpau: disable refresh-aware frame timing when compositedUoti Urpala2012-07-273-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Under a compositing window manager the current VDPAU implementation behaves differently than without it. Frame flip timing info becomes incorrect (I guess it only reflects when the frame was sent to the compositor, not when it was actually shown), and there is no limitation to at most one frame switch per refresh like without compositing. Detect whether a compositing window manager is active and disable refresh-aware frame timing and dropping in this case, similarly to what fps=-1 would do. This behavior can be controlled with the new suboption "composite-detect". Disabling the refresh-aware logic makes timing somewhat less accurate. Because the video switch rate limit isn't there, the lack of frame dropping on player side does not impose a hard limit on video FPS, but does reduce performance somewhat as redundant frames are drawn in memory. The existence of a compositing window manager does not guarantee that the current window is actually composited, so the current check is not foolproof. In particular, some WMs have support for a "unredirect fullscreen windows" option. Support for such things could be improved.
| * vo_vdpau: fix possible crash after preemptionUoti Urpala2012-07-161-3/+5
| | | | | | | | | | | | | | | | | | | | Preemption recovery code could change the vc->vdp pointer when recreating the VDPAU device. However, some other code cached the value of vc->vdp in local variables over calls to handle_preemption(), and could then crash when using the stale value later. Make the device creation code keep the same vc->vdp instead of freeing and reallocating it, so that the old pointer value is never invalidated now.
| * build: use python3 to generate some files previously in gitUoti Urpala2012-07-161-43/+0
| | | | | | | | | | | | | | | | | | | | | | | | Some files used during build are generated with Python scripts in TOOLS/. Before, the generated files were included in the git tree. Start creating them at build time. This introduces a build-dependency on python3. The files in question are: libvo/vdpau_template.c libmpdemux/ebml_types.h libmpdemux/ebml_defs.c
| * VO: implement shared option handling, use for vdpauUoti Urpala2012-07-163-58/+50
| | | | | | | | | | | | | | | | Add infrastructure that allows VOs to specify the suboptions they take, and get the values directly parsed into their private struct. The option functionality available with the new system is the same as for top-level player options. Convert vo_vdpau to use the new system instead of the old subopt_helper.
* | cocoa: return the real CGLPixelFormatObjStefano Pigozzi2012-05-151-1/+1
| | | | | | | | | | vo_cocoa_cgl_pixel_format is returning a cached CGLPixelFormatObj. Return the current one by querying the OpenGL context.
* | cocoa: don't request a depth buffer sizeStefano Pigozzi2012-05-151-2/+0
| |
* | cocoa: gl3: make window creation fail on <10.7Stefano Pigozzi2012-05-151-0/+5
| | | | | | | | | | Versions of OSX prior to 10.7 do not support OpenGL 3. Fail the window creation when that is the case.
* | cocoa: gl3: support querying of colors bit depthStefano Pigozzi2012-05-153-0/+21
| | | | | | | | | | Add support for querying the bit depth of the colors from the OpenGL context. This allows to perform dithering correctly.
* | cocoa: handle failure on pixel format creationStefano Pigozzi2012-05-141-0/+6
| | | | | | | | | | | | | | | | This didn't make any difference on with OpenGL 2.1, but with the introduction of OpenGL3.2 it's possible for the pixel format creation to fail (if OpenGL3.2 is not supported). This code handles the failure case accordingly.
* | screenshot, vo_png: fix dependency on sizeof(AVFrame)wm42012-04-291-4/+11
| | | | | | | | | | | | | | | | | | In order to stay binary compatible with libavcodec, applications should not dependent on sizeof(AVFrame). This means allocating AVFrame on the stack is not allowed, and the function avcodec_alloc_frame() must be used to allocate an AVFrame instead. Partially based on a patch by uau.
* | Merge remote-tracking branch 'origin/master'wm42012-04-299-1058/+723
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bstr.c bstr.h libvo/cocoa_common.m libvo/gl_common.c libvo/video_out.c mplayer.c screenshot.c sub/subassconvert.c Merge of cocoa_common.m done by pigoz. Picking my version of screenshot.c. The fix in commit aadf1002f8a will be redone in a follow-up commit, as the original commit causes too many conflicts with the work done locally in this branch, and other work in progress.
| * cocoa_common: fix problems with alt-tab window changesStefano Pigozzi2012-04-261-4/+5
| | | | | | | | | | | | | | | | | | | | Fix alt tabbing to another window in the same workspace. The player window stayed on top because of a missing call to orderBack:. Fix alt tabbing to the player window from a different workspace. The window didn't get activated. Turns out that you must call makeKeyAndOrderFront: before setLevel: or setPresentationOptions: or the window will not properly ask for focus.
| * cocoa_common, gl_common: add OSX specific getProcAddressStefano Pigozzi2012-04-263-1/+17
| | | | | | | | | | | | | | | | Run dlopen on the OpenGL dynamic library instead of on the binary. This should prevent crashes due to function conflicts when X11/lGL is linked. Remove mutual exclusion of the X11 and Cocoa backends.
| * OSX, input: implement wakeup in response to Cocoa eventsStefano Pigozzi2012-04-262-0/+8
| | | | | | | | | | | | | | | | | | Add code to wake up the select() call in input.c when an OSX event is available and a Cocoa OpenGL backend is initialized. Fixes the slow response to input or other events in Cocoa-based VOs during long select() sleeps (e.g., when mplayer2 is paused) introduced by commit 7040968.
| * vo_sharedbuffer: add this video outputStefano Pigozzi2012-04-263-0/+318
| | | | | | | | | | | | | | | | | | | | This OSX video output is replaces the previous shared_buffer mode of vo_corevideo. It manages a shared buffer and a Cocoa distributed object to communicate with GUIs. Splitting this code into a separate VO allows to get rid of harmful code coupling, performance inefficiencies (useless image memory copies) and ugly code (big if-else conditionals).
| * vo_corevideo: restructure this video outputStefano Pigozzi2012-04-265-352/+349
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Restructure this video output to be similar to vo_gl, even if simpler and less feature complete (for example it's still missing EOSD support). Ideally, it should act as a decent fallback in the case where something breaks in the OSX support of vo_gl. Here's a summary of what changed: * Remove the shared buffer code since it wasn't using any function from the CoreVideo API. Moreover, its presence in vo_corevideo was forcing the non-GUI related code to perform more image copies than necessary. Equivalent shared-buffer functionality will be added in a separate new VO in the next commit (this means OSX GUIs will need to specify a different VO). * Clean up the code to conform a bit more to the mplayer2 conventions. Enforce 80 column wrapping, use a private struct for file variables, use the new libvo api. * Add OSD rendering using OpenGL instead of writing directly on the video image data. * Simplify the logic for the rendering function when dealing with panscan. * Add VOCTRL_REDRAW_FRAME support. * Add colormatrix support by using the built-in API provided by CoreVideo.
| * vo_corevideo: use cocoa_common to display the windowStefano Pigozzi2012-04-264-838/+166