summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* gl_video: don't crash if no FBOs are availablewm42013-08-291-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.
* cocoa_common: autohide dock when autohiding menubarStefano Pigozzi2013-08-291-1/+5
| | | | A cocoa bug doesn't allow to do otherwise. Will open a radar later.
* gl_video: fix odd video sizes with PBOswm42013-08-291-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.)
* 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
* cocoa_common: fix window positioning with `--geometry`Stefano Pigozzi2013-08-221-10/+5
| | | | | | | | | | | Regression since ff3b98d11c. The window positioning code relied on the visibleFrame's height without taking into account the dock's presence. Also moved the constraining code to the proper method that overrides the original NSWindow behaviour. This avoids having to check for border since the constraining is performed by Cocoa only for titled windows. Fixes #190
* vf_eq: fix behavior when changing parameterswm42013-08-221-4/+14
| | | | | | | | | | | | | | | Using -vf eq and changing brightness, contrast, etc. using key bindings with e.g. "add brightness 1" didn't work well: with step width 1, the property gets easily "stuck". This is a rounding problem: e.g. setting gamma to 3 would actually make it report that gamma is set to 2, so the "add" command will obviously never reach 3 with a step width of 1. Fix this by storing the parameters as integers. This was broken in cac7702. This commit effectively changed these properties to use the value as reported by vf_eq, instead of the previously set value for the "add" command. This was more robust, but not very correct either, so we keep the new behavior and make vf_eq report its parameters more accurately.
* vdpau: don't try to match codec profileswm42013-08-191-23/+8
| | | | | | | | | | | | | | | | | | | Instead, do what MPlayer did all these years. It worked for them, so there's probably no reason to change this. Apparently fixes playback with some files, where the VDPAU decoder does not formally support a profile, but decoding works with a more powerful profile anyway. Though note that MPlayer did this because it couldn't do it in a better way (no decoder reported profiles available when creating the VDPAU decoder), so it's not entirely clear whether this is a good idea. An alterbative implementation might try to map the profiles exactly, and do some fall backs if the exact profile is not available. But this hack-solution works too. Conflicts: video/decode/vdpau.c
* vo_vdpau: fix screenshots if panscan is usedwm42013-08-181-4/+5
| | | | | | | When panscan was used, i.e. the video is cropped to make the video fill the screen if video and screen aspects don't match, screenshots contained only the visible region of the source video, stretched to original video size.
* vdpau: fix compilation on Libavwm42013-08-151-0/+1
| | | | | | Libav's <libavcodec/vdpau.h> header uses some libavocdec symbols without forward-declaring them and without including the headers declaring them. FFmpeg's header for this is fine.
* x11: fix --ontopwm42013-08-151-3/+3
| | | | Apply it after mapping.
* x11_common: get hack for Motif Window Manager out of the waywm42013-08-111-1/+11
| | | | | | | | Disable the hack by default, because it's interfering with some more modern WMs. MWM (Motif Window Manager) is probably pretty dead, but we still allow enabling the old hack with "--fstype=mwm_hack". See github issue #179.
* vo: unref waiting image before destroying VO driverwm42013-08-111-1/+1
| | | | | | | | This is in theory more correct with respect to hardware decoding. With hardware decoding, the VOs play the role of the video surface allocator, and nothing is allowed to reference surfaces past the VO lifetime. But in theory waiting_mpi could be a reference to a HW video surface, so it should be relased before the VO is uninitialized.
* wayland: add support for precise scrollingAlexander Preisinger2013-08-071-2/+14
| | | | | | | | The default value for a standard mouse is 10.0. Because we don't want to multiply the value in the input config file we scale it down to 1.0. Hopefully this should work for more precise mousewheels or touchpad, but I don't have access to such hardware.
* core: move contents to mpvcore (2/2)Stefano Pigozzi2013-08-0667-161/+161
| | | | Followup commit. Fixes all the files references.
* gl_video: handle non-mod-2 4:2:0 YUV video correctlywm42013-08-062-2/+14
| | | | | | | | | | | | | | | | Allocate textures big enough to include the bottom/right borders (so the chroma texture sizes are rounded up instead of down). Make the texture large enough to include the additional luma border. Conceptually, we pretend that the video frame is fully aligned, and then crop away the unwanted borders. Filtering (even just bilinear) will access the borders anyway, so it's possible that we might need to switch to "harder" cropping instead, but at least pixels not close to the border should be displayed correctly now. Add a comment to mp_image.c about this luma border. These semantics are kind of subtle, and the image allocation code handle this in a subtle way too, so it's better to document this explicitly. The libavutil image allocation code does similar things.
* vo_corevideo: use new log APIStefano Pigozzi2013-08-011-15/+5
| | | | | Also removes the printing of the OpenGL info when using verbose mode since gl_common already does that.
* vo_corevideo: move to C from Objective-CStefano Pigozzi2013-08-012-41/+11
| | | | | This file was alredy written in C. The only remaining part was the file exension and `#import`s.
* cocoa_common: use new log APIStefano Pigozzi2013-08-011-7/+11
|
* wayland: switch to the new mp_msg apiAlexander Preisinger2013-07-313-8/+23
|
* video/out: use new mp_msg stuff for vo.c and vo_openglwm42013-07-317-82/+96
| | | | The first step; also serves as example.
* options: handle presets directly in m_configwm42013-07-311-4/+2
| | | | | This means that "mpv -vo opengl-hq:help" will actually show the correct defaults, instead those of plain vo_opengl.
* cocoa_common: simplify resize codeStefano Pigozzi2013-07-301-51/+16
| | | | | | | | | | This introduces some changes in resize behaviour. Most importantly the window frame is not constrained to it's screen's `visibleFrame`. Anyone who still wants that kind of behaviour when opening a video, can use `--autofit-larger`. Even though the size of the window is not constrained, it's position is, so that the titlebar will always be visible. When using `--no-border` even the position will not be constrained in any way.
* vd_lavc: print warning if hardware decoding API is not availablewm42013-07-301-0/+3
| | | | | At least currently, this case pretty much happens only in the case vdpau is requested, but not compiled in.
* vd_lavc: fix CONFIG_VDPAU checkwm42013-07-301-1/+1
| | | | | | CONFIG_VDPAU was just defined to 0, instead of undefined when vdpau was unavailable. I blame the old mplayer code, which apparently can't have consistent conventions.
* build: fix build with vdpau, simplifywm42013-07-293-2/+43
| | | | | | | | | | | | Instead of generating vdpau_template.c with a Perl script, just include the generated file in git. This is ok because it changes very rarely, and the script is larger than the output it generates. It also simplify the Makefile, and fixes the build. The problem was that transitive dependencies do not work with generated files: there is no dependency information yet when building it the first time. I overlooked this because I didn't delete the .d files for testing (which contained the correct dependencies, but only _after_ a first successful build).
* vdpau: split off decoder parts, use "new" libavcodec vdpau hwaccel APIwm42013-07-2815-315/+866
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the decoder parts from vo_vdpau.c to a new file vdpau_old.c. This file is named so because because it's written against the "old" libavcodec vdpau pseudo-decoder (e.g. "h264_vdpau"). Add support for the "new" libavcodec vdpau support. This was recently added and replaces the "old" vdpau parts. (In fact, Libav is about to deprecate and remove the "old" API without deprecation grace period, so we have to support it now. Moreover, there will probably be no Libav release which supports both, so the transition is even less smooth than we could hope, and we have to support both the old and new API.) Whether the old or new API is used is checked by a configure test: if the new API is found, it is used, otherwise the old API is assumed. Some details might be handled differently. Especially display preemption is a bit problematic with the "new" libavcodec vdpau support: it wants to keep a pointer to a specific vdpau API function (which can be driver specific, because preemption might switch drivers). Also, surface IDs are now directly stored in AVFrames (and mp_images), so they can't be forced to VDP_INVALID_HANDLE on preemption. (This changes even with older libavcodec versions, because mp_image always uses the newer representation to make vo_vdpau.c simpler.) Decoder initialization in the new code tries to deal with codec profiles, while the old code always uses the highest profile per codec. Surface allocation changes. Since the decoder won't call config() in vo_vdpau.c on video size change anymore, we allow allocating surfaces of arbitrary size instead of locking it to what the VO was configured. The non-hwdec code also has slightly different allocation behavior now. Enabling the old vdpau special decoders via e.g. --vd=lavc:h264_vdpau doesn't work anymore (a warning suggesting the --hwdec option is printed instead).
* lavc_dr1: make reference counting thread-safewm42013-07-281-4/+39
| | | | | | | | See previous commits. This time, the lock is kept for rather long times (e.g. for the duration of a big image memory allocation), but this (probably) still doesn't matter at all. This also affects legacy code only (pre-refcounting libavcodec).
* mp_image_pool: make reference counting thread-safewm42013-07-282-40/+70
| | | | | | | | See previous commits. Also simplify this thing: 2 flags per pool image are enough to avoid a weird central refcount and an associated shared object keeping the refcount. We could even just store these two flags in the mp_image itself (like in mp_image.flags or mp_image.priv), but let's not for the sake of readability.
* mp_image: make reference counting thread-safewm42013-07-281-3/+27
| | | | | | | | | | This hasn't been done yet, because pthreads is still an optional dependency, so this is a bit annoying. Now doing it anyway, because maybe we will need this capability in the future. We keep it as simple as possible. We (probably) don't need anything more sophisticated, and keeping it simple avoids introducing weird bugs. So, no atomic instructions, no fine grained locks, no cleverness.
* m_config: refactor some thingswm42013-07-281-6/+6
| | | | | | | | | | | | | | Change how m_config is initialized. Make it more uniform; now all m_config structs are intialized in exactly the same way. Make sure there's only a single m_option[] array defining the options, and keep around the pointer to the optstruct default value, and the optstruct size as well. This will allow reconstructing the option default values in the following commit. In particular, stop pretending that the handling of some special options (like --profile, --v, and some others) is in any way elegant, and make them explicit hacks. This is really more readable and easier to understand than what was before, and simplifies the code.
* mp_image: pass through colorspace info to libavfilterwm42013-07-281-0/+8
| | | | | | | | | | | | | This change affects vf_lavfi. Until recently, libavfilter was not colorspace aware at all. This changed with the addition of colorspace fields to AVFrame. libavfilter's vf_scale picks them up (as of recent ffmpeg git). Since this support is still kind of wonky and not part of the normal format negotiation, this won't set the correct output colorspace, though. Not adding a separate test for HAVE_AVFRAME_COLORSPACE. This is slightly unclean, but on the other hand adding an explicit test seems like a waste of effort.
* vf: fix unintended overwriting of image infowm42013-07-282-4/+5
| | | | | | The symptom was that "-vf scale,format=rgba" broke the vsfilter colorspace hack in sd_ass. vf->reconfig is allowed to overwrite its input parameter for convenience (maybe that was a bad idea).
* gl_video: make sure image parameters are correctly set on screenshotswm42013-07-261-7/+8
| | | | Makes sure the chroma_location doesn't get lost.
* video: support setting libswscale chroma positionwm42013-07-255-1/+29
|
* w32_common: Don't use globals for TRACKMOUSEEVENTDiogo Franco (Kovensky)2013-07-252-11/+12
| | | | It seems working on getch2 gave me some brain damage.
* w32_common: Track when the mouse leaves the windowDiogo Franco (Kovensky)2013-07-251-0/+15
| | | | | | | | | Windows doesn't send WM_MOUSELEAVE by default unless you ask it to; request tracking for leave events when the mouse enters the window (or is moved). Tracking is automatically de-activated once the mouse leaves the window, so we have to re-request it every time the mouse re-enters the window.
* mp_image: create AVBuffers for all planes when converting to AVFramewm42013-07-241-1/+9
| | | | | | | | | | | | | | | | It appears the API requires you to cover all plane data with AVBuffers (that is, one AVBuffer per plane in the most general case), because certain code can make certain assumptions about this. (Insert rant about how this is barely useful and increases complexity and potential bugs.) I don't know any cases where the current code actually fails, but we want to follow the API, so do it anyway. Note that we don't really know whether or not planes are from a single memory allocation, so we have to assume the most general case and create an AVBuffer for each plane. We simply assume that the data is padded to the full stride in the last image line. All these extra dummy references are stupid, but the code might become much simpler once we only support libavcodec versions with refcounting and can use AVFrame directly.
* Fix some -Wshadow warningswm42013-07-2312-34/+29
| | | | | | In general, this warning can hint to actual bugs. We don't enable it yet, because it would conflict with some unmerged code, and we should check with clang too (this commit was done by testing with gcc).
* options: make legacy hacks for AFs/VFs more explicitwm42013-07-221-0/+1
| | | | | This means that AOs/VOs with no options set do not take the legacy option parsing path, but instead report that they have no options.
* video/out: remove options argument from preinit()wm42013-07-2214-26/+16
| | | | | All VOs use proper option parsing now, and compatibility hacks are not needed.
* Remove subopt-helperwm42013-07-224-5/+2
| | | | Finally not used by anything anymore. Farewell.
* vf_scale: actually respect param and param2 suboptionswm42013-07-223-0/+8
| | | | This was forgotten in commit b81f5e2.
* vo_opengl: some option changeswm42013-07-222-1/+21
| | | | | | Doing "mpv --vo=opengl:lscale=help" now lists possible scalers and exits. The "backend" suboption behaves similar. Make the "stereo" suboption a choice, instead of using magic integer values.
* vo_direct3d: use new option APIwm42013-07-221-85/+34
|
* vo_opengl_old: use new option APIwm42013-07-224-167/+64
|
* options: move --colorkey option to vo_xvwm42013-07-221-3/+8
|
* vo_xv: use new option APIwm42013-07-221-84/+25
|
* vo_direct3d: fix warning on MinGWwm42013-07-221-5/+0
| | | | | | Commit 6ab2eeb attempted to fix it on Cygwin, but now it broke on MinGW in turn. Don't think too hard about it and just remove the code. (vo.c already prints the video rectangle anyway.)
* options: hide encoding AO/VO in help outputwm42013-07-211-0/+1
| | | | | These can't be used manually. Encoding is enabled with -o instead, and the encoding AO/VO is selected using internal mechanisms.
* options: use new code for parsing --vowm42013-07-213-143/+77
| | | | | | | | | Nothing should change from user perspective. mpv --vo=opengl:help now works. Remove the vo_opengl inline help text. The new code can list option names for you, but that's it. Refer to the manpage if you have trouble.
* options: use m_config for options instead of m_structwm42013-07-2114-252/+179
| | | | | | | | | | | | | | | | | | For some reason, both m_config and m_struct are somewhat similar, except that m_config is much more powerful. m_config is used for VOs and some other things, so to unify them. We plan to kick out m_struct and use m_config for everything. (Unfortunately, m_config is also a bit more bloated, so this commit isn't all that great, but it will allow to reduce the option parser mess somewhat.) This commit also switches all video filters to use the option macros. One reason is that m_struct and m_config, even though they both use m_option, store the offsets of the option fields differently (sigh...), meaning the options defined for either are incompatible. It's easier to switch everything in one go. This commit will allow using the -vf option parser for other things, like VOs and AOs.
* vf: remove unnecessary indirectionwm42013-07-212-26/+5
|
* cocoa_common: fix regression in draggable state computationStefano Pigozzi2013-07-211-0/+1
| | | | Regression introduced in 8fb064de5. Prevented the OSC from working correctly.
* cocoa_common: fix styleStefano Pigozzi2013-07-211-2/+2
|
* cocoa_common: move tracking area setup to updateTrackingAreasStefano Pigozzi2013-07-211-14/+13
| | | | This makes the tracking area work when going in and out of fullscreen.
* x11: add key modifiers to mouse button eventswm42013-07-211-13/+19
|
* w32_common: show the cursor in the window borderJames Ross-Gowan2013-07-212-6/+22
| | | | | | | | | | | | | | | | | | When the cursor was in the window border, it could be hidden but it wouldn't appear again, since mpv doesn't process mouse input there. The code used ShowCursor, which is a horrid stateful API designed for mouseless Win16 systems that incremented or decremented a global counter to keep track of how many applications needed to display a special cursor (like a busy cursor.) Replace that with a simple flag, handle WM_SETCURSOR and use SetCursor(NULL) to hide the mouse cursor, but only when the mouse is in the client area. DefWindowProc will set the correct cursor on the border as long as it isn't hidden with ShowCursor. PowerPoint also uses SetCursor(NULL) to hide the cursor when showing a presentation, so it's probably safe. See http://blogs.msdn.com/b/oldnewthing/archive/2009/12/17/9937972.aspx
* cocoa_common: handle keyboard modifiers for mouse eventsStefano Pigozzi2013-07-211-47/+51
|
* Merge remote-tracking branch 'michaelforney/master'Alexander Preisinger2013-07-201-2/+11
|\
| * wayland: Fallback to any GL version if 3.0 is not supportedMichael Forney2013-07-191-2/+11
| | | | | | | | This fixes playback on Wayland with older GPUs.
* | cocoa_common: make the fullscreen transition only when necessaryStefano Pigozzi2013-07-201-5/+16
| | | | | | | | | | This makes the cocoa backend follow more closely the new fullscreen semantics added in c4b08a9a.
* | cocoa_common: use a tracking area to handle mouse eventsStefano Pigozzi2013-07-201-33/+52
|