summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* aspect: remove a small ffmpeg dependencywm42014-01-221-4/+2
| | | | | Not strictly needed, but probably saves us pain the next time ffmpeg mess up their headers.
* vo: merge get rid of vo.aspdat fieldwm42014-01-225-109/+91
| | | | | | | | | | | | 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.cwm42014-01-222-128/+130
| | | | | | | 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 VOswm42014-01-228-47/+20
| | | | | | | | | | | 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 successwm42014-01-211-1/+1
| | | | Seems to be a reasonable assumption, but it's probably not guaranteed.
* cocoa: remove dead codeStefano Pigozzi2014-01-212-8/+0
| | | | This became dead code in commit 3f594c2e.
* w32_common: Fix extended keysJames Ross-Gowan2014-01-211-1/+1
| | | | The KF_* flags work on the HIWORD of lParam. Whoops
* w32: use the w32_common keymap in terminal-win tooJames Ross-Gowan2014-01-191-58/+5
|
* sub: uglify OSD code path with lockingwm42014-01-1810-11/+12
| | | | | | | | | | | | | | | 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 keysJames Ross-Gowan2014-01-151-23/+54
| | | | Also VK_APPS/MP_KEY_MENU was missing.
* w32_common: prevent decoding certain keys twiceJames Ross-Gowan2014-01-151-12/+34
| | | | | | | | 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 --screenhwm42014-01-111-7/+2
| | | | | | | | | 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_windowwm42014-01-117-15/+10
| | | | | This never made any real sense; the "backend" has to access vo->dx/dy anyway.
* video/out: simplify monitor aspect handlingwm42014-01-119-39/+25
| | | | | | | | 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 aspectwm42014-01-111-7/+1
| | | | | | | 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 screensStefano Pigozzi2014-01-111-3/+2
| | | | | | | | | | | | | | 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 mjpegwm42014-01-111-12/+0
| | | | | | | | | | | 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 handlingwm42014-01-111-16/+1
| | | | | | | | | | | | | 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 simplificationwm42014-01-111-11/+2
|
* Factor out setting AVCodecContext extradatawm42014-01-111-19/+8
|
* cocoa: refactor init window positioning codeStefano Pigozzi2014-01-101-2/+1
|
* cocoa: allow to drag and drop URLsNyx0uf2014-01-101-5/+19
| | | | | | | 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 listAlexander Preisinger2014-01-081-4/+4
|
* wayland/shm: don't crash if initialization failedAlexander Preisinger2014-01-081-3/+1
|
* wayland: fix crash when initialization failswm42014-01-081-1/+2
| | | | | | 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 warningsAlexander Preisinger2014-01-081-2/+2
| | | | Those warnings are printed far too often and actually aren't usefull at all.
* wayland: fix memory leaksAlexander Preisinger2014-01-083-2/+24
| | | | | 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_globalAlexander Preisinger2014-01-081-2/+1
| | | | | The wl_registry object is already passed as a parameter. No need to create a temporary variable.
* wayland: remove set_user_data from seat_listenerAlexander Preisinger2014-01-081-2/+0
| | | | | | | | | 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 consistentlyAlexander Preisinger2014-01-081-4/+4
| | | | Declare everything that is only needed inside wayland_common.c as static.
* wayland: fix fullscreen & resizing for goodAlexander Preisinger2014-01-073-12/+34
| | | | | | | 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 messagewm42014-01-071-0/+3
| | | | | | | | | | | | | | | | | 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 failurewm42014-01-071-6/+13
| | | | | | | | | | | 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 againMartin Herkt2014-01-061-208/+208
| | | | | 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 changeStefano Pigozzi2014-01-061-15/+14
| | | | Fixes #459
* w32_common: don't force topmost on fullscreenMartin Herkt2014-01-061-1/+2
| | | | Fixes #457, #444.
* w32_common: reformat slightlyMartin Herkt2014-01-061-68/+99
| | | | This really needs more whitespace.
* w32_common: use OLE DnD for text/uri-list supportxnoreq2014-01-061-39/+203
| | | | Signed-off-by: Martin Herkt <lachs0r@srsfckn.biz>
* Revert "wayland/egl: use redraw callback"Alexander Preisinger2014-01-042-28/+1
| | | | | | | | | | | 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 workaroundAlexander Preisinger2014-01-041-6/+3
| | | | | | | | 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 codeAlexander Preisinger2014-01-041-1/+1
| | | | I still don't think this is the right approach.
* video/out: remove some code duplication between X11 and waylandwm42014-01-042-45/+4
| | | | | | Both X11 and Wayland support the same format for drag & drop operations (text/uri-list), and the code for that was copied from x11_common.c to wayland_common.c. Factor it out.
* cocoa: handle files drag and drop on the player video viewStefano Pigozzi2014-01-044-1/+29
|
* input: move files drag and drop to a new event.c fileStefano Pigozzi2014-01-043-43/+4
| | | | | event.c will be used to feed the input queue with 'global' events that don't mesh well with the usual check_events path in mpv.
* wayland/egl: misc fixes and cleanupsAlexander Preisinger2014-01-042-6/+1
|
* wayland/egl: use redraw callbackAlexander Preisinger2014-01-042-1/+32
| | | | | | | This solves the issue where we would not receive any frame events. The difference to my earlier tests is that now it looks like eglSwapBuffers uses it's own event queue or something similiar along the lines. Becaues the performance is the same as without any redraw callback.
* wayland/egl: add egl_context to the wayland stateAlexander Preisinger2014-01-042-67/+73
| | | | | | | | | | | At the moment there are visual glitches when we resize the window. This happens because in wayland there a special function for resizing EGL windows. To prevent the glitches move the egl_context to the wayland state in wayland_common.h and add a new control function to gl_wayland.c to wrap the vo_wayland_control function to check for resize events. With the new control wrapper the glitches are gone and the resizing is fluid.
* wayland: Remove nonsense comment and add warningAlexander Preisinger2014-01-041-4/+2
| | | | | | | | | The reason a segmentation happend here was because we couldn't get the requested minor version. The major version is enough for differentiating between OpenGL 3 and OpenGL 2. If it fails there is still a fallback to any version available. Also add a warning if we use the fallback.
* wayland: move workaround to fullscreen codeAlexander Preisinger2014-01-041-4/+5
| | | | | Because of this workaround there was a bug in the wayland vo. Now it works on both vos (opengl and shm) as it should.
* wayland: implement dropping files on the VO windowAlexander Preisinger2014-01-042-2/+190
| | | | Needs some proper testing.
* vo: dropping subtitle files on the VO window adds them as subtitle fileswm42014-01-041-11/+27
| | | | | | | Note that we don't try to be clever about detecting the files as subtitles: we just check the file extension. We could go all the way and check the files by opening them with a demuxer, but that would probably do more bad than good.
* x11: implement dropping files on the VO windowwm42014-01-042-6/+192
| | | | | | | | | | | | | | | | | | | | Drag and drop is pretty complicated (just note how the number of Atoms in use almost doubles), so I'm not sure whether this works everywhere. This has been written by looking at the specification [1] or what looks like the specification, and some external example code [2]. (The latter one has no code license, but we didn't copy any code.) We completely ignore the "requirement" of the spec. that the filename "must" include username and hostname, e.g. "file://user@host/path/file". In theory, this is required because X is network transparent, but at this point the so called network transparency is a complete joke, and Konqueror for one didn't include hostnames in "file://" URIs. Tested with konqueror as drop source. [1] http://www.newplanetsoftware.com/xdnd/ [2] http://www.edwardrosten.com/code/dist/x_clipboard-1.1/paste.cc
* vo: add vo_drop_files()wm42014-01-042-0/+26
| | | | Intended to be used for GUI drag & drop.
* vda: fix build on OS X 10.7Stefano Pigozzi2014-01-022-0/+2
| | | | | Looks like on 10.8 OpenGL.h recursively includes CGLIOSurface.h. That is not the case for 10.7 so the build was broken on that version of OS X.
* wayland/opengl: fix garbage bordersAlexander Preisinger2014-01-022-22/+22
| | | | | It seems mpv draws garbage in those regions. Now we calculate the aspect and let weston draw the black borders.
* wayland/shm: only commit new framesAlexander Preisinger2014-01-021-36/+40
| | | | | Only attach and commit new buffers. This also increases performance when paused.
* wayland: don't change set fullscreen twiceAlexander Preisinger2014-01-021-1/+1
| | | | | Newest weston chrashes if we call set_fullscreen twice. This is a major bug I which I should probably report.
* video: fix --brightness etc. optionswm42013-12-291-11/+0
| | | | They were set before the VO was intitialized, which silently failed.
* vd_lavc: by default, output all frames, even corrupted oneswm42013-12-291-0/+10
| | | | | | | | | | | | | | | | Set the flag CODEC_FLAG_OUTPUT_CORRUPT by default. Note that there is also CODEC_FLAG2_SHOW_ALL, which is older, but this seems to be ffmpeg only. Note that whether you want this enabled depends on the user. Some might prefer that only good frames are output, while others want the decoder to try as hard as possible to output _anything_. Since mplayer/mpv is rather the kind of player that tries hard instead of being "clever", set the new default to override libavcodec's default. A nice way to test this is switching video tracks. Since mpv doesn't wait for the next key frame, it'll start feeding the decoder with a packet from the middle of the stream.
* vo/x11_common: do not select motion events when --no-mouse-movements is setahodesuka2013-12-281-1/+1
|
* Revert "x11: don't set global error handler"wm42013-12-271-0/+28
| | | | | | | | | | | | | This reverts commit 877303aaa9111fc56a8e5edbeb439699acfe44c0. The OpenGL 2.1 fallback for vo_opengl didn't work. Two things come together: 1. trying to create an OpenGL 3.0 context will fail with a GLXBadFBConfig error, and 2. X errors are fatal by default. Since the reverted commit removed the X error handler, the mpv process was killed, instead of continuing for the fallback. (Note that this commit is not an exact inverse commit, since mp_msg changed, but it does about the same thing.)
* Revert "cocoa: unlock on uninit"Stefano Pigozzi2013-12-261-3/+1
| | | | | | Not sure why but this doesn't seem to be needed anymore. This reverts commit 6ead6aa005f1c78a117bde58e48f106cfd1e9806.
* corevideo: fix video initialization when not using VDAStefano Pigozzi2013-12-261-52/+46
| | | | | | | query_format was setting state even if wasn't the correct thing to do. Somehow it worked by pure luck (until commit e6e6b88b6da). Fix the initialization by setting state inside of reconfig.
* build: fix shm detection on OpenBSDStefano Pigozzi2013-12-261-0/+1
| | | | Fixes #427
* cocoa: sanitize window title string and guard against NULLStefano Pigozzi2013-12-251-1/+6
| | | | | | | | | | | If the utf8 string used to create the NSString for title was invalid utf8, -stringWithUTF8String returned nil and triggered an assertion in Cocoa's framework code. Sanitize the utf8 string and if the sanitation wasn't enough just avoid crashing by not setting a title. Fixes #406
* vo_x11/vo_xv: fix build when using --disable-xextStefano Pigozzi2013-12-252-12/+12
|
* vaapi: fix initialization error code pathwm42013-12-231-1/+2
| | | | "res" can be uninitialized in the error case.
* vo_vdpau: fix unintended truncation of 64 bit timestamps to 32 bitwm42013-12-222-2/+2
| | | | | | | |