summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* vo_opengl: remove most of the "inline" documentationwm42013-05-261-86/+8
| | | | | | | | | | | There's no point duplicating all the text that is already in the man pages, and synchronizing them is a pain. Place a link to the github generated pages instead. Unfortunately, the anchor '#vo-opengl' does not work. Maybe github's rst converter just sucks, as the actually generated HTML contains links using that anchor too, but does not generate the anchor itself. Too bad.
* vf_delogo: copy in non-direct case, fix double-freewm42013-05-261-9/+1
| | | | | | | | | If the image is not writeable, the image actually has to be copied beforehand. This was overlooked when converting the video chain to reference counted images. Fix a double free issue. This was overlooked when vf.c was changed to free filter priv data automatically.
* gl_video: improve ditheringwm42013-05-267-23/+330
| | | | | | | | | | | | | | | | | | | | | | | | | | Use a different algorithm to generate the dithering matrix. This looks much better than the previous ordered dither matrix with its cross-hatch artifacts. The matrix generation algorithm as well as its implementation was contributed by Wessel Dankers aka Fruit. The code in dither.c is his implementation, reformatted and with static global variables removed by me. The new matrix is uploaded as float texture - before this commit, it was a normal integer fixed point matrix. This means dithering will be disabled on systems without float textures. The size of the dithering matrix can be configured, as the matrix is generated at runtime. The generation of the matrix can take rather long, and is already unacceptable with size 8. The default is at 6, which takes about 100 ms on a Core2 Duo system with dither.c compiled at -O2, which I consider just about acceptable. The old ordered dithering is still available and can be selected by putting the dither=ordered sub-option. The ordered dither matrix generation code was moved to dither.c. This function was originally written by Uoti Urpala.
* gl_video: add scaler-resizes-only sub-optionwm42013-05-262-0/+25
| | | | | This option disables the scaler set with lscale if the video image is not resized.
* Replace calls to usec_sleep()wm42013-05-262-2/+2
| | | | | | This is just dumb sed replacement to mp_sleep_us(). Also remove the now unused usec_sleep() wrapper.
* Replace all calls to GetTimer()/GetTimerMS()wm42013-05-265-18/+22
| | | | | | | | | | | | | | | | | | | | | | GetTimer() is generally replaced with mp_time_us(). Both calls return microseconds, but the latter uses int64_t, us defined to never wrap, and never returns 0 or negative values. GetTimerMS() has no direct replacement. Instead the other functions are used. For some code, switch to mp_time_sec(), which returns the time as double float value in seconds. The returned time is offset to program start time, so there is enough precision left to deliver microsecond resolution for at least 100 years. Unless it's casted to a float (or the CPU reduces precision), which is why we still use mp_time_us() out of paranoia in places where precision is clearly needed. Always switch to the correct time. The whole point of the new timer calls is that they don't wrap, and storing microseconds in unsigned int variables would negate this. In some cases, remove wrap-around handling for time values.
* vo: rip out VO timer wakeup mechanism againwm42013-05-262-19/+0
| | | | | | | This was used by some VOs to do timing of cursor autohiding, but we recently moved that out of the VOs. Even though this mechanism might be a good idea and could be needed again in future (but for what?), it's unused now. So better just get rid of it.
* cocoa_common: send mouse moved events to core when draggingStefano Pigozzi2013-05-261-2/+7
| | | | This change fixes mouse autohide when dragging mouse.
* wayland: use VOCTRL_SET_CURSOR_VISIBILITYAlexander Preisinger2013-05-262-36/+25
|
* wayland: introduce vo_wayland_configAlexander Preisinger2013-05-263-26/+24
| | | | | This removes the need for exposing vo_wayland_fullscreen and other functions also this will be usefull for other vos in the future.
* cocoa_common: implement VOCTRL_SET_CURSOR_VISIBILITYStefano Pigozzi2013-05-261-39/+20
| | | | Pass along cursor visibility hints to be more consistent with OSX's behaviour.
* cocoa_common: implement mouse movement notificationsStefano Pigozzi2013-05-261-0/+10
| | | | | | Notify the core of mouse movement events. The coordinates are converted to a coordinate system with the origin in upper left corner, since Cocoa has it in the lower left corner.
* w32: use VOCTRL_SET_CURSOR_VISIBILITYwm42013-05-261-6/+7
| | | | | This didn't even implement --cursor-autohide. Now it does, and the behavior of the VOs under Windows change accordingly.
* vo_sdl: use VOCTRL_SET_CURSOR_VISIBILITYwm42013-05-261-39/+3
|
* x11: remove cursor hiding logic, use VOCTRL_SET_CURSOR_VISIBILITYwm42013-05-262-48/+33
|
* core: do mouse cursor hiding business in frontendwm42013-05-261-0/+2
| | | | | Do this so that not every VO backend has to setup a timer for cursor hiding and interpret the --cursor-autohide option.
* vo: remove vo.check_events callbackwm42013-05-267-25/+8
| | | | | | Use VOCTRL_CHECK_EVENTS instead. Change the remaining VOs to use it. Only vo_sdl and vo_caca actually need this, and vo_null, vo_lavc, and vo_image had stubs only.
* w32: use vo_w32_control() for all VOswm42013-05-263-40/+15
|
* x11: use vo_x11_control() for all VOswm42013-05-265-80/+31
|
* video/out: introduce vo_control for gl_common based VOswm42013-05-2618-158/+138
| | | | | | | | | | | | | | | | Instead of having separate callbacks for each backend-handled feature (like MPGLContext.fullscreen, MPGLContext.border, etc.), pass the VOCTRL responsible for this directly to the backend. This allows removing a bunch of callbacks, that currently must be set even for optional/lesser features (like VOCTRL_BORDER). This requires changes to all VOs using gl_common, as well as all backends that support gl_common. Also introduce VOCTRL_CHECK_EVENTS. vo.check_events is now optional. VO backends can use VOCTRL_CHECK_EVENTS instead to implementing check_events. This has the advantage that the event handling code in VOs doesn't have to be duplicated if vo_control() is used.
* vf_lavfi: allow setting avoptswm42013-05-261-0/+9
|
* cocoa_common: authohide menu/dock in fullscreenStefano Pigozzi2013-05-261-2/+3
| | | | | This simple fix makes it possible to access the MainManu and Dock when in fullscreen when not using `--native-fs`.
* m_option, vf: add label supportwm42013-05-232-1/+18
| | | | | | | | | | | | | | | | | Can be used to refer to filters by name. Intended to be used when the filter chain is changed at runtime. A label can be assigned to a filter by prefixing it with '@name:', where 'name' is an user-chosen identifier. For example, a filter added with '-vf-add @label1:gradfun=123' can be removed with '-vf-del @label1'. If a filter with an already existing label is added, the existing filter is replaced with the new filter (this happens for both -vf-add and -vf-pre). If a filter is replaced, the new filter takes the position of the old filter, instead of being appended/prepended to the filter chain as usual. For -vf-toggle, labels are compared if at least one of the filters has a label; otherwise they are compared by filter name and arguments (like before). This means two filters are never considered equal if one has a label and the other one does not.
* vo: remove unused callbackwm42013-05-231-1/+0
|
* dec_video: get rid of two global variableswm42013-05-213-10/+3
|
* dec_video: remove emms usagewm42013-05-211-10/+0
| | | | | | | libavcodec generally shouldn't have this problem anymore (if libavcodec ever had it). All other video decoders are gone. In any case, if this commit actually causes regressions, these are libavcodec bugs and should be fixed there instead.
* vf_lavfi: remove redundant statementswm42013-05-211-4/+0
|
* Silence some compiler warningswm42013-05-213-4/+4
| | | | None of these were actual issues.
* vo_image: start image file numbers at 1wm42013-05-181-2/+2
| | | | Requested by a user.
* video/filter: fix option parser memory leakwm42013-05-186-16/+3
| | | | | | | This happens only if an option actually allocates memory (like strings). Change filter API such that vf->priv is free'd by vf.c instead by the filters. vf.c will free the option values as well.
* core: allow changing filter filters at runtimewm42013-05-181-0/+1
| | | | | | | | | | | | | | | | Add the "vf" command, which allows changing the video filter chain at runtime. For example, the 'y' key could be bound to toggle deinterlacing by adding 'y vf toggle yadif' to the input.conf. Reconfiguring the video filter chain normally resets the VO, so that it will be "stuck" until a new video frame is rendered. To mitigate this, a seek to the current position is issued when the filter chain is changed. This is done only if playback is paused, because normal playback will show an actual new frame quickly enough. If vdpau hardware decoding is used, filter insertion (whether it fails or not) will break the video for a while. This is because vo_vdpau resets decoding related things on vo_config().
* vd_lavc: change VDCTRL_REINIT_VO behaviorwm42013-05-181-3/+1
| | | | | | | | | | | | | This tried to use ctx->pic (last decoded AVFrame) for the frame bounds. However, if av_frame_unref() on the AVFrame is called, the function will reset _all_ AVFrame fields, even those which are not involved with memory management. As result, mpcodecs_config_vo() was called with 0 width/height, which made the function exit early, instead of reconfiguring the filter chain. Go back to using mpcodecs_config_vo() directly. (That's what it did before this VDCTRL was originally introduced; the original reason for it disappeared.)
* video: rename VDCTRL_RESET_ASPECT to VDCTRL_REINIT_VOwm42013-05-184-5/+5
| | | | Same thing, and VDCTRL_REINIT_VO implies more generic use.
* mp_image: align image allocation heightwm42013-05-171-1/+2
| | | | | | | | | | | | vo_vdpau actually reads past the image allocation when displaying a non-mod 2 420p image. The vdpau API specifies that VdpVideoSurfacePutBitsYCbCr() requires a height that is a multiple of 4, and surface allocations are automatically rounded. So allocate video images with rounded height. libavutil does the same, so images coming directly from the decoder or from libavfilter are no problem. (libavutil does this alginment explicitly, not just because the decoded image size is aligned to macroblocks.)
* cocoa_common: vo_corevideo: fix window initializationStefano Pigozzi2013-05-161-5/+5
| | | | | vo_corevideo doesn't create a hidden window to perform OpenGL extensions detection. This caused the window to always stay close.
* vd_lavc: hack-fix vdpau decoding with non mod 16 videowm42013-05-141-1/+10
| | | | | | | This changes the code so that it does the same as MPlayer, mplayer2 and mpv before ref-counted AVFrame. The problem is that get_buffer2 is called with aligned frame dimensions, while get_buffer didn't. This breaks the mpv video frame size change detection.
* cocoa_common: order front window only when invisible [2]Stefano Pigozzi2013-05-141-1/+5
| | | | | | Followup to 8df7127. This refines the condition for front ordering the condition to account for minimized or hidden state where the window should go to the front only as a consequnce of user interaction.
* cocoa_common: order front window only when invisibleStefano Pigozzi2013-05-131-1/+1
| | | | | | | Window creation code always made mpv the front window. Fix it to make it front only if the window is currently invisible. Fixes #84
* cocoa_common: don't use recursive lockingStefano Pigozzi2013-05-131-2/+2
| | | | | This was in the original change set for the threadsafety changes but I forgot to squash it in.
* cocoa_common: remove pointless locking when using -fsStefano Pigozzi2013-05-131-5/+10
| | | | | | | | When using --fs `vo_cocoa_fullscreen` was called from the primary thread. This occurred inside `vo_cocoa_config_window` which is scheduled for excution on the primary thread with libdispatch). All of this caused spam from NSRecursiveLock in standard output.
* cocoa_common: fix a bug in window dragging stateStefano Pigozzi2013-05-131-13/+9
| | | | | | | | | | | | When going in and going out of full screen the player lost information on the movableByWindowBackground behaviour. There were some hacks in place to fix it but they were broken with the recent native fullscreen changes in 74c15ec6. This commit removes the problem at the root and removes the hacks. The delegate method `isMovableByWindowBackground` seems to be called after setFrame and setPresentationOptions so change fs state in opts before that. Fixes #83
* cocoa_common: fix deadlock when calling resize_redrawStefano Pigozzi2013-05-121-4/+9
| | | | Fixes #82
* cocoa_common: add native OSX fullscreen supportStefano Pigozzi2013-05-121-20/+39
| | | | | | | | This adds Mission Control fullscreen functionality to mpv. Since this doesn't play well with many of mpv's features disable it by default. Users can activate this feature by using `--native-fs` when starting mpv. Fixes #34
* OSX: run native event loop in a separate threadStefano Pigozzi2013-05-125-104/+253
| | | | | | | | | | | | | | This commit is a followup on the previous one and uses a solution I like more since it totally decouples the Cocoa code from mpv's core and tries to emulate a generic Cocoa application's lifecycle as much as possible without fighting the framework. mpv's main is executed in a pthread while the main thread runs the native cocoa event loop. All of the thread safety is mainly accomplished with additional logic in cocoa_common as to not increase complexity on the crossplatform parts of the code.
* OSX: use native Cocoa's event loopStefano Pigozzi2013-05-121-139/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Schedule mpv's playloop as a high frequency timer inside the main Cocoa event loop. This has the benefit to allow accessing menus as well as resizing the window without the playback being blocked and allows to remove countless hacks from the code that involved manually pumping the event loop as well simulating manually some of the Cocoa default behaviours. A huge improvement consists in removing NSApplicationLoad. This is a C function defined in the Cocoa header and implements a minimal OSX application under ther hood so that you can use the Cocoa GUI toolkit from C/C++ without having to respect the Cocoa standards in terms of application initialization. This was bad because the behaviour implemented by NSApplicationLoad was hard to customize and had several gotchas especially in the menu department. mpv was changed to be just a nib-less application. All the Cocoa part is still generated in code but the event handling is now not dissimilar to what is present in a stock Mac application. As a part of reviewing the initialization process, I also removed all of `osdep/macosx_finder_args`. The useful parts of the code were moved to `osdep/macosx_appication` which has the broaded responsibility of managing the full lifecycle of the Cocoa application. By consequence the `--enable-macosx-finder` configure switch was killed as well, as this feature is always enabled. Another change the users will notice is that when using a bundle the `--quiet` option will be inserted much earlier in the initializaion process. This results in mpv not spamming mpv.log anymore with all the initialization outputs.
* add a way to resize window contents without VO resizewm42013-05-124-13/+80
| | | | | | | | | gl_video_resize_redraw() simply resizes and redraws (but without invoking swapGlBuffers()). The VO is not involved in any way, so this can simply be called from inside the mpgl lock from any thread. Requires a minor refactor of the GL OSD code in order to redraw without an OSD object.
* vo_opengl: lock OpenGL contextwm42013-05-121-4/+55
| | | | | | | | | | To simplify things, we just assume that all OpenGL calls as well as all calls into gl_video must be locked. Currently, also assume that anything GUI related must be locked as well (stuff like VOCTRL_BORDER). In its current state, this commit does nothing, but it will allow us to move the Cocoa GUI out of the playloop, as well as possibly implementing better framedropping.
* gl_common: add some sort of locking APIwm42013-05-122-0/+35
| | | | | | | | | Some OpenGL implementations on some platforms require that a context is current only on one thread. For this reason, mpgl_lock() and mpgl_unlock() take care of this as well for convenience. Each backend that needs thread safety should provide it's own locking strategy inside of `set_current`.
* wayland: reworked resizingAlexander Preisinger2013-05-073-67/+74
| | | | | | | | | | This fixes 2 bugs: * Resizing very fast breaks the aspect of the window and the width and height don't match with the video anymore * Pressing 'f' for fullscreen very fast can overwrite the backup variables for the previous width and height. Also includes a better aspect calculation with fluid resizing.
* Fix some cppcheck / scan-build warningswm42013-05-063-3/+3
| | | | | | | | These were found by the cppcheck and scan-build static analyzers. Most of these aren't interesting (the 2 previous commits fix some interesting cases found by these analyzers), and they don't nearly fix all warnings. (Most of the unfixed warnings are spam, things MPlayer never cared about, or false positives.)
* vf_yadif: actually set PTS for output frameswm42013-05-061-0/+1
| | | | The original frame PTS was used instead. Oops...
* img_format: fix broken conditionwm42013-05-061-1/+1
| | | | | | This caused all formats with fewer than 8 bits per component marked as little endian. (Normally, only some messed up packed RGB formats are endian-specific in this case.)
* csputils: use AVCOL_SPC_YCOCG instead of AVCOL_SPC_YCGCO (fixes Libav build)wm42013-05-051-2/+2
| | | | | | | | This one should probably be blamed on ffmpeg. Its headers contain: #define AVCOL_SPC_YCGCO AVCOL_SPC_YCOCG Uh, ok...
* video: add --hwdec-codecs option to whitelist codecs for hw decodingwm42013-05-041-3/+16
|
* vd_lavc: allow explicitly selecting vdpau hw decoderswm42013-05-041-1/+11
| | | | | | | | | | | | This allows using the vdpau decoders with -vd without having to use the -hwdec switch (basically like in mplayer). Note that this way of selecting the hardware decoder is still deprecated. libavcodec went away from adding special decoder entries for hardware decoding, and instead makes use of the "hwaccel" architecture, where hardware decoders use the same decoder names as the software decoders. The old vdpau special decoders will probably be deprecated and removed in the future.
* video: support YCgCo colorspacewm42013-05-042-0/+13
| | | | | | | YCgCo can be manually selected, but will also be used if the decoder reports YCgCo. To make things more fun, files are sometimes marked incorrectly, which will display such broken files incorrectly starting with this commit.
* vo_opengl: XYZ input supportwm42013-05-044-12/+70
| | | | | | | | | | | | | | | | Useful for the j2k decoder. Matrix taken from http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html (XYZ to sRGB, whitepoint D65) Gamma conversion follows what libswscale does (2.6 in, 2.2 out). If linear RGB is used internally for scaling, the gamma conversion will be undone by setting the exponent to 1. Unfortunately, the two gamma values don't compensate each others exactly (2.2 vs. 1/0.45=2.22...), so output is a little bit incorrect in sRGB or color-managed mode. But for now try hard to match libswscale output, which may or may not be correct.
* video: fix setting XYZ flagwm42013-05-041-4/+4
| | | | Commit 9e0b68a didn't really do this correctly, failure at basic logic.
* gl_video: use GL_SRGB only if it's really RGBwm42013-05-041-2/+3
| | | | | Use the proper RGB flag instead of !YUV. Currently, this doesn't change anything, because only RGB and YUV formats are supported.
* vf_rotate: fix for some obscure pixel formatswm42013-05-031-7/+6
| | | | | Repurpose the 3 byte case for any unhandled pixel width. Fixes rotation with e.g. rgb48. Very inefficient, but works.
* wayland: fix wrong poll comment, check for errorsAlexander Preisinger2013-05-021-2/+4
| | | | | | | | We only print an error message when POLLERR or POLLHUP occurrs, as the something did go horribly wrong and the server will either deal with it or crash. Also add POLLOUT to the events.
* wayland: avoid iterating over all outputsAlexander Preisinger2013-05-021-15/+18
| | | | | If we use the output itself as user data we don't have to iterate over all outputs when the handle_mode event comes.
* wayland: remove unused stuffAlexander Preisinger