summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* vo_lavc: mp_msg conversionwm42013-09-201-34/+27
| | | | Also restores consistent log message prefixes with ao_lavc.
* vo/x11_common: don't require a working input methodwm42013-09-201-14/+9
| | | | | | | Normally, we need this for Xutf8LookupString(). But we can just fall back to XLookupString(). In fact, the code for this was already there, the code was just never tested and was actually crashing when active (see commit 2115c4a).
* vf: fix filter initialization error checkwm42013-09-201-1/+1
| | | | | vf_open returns 0 on error, 1 on success. Oops. Accidentally broken with 6629a95.
* vo/x11_common: remove superfluous msg prefixesMartin Herkt2013-09-201-2/+2
|
* vo/x11_common: Fail init with no valid XIMMartin Herkt2013-09-191-0/+9
| | | | | | XOpenIM can fail to find a valid input method, in which case it returns NULL. Passing a NULL pointer to XCreateIC would cause a crash, so fail VO init before that happens.
* wayland/common: exit properly on fd errorsAlexander Preisinger2013-09-191-2/+6
| | | | | | | Before this commit there was just an error message, but the file descriptor was still open. Now we close the file descriptor and prevent it from calling endlessly. Also a CLOSE_WIN event is sent which closes the window eventually if the action of CLOSE_WIN is set to quit or quit_watch_later.
* vo_opengl: blend alpha components by defaultwm42013-09-194-6/+15
| | | | | | Improves display of images and video with alpha channel, especially if the transparent regions contain (supposed to be invisible) garbage color values.
* cocoa_common: signal a mouse movement when changing window sizeStefano Pigozzi2013-09-181-0/+8
| | | | | | | | | This is mainly to avoid spurious cursor states due to the mouse moving inside or outside the window as a result of the window resize (with cmd-0/1/2). This avoids complex logic and triggers a mouse move so that the player recomputes the correct cursor state based on the autohide configuration of the user.
* cocoa_common: override core's cursor visibility stateStefano Pigozzi2013-09-181-3/+5
| | | | | | | This keeps the state in sync with the current state in cocoa_common. Infact the cocoa code in mpv can decide wether it really wants to hide the cursor based on the result of the `canHideCursor` method (this is so that the cursor is only hidden when hovering on the video window).
* gl_common: add wayland backend before x11 backendAndreas Sinz2013-09-161-3/+5
|
* gl_common: signal to GL backend whether we are probingwm42013-09-164-7/+16
| | | | | | | | | | | This is supposed to reduce the amount of useless error messages shown during initialization of vo_opengl. If multiple backends are compiled, usually only one of them will work. For example, on Linux both X and Wayland backends can be compiled, but usually either Wayland or X is running. Then, if Wayland is not running, but X is, trying to initialize the Wayland backend should not spam the terminal with error messages. Signed-off-by: Andreas Sinz <andreas.sinz@aon.at>
* vd_lavc: reset last_sample_aspect_ratio in uninit_avctx()xylosper2013-09-131-0/+1
| | | | | | | | In init_vo(), if sh->aspect is 0 or last_sample_aspect_ratio is set, sh->aspect is overwritten. With software decoding fallback behaviour, this makes the aspect ratio from container ignored since last_sample_aspect_ratio is already set in first try with hardware decoding.
* core: add --deinterlace option, restore it with resume functionalitywm42013-09-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The --deinterlace option does on playback start what the "deinterlace" property normally does at runtime. You could do this before by using the --vf option or by messing with the vo_vdpau default options, but this new option is supposed to be a "foolproof" way. The main motivation for adding this is so that the deinterlace property can be restored when using the video resume functionality (quit_watch_later command). Implementation-wise, this is a bit messy. The video chain is rebuilt in mpcodecs_reconfig_vo(), where we don't have access to MPContext, so the usual mechanism for enabling deinterlacing can't be used. Further, mpcodecs_reconfig_vo() is called by the video decoder, which doesn't have access to MPContext either. Moving this call to mplayer.c isn't currently possible either (see below). So we just do this before frames are filtered, which potentially means setting the deinterlacing every frame. Fortunately, setting deinterlacing is stable and idempotent, so this is hopefully not a problem. We also add a counter that is incremented on each reconfig to reduce the amount of additional work per frame to nearly zero. The reason we can't move mpcodecs_reconfig_vo() to mplayer.c is because of hardware decoding: we need to check whether the video chain works before we decide that we can use hardware decoding. Changing it so that this can be decided in advance without building a filter chain sounds like a good idea and should be done, but we aren't there yet.
* wayland/shm: fix resizing for good (finally)Alexander Preisinger2013-09-121-7/+45
| | | | | | Problem: I own the buffer and I destroyed while still being displayed. Solution: Add a temporary buffer and destroy it when the next buffer is attached.
* wayland: change fs messages to dbgAlexander Preisinger2013-09-121-2/+2
| | | | These messages are only helpful when debugging.
* wayland/egl: use wayland logAlexander Preisinger2013-09-121-10/+7
|
* wayland/shm: use wayland logAlexander Preisinger2013-09-121-11/+11
|
* Revert "wayland: don't create our own log context"Alexander Preisinger2013-09-123-13/+18
| | | | | | | This reverts commit beab54506e61bc080880e827e351439f76542e68. Conflicts: video/out/wayland_common.c
* gl_osd: mp_msg conversionwm42013-09-125-10/+11
|
* aspect: mp_msg conversionwm42013-09-121-6/+5
|
* gl_lcms: mp_msg conversionwm42013-09-123-11/+22
| | | | | Have to deal with some dumb stuff in LittleCMS2's API: its error handler is global.
* gl_common: complete mp_msg conversionwm42013-09-127-42/+42
| | | | Hopefully this works on Wayland and Cocoa, which I didn't test.
* x11_common: mp_msg conversionwm42013-09-122-40/+38
| | | | | Doesn't touch some parts, like the X11 error handler (which doesn't allow setting a context pointer).
* gl_32: mp_msg conversionAlexander Preisinger2013-09-111-9/+7
|
* w32_common: mp_msg conversionAlexander Preisinger2013-09-111-14/+12
|
* gl_x11: mp_msg conversionAlexander Preisinger2013-09-111-12/+10
|
* cocoa_common: remove most of the special handling for cursor autohideStefano Pigozzi2013-09-101-17/+3
| | | | | | | | | | | | | | | This is mostly related to the fullscreen behaviour. cecbd8864 introduces an option to make mpv behave like a OSX user would expect. This commit changes the Cocoa parts of the code to be consistent with the behaviour on X11. Old behaviour is still available through the option mentioned in cecbd8864. There is still custom logic in the cocoa backend and it can probably be moved to core: * Don't perform autohide if the mouse is down * Don't perform autohide outside of the video window Fixes #218 (by accident)
* wayland/common: improved error messagesAlexander Preisinger2013-09-101-4/+8
| | | | | The previous error message were not very usefull. Also include a hint where to look for solutions.
* wayland: update license headersAlexander Preisinger2013-09-093-23/+16
|
* wayland/shm: version detection that also worksAlexander Preisinger2013-09-091-3/+8
| | | | The previous method would break on the next release. Because I am stupid.
* options: remove --(no-)mouseinput optionwm42013-09-083-4/+4
| | | | I have no idea why it exists, as it's redundant to --(no-)mouse-movements.
* x11_common: don't allocate more than needed for iconwm42013-09-041-3/+4
| | | | | | | | | icon_size is the number of array items of type long, not bytes. Change the type of icon_size to int, because size_t makes you think of byte quantities too quickly. As an unrelated change, change the (char *) cast to (unsigned char *), because it matches the common XChangeProperty idiom better.
* configure: build with wayland 1.2.0Alexander Preisinger2013-09-031-0/+5
| | | | | For the time being there will be a check if someone uses wayland from git, because I really really like to have the others formats too.
* cocoa_common: remove unlocking from fullscreen functionStefano Pigozzi2013-09-021-12/+0
| | | | | This was added in the past to prevent a deadlock, but is not needed anymore.
* cocoa_common: avoid the opengl view to leak it's stateStefano Pigozzi2013-09-021-7/+13
| | | | | Just because everything is in a single file it doesn't excuse us to have high coupling between C and ObjC code.
* x11: add window iconwm42013-09-013-0/+105
| | | | | | | | | | | | | | | | | | | | | The png file added to etc/ are taken from the link mentioned in commit 303096b, except that they have been converted to 16 bit, sRGB (with color profile info dropped, if there was one), and transparent pixels reset for better compression. The file x11_icon.bin is generated by gen-x11-icon.sh. I'm adding it to the git repo directly, because the script requires ImageMagick, and we don't want to make building even more complicated. The way how this is done is basically a compromise between effort required in x11_common.c and in gen-x11-icon.sh. Ideally, x11_icon.bin would be directly in the format as required by _NET_WM_ICON, but trying to write the binary width/height values from shell would probably be a nightmare, so here we go. The zlib code in x11_common.c is lifted from demux_mkv.c, with some modifications (like accepting a gzip header, because I don't know how to make gzip write raw compressed data).
* input: deal with spurious X11 LeaveNotify eventswm42013-09-013-4/+21
| | | | | | | | | | | | | | | | | | | | | If the mpv window is unfocus, clicking on the OSC should focus the window (done by the window manager) and allow interaction with the OSC. But somehow X sends a spurious LeaveNotify event, immediately followed by an EnterNotify event. This happens at least with IceWM. The result is that the OSC will disappear (due to receiving MOUSE_LEAVE). The OSC will stay invisible, because EnterNotify isn't handled, and there's nothing that could make the OSC appear again. Solve this by handling EnterNotify. We cause a redundant MOUSE_MOVE event to be sent, which triggers the code to make the OSC visible. We have to remove the code from input.c, which ignores redundant mouse move events. Since the code ignoring redundant mouse move events is still needed on Windows, move that code to w32_common.c. The need for this is documented in the code, also see commit 03fd2fe. (The original idea was to save some code by having this code in the core, but now it turns out that this didn't quite work out.)
* input: add some more X11 multimedia/internet keyswm42013-09-011-0/+3
| | | | | | | | These keys can be found on various "multimedia" and "internet" keyboard. X defines many keycodes, so I'm not adding all, just what I found on my own keyboard. Other key codes can be added on request.
* cocoa_common: enable click-through on the video viewStefano Pigozzi2013-09-011-0/+1
| | | | | | Generate a mouse down event on the first click so that one can interact with the OSC directly as opposed to wasting the first click in order to focus the window.
* cocoa_common: track mouse move events when not focusedStefano Pigozzi2013-09-011-1/+1
| | | | | This is really only important with the OSC and makes the tracking code behave more consistently with the X11 one.
* video: add unscaled mode with --video-unscaledwm42013-09-011-3/+17
|
* gl_video: don't crash if no FBOs are availablewm42013-08-281-4/+6
| | | | | | | | This probably has been broken since bbc865a: a test was added that uses a FBO, but it's always run, even if FBOs were not detected. On the other hand, fbotex_init() just runs into an assert. Fix the test that triggered this condition, and make fbotex_init() "nicer" by just failing if FBOs are not available.
* wayland/shm: rework format handlingAlexander Preisinger2013-08-261-47/+76
| | | | Use a linked list for all supported formats and make the format table const.
* wayland: fix memory leaksAlexander Preisinger2013-08-262-2/+8
|
* cocoa_common: autohide dock when autohiding menubarStefano Pigozzi2013-08-261-1/+5
| | | | A cocoa bug doesn't allow to do otherwise. Will open a radar later.
* wayland: don't create our own log contextAlexander Preisinger2013-08-263-19/+14
| | | | This was more problematic than useful ([vo/wayland/wayland])
* wayland/shm: use opaque regionsAlexander Preisinger2013-08-261-0/+10
| | | | | | Make use of opaque regions on non-alpha formats. This allows the compositor to improve the drawing of the surface, because he can discard everything behind the window when drawing.
* gl_video: fix odd video sizes with PBOswm42013-08-261-0/+4
| | | | | | | | | Odd video sizes if pixel formats with chroma subsampling and PBOs were used, garbage was rendered. This was because the PBO path created buffers with an unpadded size, and then tried to upload a padded image to it. Fix it by explicitly setting the padded size. (As with the non-PBO path, we rely that image allocations are somehow padded, which is normally the case.)
* wayland: shm based software renderingAlexander Preisinger2013-08-252-0/+649
| | | | | | | | | | | | | | | | | | | | A wayland output based on shared memory. This video output is useful for x11 free systems, because the current libGL in mesa provides GLX symbols. It is also useful for embedded systems where the wayland backend for EGL is not implemented like the raspberry pi. At the moment only rgb formats are supported, because there is still no compositor which supports planar formats like yuv420p. The most used compositor at the moment, weston, supports only BGR0, BGRA and BGR16 (565). The BGR16 format is the fastest to convert and render without any noticeable differences to the BGR32 formats. For this reason the current (very basic) auto-detection code will prefer the BGR16 format. Also the weston source code indicates that the preferred format is BGR16 (RGB565). There are 2 options: * default-format (yes|no) Which uses the BGR32 format * alpha (yes|no) For outputting images and videos with transparencies
* wayland: remove shm listener for the backendAlexander Preisinger2013-08-252-16/+0
| | | | | | The obtained information from the shm listener isn't used by anything and is also wrong now in wayland git master branch because of new shm formats which need a different way of saving the supported formats.
* wayland/egl: rework resizing (again)Alexander Preisinger2013-08-253-88/+90
| | | | | | | | | Moves a good chunk of the resizing code to wayland_common.c. This makes it possible to share it with future video drivers. It doesn't resizit it immediatly, it calcutlates the new position and size and then shedules a resizing event. This removes the ugly callback and void pointer from the wayland data structure.
* vo_corevideo: use dwidth/dheight for window dimensionsStefano Pigozzi2013-08-251-1/+1
| | | | | In the previous commit I wrongly used params->d_h/d_w which happened to work by chance.
* vo_corevideo: convert to use reconfig instead of configStefano Pigozzi2013-08-251-7/+6
|
* vo_corevideo: don't set colormatrix on direct rendering pathStefano Pigozzi2013-08-251-23/+49
| | | | | | | | | | | The current code uses GL_YCBCR_422_APPLE texture format. This allows to handle transparently the conversion to RGB but always use BT.601 colormatrix [1]. Hopefully I can adapt gl_video to take CVPixelBuffers soon so that `vo=opengl` can be used instead of `vo=corevideo` with `hwdec=vda` [1]: http://www.opengl.org/registry/specs/APPLE/ycbcr_422.txt http://www.opengl.org/registry/specs/APPLE/rgb_422.txt
* vo_corevideo: fix regression in colormatrix handlingStefano Pigozzi2013-08-251-40/+22
| | | | | | | | | | Regression since 18b6c01d92. That commit changed the colorspace handling to always reinit the video output. Since the CVPixelBuffers are lazily created, VOCTRL_SET_YUV_COLORSPACE was always called when the CVPixelBufferRef was NULL. Since CoreVideo functions do not complain when called on NULL, no one noticed that CVBufferSetAttachment, which stored the color matrix meta data was called on NULL.
* video: handle video output levels with mp_image_paramswm42013-08-2412-60/+24
| | | | | | | | | | | | Until now, video output levels (obscure feature, like using TV screens that require RGB output in limited range, similar to YUY) still required handling of VOCTRL_SET_YUV_COLORSPACE. Simplify this, and use the new mp_image_params code. This gets rid of some code. VOCTRL_SET_YUV_COLORSPACE is not needed at all anymore in VOs that use the reconfig callback. The result of VOCTRL_GET_YUV_COLORSPACE is now used only used for the colormatrix related properties (basically, for display on OSD). For other VOs, VOCTRL_SET_YUV_COLORSPACE will be sent only once after config instead of twice.
* vo_image: simplifywm42013-08-241-28/+2
|
* video/out: don't require VOs to handle screenshot aspect speciallywm42013-08-245-11/+4
| | | | | | | | | | | | | | | | This affects VOs which just reuse the mp_image from draw_image() to return screenshots. The aspect of these images is never different from the aspect the screenshots should be, so there's no reason to adjust the aspect in these cases. Other VOs still need it in order to restore the original image attributes. This requires some changes to the video filter code to make sure that the aspect in the passed mp_images is consistent. The changes in mplayer.c and vd_lavc.c are (probably) not strictly needed for this commit, but contribute to consistency.
* vo_vaapi: potentially fix screenshot colorspace issueswm42013-08-241-0/+1
| | | | | | mp_image_set_params() doesn't check whether the colorspace parameters are consistent (e.g. setting YUV colorspaces with RGB formats), and shouldn't need to.
* Some more mp_msg conversionswm42013-08-236-214/+179
| | | | | Also add a note to mp_msg.h, since it might be not clear which of the two mechanisms is preferred.
* x11/out: mp_msg conversionAlexander Preisinger2013-08-231-29/+21
|
* cocoa_common: avoid locking calls when not neededStefano Pigozzi2013-08-231-2/+2
| | | | | | | | | | cocoa_common contains some locking calls to support video outputs that support live resizing (at this moment only vo=opengl). These should not be used unless the VO declares it is multithreaded by registering the resize_redraw callback used for live resizing. Fixes #200
* video: add vda decode support (with hwaccel) and direct renderingStefano Pigozzi2013-08-226-112/+541
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Decoding H264 using Video Decode Acceleration used the custom 'vda_h264_dec' decoder in FFmpeg. The Good: This new implementation has some advantages over the previous one: - It works with Libav: vda_h264_dec never got into Libav since they prefer client applications to use the hwaccel API. - It is way more efficient: in my tests this implementation yields a reduction of CPU usage of roughly ~50% compared to using `vda_h264_dec` and ~65-75% compared to h264 software decoding. This is mainly because `vo_corevideo` was adapted to perform direct rendering of the `CVPixelBufferRefs` created by the Video Decode Acceleration API Framework. The Bad: - `vo_corevideo` is required to use VDA decoding acceleration. - only works with versions of ffmpeg/libav new enough (needs reference refcounting). That is FFmpeg 2.0+ and Libav's git master currently. The Ugly: VDA was hardcoded to use UYVY (2vuy) for the uploaded video texture. One one end this makes the code simple since Apple's OpenGL implementation actually supports this out of the box. It would be nice to support other output image formats and choose the best format depending on the input, or at least making it configurable. My tests indicate that CPU usage actually increases with a 420p IMGFMT output which is not what I would have expected. NOTE: There is a small memory leak with old versions of FFmpeg and with Libav since the CVPixelBufferRef is not automatically released when the AVFrame is deallocated. This can cause leaks inside libavcodec for decoded frames that are discarded before mpv wraps them inside a refcounted mp_image (this only happens on seeks). For frames that enter mpv's refcounting facilities, this is not a problem since we rewrap the CVPixelBufferRef in our mp_image that properly forwards CVPixelBufferRetain/CvPixelBufferRelease calls to the underying CVPixelBufferRef. So, for FFmpeg use something more recent than `b3d63995` for Libav the patch was posted to the dev ML in July and in review since, apparently, the proposed fix is rather hacky.
* cocoa_common: fix window positioning with `--geometry`Stefano Pigozzi2013-08-221-10/+5
| | |