aboutsummaryrefslogtreecommitdiffhomepage
path: root/video
Commit message (Collapse)AuthorAge
* x11: fix race condition when setting aspect when leaving fullscreenGravatar wm42014-02-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | vo_opengl creates a hidden X11 window to probe the OpenGL context. It must do that before creating a visible window, because VO creation and VO config are separate phases. There's a race condition involving the hidden window: when starting with --fs, and then leaving fullscreen, the unfullscreened window is sometimes set to the aspect ratio of the hidden window. I'm not sure why the window size itself uses the correct size (but corrupted by the wrong aspect), but that's perhaps because the window manager is free to ignore the size hint while honoring the aspect, or something equally messed up. It turns out this happens because x11_common.c thinks the size of the hidden window is the size of the unfullscreened window. This in turn happens because vo_x11_update_geometry() reads the size of the hidden window when called in vo_x11_fullscreen() (called from vo_x11_config_vo_window()) when mapping the fullscreen window. At that point, the window could be mapped, but not necessarily. If it's not mapped, it will get the size of the unfullscreened window... I think. One could fix this by actively waiting until the window is mapped. Try to pick a less hacky approach instead, and never read the window size until MapNotify is received. vo_x11_create_window() needs a hack, because we'd possibly set the VO's size to 0, resulting e.g. in vdpau to fail initialization. (It'll print error messages until a proper resize is received.)
* vo_wayland: silence shadowing warningGravatar wm42014-01-29
| | | | No real problem.
* mp_image: reject too large image sizesGravatar wm42014-01-29
| | | | | | | | | | | Larger sizes can introduce overflows, depending on the image format. In the worst case, something larger than 16000x16000 with 8 bytes per pixel will overflow 31 bits. Maybe there should be a proper failure path instead of a hard crash, but not yet. I imagine anything that sets a higher image size than a known working size should be forced to call a function to check the size (much like in ffmpeg/libavutil).
* wayland/shm: RGB888 as default, change optionsGravatar Alexander Preisinger2014-01-28
| | | | | | RGB565 is one of the fastest and most supported formats on low end consumer devices, but ffmpeg spams warning when using it. Make it opt-in instead of opt-out.
* wayland/shm: fix memory leakGravatar Alexander Preisinger2014-01-28
|
* wayland/shm: remove resize boilerplateGravatar Alexander Preisinger2014-01-28
| | | | | | The problem seems to have solved itself. I guess the previous changes to resizing and commit ba101ab made this possible. Consider me happy for removing that crap.
* vo_sdl: fix compilationGravatar wm42014-01-25
| | | | | | Still untested, because now it crashes inside of libSDL for unknown reasons. (This also happens with mpv git from yesterday - probably an installation problem, or SDL doing weird things it shouldn't be doing.)
* vo_wayland: fix confusion of video and window sizesGravatar wm42014-01-24
|
* video/out: do remaining config to reconfig replacementsGravatar wm42014-01-24
| | | | | | | The main difference between the old and new callbacks is that the old callbacks required passing the window size, which is and always was very inconvenient and confusing, since the window size is already in vo->dwidth and vo->dheight.
* aspect: remove a small ffmpeg dependencyGravatar wm42014-01-22
| | | | | Not strictly needed, but probably saves us pain the next time ffmpeg mess up their headers.
* vo: merge get rid of vo.aspdat fieldGravatar wm42014-01-22
| | | | | | | | | | | | Rename vo_get_src_dst_rects() to mp_get_src_dst_rects() and make it independent from the VO (it takes a comical amount of parameters now to pass all required state). Add a convenience wrapper with the name vo_get_src_dst_rects() to vo.c. Replace all aspdat and vo usages with immediate parameters. Functionally, nothing should change, except that the window size is clamped to a minimum of size 1 much earlier, and some log messages change the prefix (don't bother with vo.vo_log stuff).
* vo: move vo_get_src_dst_rects to aspect.cGravatar wm42014-01-22
| | | | | | | The plan is to make all the code in aspect.c independent from vo.c, which should make the code easier to understand, will allow removal of vo->aspdat, and reduces the amount of code that accesses weird mutable struct vo fields.
* video/out: don't access aspdat in VOsGravatar wm42014-01-22
| | | | | | | | | | | vo->aspdat is basically an outdated version of vo->params, plus some weirdness. Get rid of it, which will allow further cleanups and which will make multithreading easier (less state to care about). Also, simplify some VO code by using mp_image_set_attributes() instead of caring about display size, colorspace, etc. manually. Add the function osd_res_from_image_params(), which is often needed in the case OSD renders into an image.
* vo_opengl: don't assume there'a always 1 fbconfig on successGravatar wm42014-01-21
| | | | Seems to be a reasonable assumption, but it's probably not guaranteed.
* cocoa: remove dead codeGravatar Stefano Pigozzi2014-01-21
| | | | This became dead code in commit 3f594c2e.
* w32_common: Fix extended keysGravatar James Ross-Gowan2014-01-21
| | | | The KF_* flags work on the HIWORD of lParam. Whoops
* w32: use the w32_common keymap in terminal-win tooGravatar James Ross-Gowan2014-01-19
|
* sub: uglify OSD code path with lockingGravatar wm42014-01-18
| | | | | | | | | | | | | | | Do two things: 1. add locking to struct osd_state 2. make struct osd_state opaque While 1. is somewhat simple, 2. is quite horrible. Lots of code accesses lots of osd_state (and osd_object) members. To make sure everything is accessed synchronously, I prefer making osd_state opaque, even if it means adding pretty dumb accessors. All of this is meant to allow running VO in their own threads. Eventually, VOs will request OSD on their own, which means osd_state will be accessed from foreign threads.
* w32_common: add extended keysGravatar James Ross-Gowan2014-01-15
| | | | Also VK_APPS/MP_KEY_MENU was missing.
* w32_common: prevent decoding certain keys twiceGravatar James Ross-Gowan2014-01-15
| | | | | | | | This is a bit of a hack, but in order to prevent TranslateMessage from seeing WM_KEYDOWN messages that we already know how to decode, move the decoding logic to the event loop. This should fix #476, since it stops the generation of extraneous WM_CHAR messages that were triggering more than one action on keydown.
* options: remove --screenw and --screenhGravatar wm42014-01-11
| | | | | | | | | Doesn't make any sense anymore. X11 (which was mentioned in the manpage) autodetects it, and everything else ignored the option values. Since for incomprehensible reasons the backends and vo.c still need to exchange information about the screensize using the option fields, they're not removed yet.
* video/out: remove pointless x/y parameter from vo_x11_config_vo_windowGravatar wm42014-01-11
| | | | | This never made any real sense; the "backend" has to access vo->dx/dy anyway.
* video/out: simplify monitor aspect handlingGravatar wm42014-01-11
| | | | | | | | For some reason, this made all VO backends both set the screen resolution in opts->screenwidth/height, and call aspect_save_screenres(). Remove the latter. Move the code to calculate the PAR-corrected window size from aspect.c to vo.c, and make it so that the monitor PAR is recalculated when it makes sense.
* video/out: remove fallback handling for screensize/monitor pixel aspectGravatar wm42014-01-11
| | | | | | | When using --monitoraspect, but either the screen width or height or both are unknown, a fallback is applied. This is a completely useless obscure corner case that's going to help nobody, so get it out of the way.
* cocoa: fix window placement on secondary screensGravatar Stefano Pigozzi2014-01-11
| | | | | | | | | | | | | | For a long time the cocoa backend set the xinerama_x/y and used dx/dy from the VO instance. This somewhat worked with some workarounds but wasn't really what was supposed to be happening. Moreover 27e4360, which touched this workaround introduced a regression. New code doesn't set the xinerama_x/y values so that dx/dy are offsets in the current screen (not a virtual screen composed of all the screens). The screen reference detected during VOCTRL_UPDATE_SCREENINFO is also passed down to the window initialization code. Fixes #472
* vd_lavc: matroska: remove weird code setting extra_huff for mjpegGravatar wm42014-01-11
| | | | | | | | | | | Like with the previous commit, this is probably not needed, but it's unclear whether that really is the case. Most likely, it used to be needed by some demuxer, and now the only demuxer left that could _possibly_ trigger this is demux_mkv.c. Note that mjpeg is the only decoder that reads the extra_huff option, and nothing in libavformat actually sets the option. So maybe it's fundamentally not needed anymore.
* vd_lavc: matroska: remove weird realvideo special handlingGravatar wm42014-01-11
| | | | | | | | | | | | | This case can't happen with the normal realvideo codepath in demux_mkv.c, because the code would errors out if the extradata is too small, and everything would be broken anyway in the case the vd_lavc.c condition is actually triggered. It still might happen with VfW-muxed realvideo in Matroska, though. Basically, I'm hoping this doesn't matter anyway, and that the vd_lavc.c code was for other old demuxers, like demux_avi or demux_rm. Following the commit history, it's not really clear for what demuxer this code was added.
* vd_lavc: minor simplificationGravatar wm42014-01-11
|
* Factor out setting AVCodecContext extradataGravatar wm42014-01-11
|
* cocoa: refactor init window positioning codeGravatar Stefano Pigozzi2014-01-10
|
* cocoa: allow to drag and drop URLsGravatar Nyx0uf2014-01-10
| | | | | | | This commit also improves the visual feedback to the user by showing a plus icon in the mouse cursor when dragging supported types. Fixes #469
* wayland: properly empty output listGravatar Alexander Preisinger2014-01-08
|
* wayland/shm: don't crash if initialization failedGravatar Alexander Preisinger2014-01-08
|
* wayland: fix crash when initialization failsGravatar wm42014-01-08
| | | | | | On X11, if no wayland compositor is running, wl_list_init() will never be called. This will cause destroy_display() to segfault when trying to iterate over the list.
* wayland/shm: tone down warningsGravatar Alexander Preisinger2014-01-08
| | | | Those warnings are printed far too often and actually aren't usefull at all.
* wayland: fix memory leaksGravatar Alexander Preisinger2014-01-08
| | | | | There are still some leaks from wayland-cursor stuff, but there is no way to free the memory as user of the cursor library.
* wayland: cleanup registry_handle_globalGravatar Alexander Preisinger2014-01-08
| | | | | The wl_registry object is already passed as a parameter. No need to create a temporary variable.
* wayland: remove set_user_data from seat_listenerGravatar Alexander Preisinger2014-01-08
| | | | | | | | | The user_data is passed on add_listener and can later be changed with set_user_data. But because we don't want to change it later and because it is the same object remove the set_user_data call. This might be a copy&paste leftover from the initial draft for the wayland backend.
* wayland: use static consistentlyGravatar Alexander Preisinger2014-01-08
| | | | Declare everything that is only needed inside wayland_common.c as static.
* wayland: fix fullscreen & resizing for goodGravatar Alexander Preisinger2014-01-07
| | | | | | | I added enough logic to never set ontop or fullscreen twitce. This commit keeps also the size of the video if multiple videos are played. If the ratio differs the width will be kept at the same size and only the height changes.
* wayland: silence annoying libwayland-client messageGravatar wm42014-01-07
| | | | | | | | | | | | | | | | | libwayland-client contains the following code [1]: runtime_dir = getenv("XDG_RUNTIME_DIR"); if (!runtime_dir) { fprintf(stderr, "error: XDG_RUNTIME_DIR not set in the environment.\n"); This means this message will unconditionally and unavoidably be printed if XDG_RUNTIME_DIR is not set. Since mpv is a terminal program, and we want to avoid unnecessary output, work it around by not attempting to use wayland if this environment variable is not set. [1] http://cgit.freedesktop.org/wayland/wayland/tree/src/wayland-client.c#n636 (cd0dccd01e16fa404e03974d30ded3aebdb1c4bc)
* wayland: fix some memory leaks on initialization failureGravatar wm42014-01-07
| | | | | | | | | | | This commonly happens when initializing vo_opengl on a X11-only system. Unfortunately, most wl_*_destroy() functions appear not to accept NULL pointers, making partial deinitialization a pain: you have to add your own NULL checks everywhere to avoid crashes. xkb.context is uninitialized separately, because you can initialize it just fine, even if the rest of input initialization fails.
* w32_common: reformat yet againGravatar Martin Herkt2014-01-06
| | | | | I've been told mpv prefers switch/case on the same indent level. Sorry about the noise :P
* cocoa: don't reset window size when the video size doesn't changeGravatar Stefano Pigozzi2014-01-06
| | | | Fixes #459
* w32_common: don't force topmost on fullscreenGravatar Martin Herkt2014-01-06
| | | | Fixes #457, #444.
* w32_common: reformat slightlyGravatar Martin Herkt2014-01-06
| | | | This really needs more whitespace.
* w32_common: use OLE DnD for text/uri-list supportGravatar xnoreq2014-01-06
| | | | Signed-off-by: Martin Herkt <lachs0r@srsfckn.biz>
* Revert "wayland/egl: use redraw callback"Gravatar Alexander Preisinger2014-01-04
| | | | | | | | | | | Because of this commit there were problems displaying the frmase in their right order. This reverts commit 96e75d234a4df1a09f38eaf932d00d79dccdc324. Conflicts: video/out/gl_wayland.c video/out/wayland_common.h
* wayland: remove workaroundGravatar Alexander Preisinger2014-01-04
| | | | | | | | The changes in the vo_wayland_ontop function have no effect on the workaround. Somehow the problem just disappeared. I guess it is because of the new control function in gl_wayland.c where the resize happens immediatly after the event dispatch/flush.
* wayland: fix obvious bug in dnd codeGravatar Alexander Preisinger2014-01-04
| | | | I still don't think this is the right approach.