summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* 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 Preisinger2013-05-022-17/+0
|
* wayland: use new function xkb_keymap_from_bufferAlexander Preisinger2013-05-021-9/+5
| | | | | | Bump xkbcommon version and use the new xkb_keymap_from_buffer. This is more secure, because the from_string expects a 0 terminated string, but this cannot be guaranteed with mmap.
* Fix compilation with Libavwm42013-05-011-1/+1
|
* video: add XYZ supportwm42013-05-014-0/+19
| | | | Needed for the ffmpeg j2k decoder.
* wayland: remove input modifier variableAlexander Preisinger2013-05-012-14/+0
| | | | This variable was never used anywhere.
* wayland: use GetTimerMS for hiding mouse cursorAlexander Preisinger2013-05-012-161/+39
| | | | | | This commit remove a lot of linux specific code, like epoll. It also reduces the complexity of the code. Instead of epoll we use poll which makes the wayland backend more portable to other platforms.
* wayland: use mpv internal key auto-repeat handlingAlexander Preisinger2013-05-012-61/+5
| | | | | | This removes a good chunk of code trying to recreate key repeat. Because the wayland protocol and xkbcommon don't have an interface for auto-repeating pressed keys.
* cocoa_common: fix window sizingStefano Pigozzi2013-04-281-2/+2
| | | | | | The code was attempting to get the ceiling of the double. Too bad NSSize has floats inside of it and the int cast is nowhere to be seen. This caused rounding errors by one pixel in the window size.
* vd_lavc: fix decoder init failure pathwm42013-04-271-14/+18
| | | | | | | | | libavcodec decoder initialization failure caused a segfault, because it wasn't properly reported back in init(). Also remove the return value from init_avctx(), which actually makes things simpler. Instead, ctx->avctx can be checked to see whether initialization was ok.
* vf_lavfi: move compat crap to the start of the filewm42013-04-261-18/+18
|
* vf_lavfi: silence stupid deprecation warningwm42013-04-261-2/+12
| | | | | | | | | | | | | | | | | | | libavfilter changed the way a format list is passed to vf_format. Now you have to separate formats with "|" instead of ":". If you use "|", it prints an annoying message on every reinit: [format @ 0x8bbaaa0]This syntax is deprecated. Use '|' to separate the list items. ...and it will probably stop working without warning at some point in the future. We need some very annoying ifdeffery to detect this case, because libavfilter version numbers are just plain incompatible between Libav and ffmpeg. There is no other way to detect this. (Sometimes I wonder whether ffmpeg and especially Libav actually like causing unnecessary pain for their users, and intentionally break stuff in the most annoying way possible. Sigh...)
* vf_lavfi: recreate filter graph on seekwm42013-04-251-14/+41
| | | | | | | | | | | | | | Resetting the filter graph helps dealing with filters which save state between frames. This is important especially if they modify frame timing or emit additional frames. Unfortunately the libavfilter API doesn't have a way to do this directly, so we have to use a dirty trick: we recreate the whole graph, including format negotiation down and filter string parsing. ffplay does this too. If libavfilter somehow decides to change output format or size from what the first run in config() returned, mpv will explode. The same applies to vf_next_query_format() return values (although this could be mitigated, should it really happen).
* x11: use mpv internal key auto-repeat handling if possiblewm42013-04-242-2/+24
| | | | | | | | | | | | | | | | | Block X11's native key repeat, and use mpv's key repeat handling in input.c instead. No configure check for XKB. Even though it's an extension, it has been part of most (all?) xlibs since 1996. If XKB appears to be missing, just refuse enabling x11. This is a potentially controversial change. mpv will use its own key repeat rate, instead of X11's. This should be better, because seeking will have a standardized "speed" (seek events per seconds when keeping a seek key held down). It will also allow disabling key repears for certain commands, though this is not done anywhere yet. The new behavior can be disabled with the --native-keyrepeat option.
* vo_opengl_old: remove nomanyfmts warningwm42013-04-231-3/+0
| | | | | | The VO warns by default that the nomanyfmts option should be used if video display fails. This is almost completely useless, but people keep asking what it means.
* vf_lavfi: add libavfilter bridgewm42013-04-212-0/+315
| | | | | | | | | | | | | | | | | Requires recent FFmpeg/Libav git versions. Earlier versions will not be supported, as the API is different. (A libavfilter version that uses AVFrame instead of AVFilterBuffer is needed.) Note that this is sort of useless, because the option parser prevents you from making use of the full libavfilter graph syntax. This has to be fixed later. Most of the filter creation code (half of the config() function) has been taken from avplay.c. This code is not based on MPlayer's vf_lavfi. The MPlayer code doesn't compile as it hasn't been updated through multiple libavfilter API changes, making it completely useless as a starting point.
* mp_image: provide function to convert mp_image to AVFramewm42013-04-212-0/+53
| | | | | | Note that this does not pass through QP information (qscale field). The only filter for which this matters is vf_pp, and we have this natively.
* x11_common: minor simplificationwm42013-04-211-13/+6
|
* cocoa_common: keep aspect ratio when clipping windowStefano Pigozzi2013-04-171-7/+35
| | | | | With commit 33ffc283 resizing to double size would cause the window to lose aspect ratio. This commit fixes this bug.
* change reverse DNS strings to io.mpv.*Stefano Pigozzi2013-04-161-1/+1
| | | | fixes #60
* cocoa_common: refactor centered resizeStefano Pigozzi2013-04-161-24/+21
| | | | | | This refactor makes the code easier to understand. Also corrects a bug that caused the window to move to the left when the new size was bigger than the visible frame.
* vf_divtc, vf_phase: Fix handling of subsampled formatsMartin Herkt2013-04-102-3/+4
| | | | | | These filters incorrectly calculated the amount of bytes per line in each plane for chroma subsampled formats, causing undefined behavior.
* wayland: use vo flags for enabling alpha supportAlexander Preisinger2013-04-021-3/+5
| | | | I missed the VOFLAG for enabling alpha support
* wayland: enable alpha supportAlexander Preisinger2013-04-021-1/+1
| | | | | | It is now possible to show images and videos with alpha information correctly. This was disalbed before, because there was a bug that made black parts of videos also transparent.
* gl_video: remove double const qualifierStefano Pigozzi2013-03-301-1/+1
| | | | This fixes a warning when compiling with clang.
* gl_video: add some missing includeswm42013-03-301-0/+8
| | | | On most platforms, they are recursively included, but not all.
* gl_lcms: fix compilation when lcms2 is not availablewm42013-03-301-3/+10
|
* gl_video: actually fix shader compilation on OSXwm42013-03-282-2/+3
| | | | | | | | | | | | | The previous attempt was missing some code paths, so there were still shaders generated that triggered the shader compilation error. Fix it instead by special handling USE_CONV in the shader. By the way, the shader compiler did not accept: #if defined(USE_CONV) && (USE_CONV == ...) In my opinion this should be perfectly fine, but it gives the same error as before. So test USE_CONV separately with #ifndef.
* gl_video: fix OSX by not using undefined name in GLSL "#if"wm42013-03-281-0/+2
| | | | | | | | | | | | | | | | | | | The OSX shader compiler was giving this error: ERROR: 0:235: '' : syntax error incorrect preprocessor directive on this line: [235] #if USE_CONV == CONV_PLANAR USE_CONV was undefin