aboutsummaryrefslogtreecommitdiffhomepage
path: root/video
Commit message (Collapse)AuthorAge
* cocoa: allow to embed into an arbitrary NSViewGravatar Stefano Pigozzi2014-10-08
| | | | | Basically add if guards on all the problematic features. I'm still thinking about a better way to handle this, but for the time being, this will do.
* vf_lavfi: fix compilation failureGravatar wm42014-10-08
| | | | | | Apparently this fails to compile with clang6. Patch by someone else. CC: @mpv-player/stable
* x11: disable various features when embedding the windowGravatar wm42014-10-07
|
* cocoa: try to fix sizing bugs on retina displaysGravatar Stefano Pigozzi2014-10-06
| | | | untested, no hardware.
* cocoa: fix mouse autohideGravatar Stefano Pigozzi2014-10-05
| | | | broken in 547b62f
* cocoa: remove a debug commentoGravatar Stefano Pigozzi2014-10-05
| | | | fixup previous commit
* cocoa: separate video view and events viewGravatar Stefano Pigozzi2014-10-05
|
* cocoa: fix fullscreen with bundleGravatar Stefano Pigozzi2014-10-05
|
* cocoa: readd some function callsGravatar Stefano Pigozzi2014-10-05
|
* cocoa: actually reset the event flagsGravatar Stefano Pigozzi2014-10-05
|
* cocoa: remove some useless flagsGravatar Stefano Pigozzi2014-10-05
|
* cocoa: disable some features when embedding in another windowGravatar Stefano Pigozzi2014-10-05
| | | | ontop, fullscreen and window title change to be precise
* cocoa: remove --fs-missioncontrolGravatar Stefano Pigozzi2014-10-05
| | | | | | | This is the first of a series of commits that will change the Cocoa way in a way that is easily embeddable inside parent views. To reach that point common code must avoid referencing the parent NSWindow since that could be the host application's window.
* cocoa: fix some pointer casts to be 32bit safeGravatar Stefano Pigozzi2014-10-05
| | | | credits: wm4
* cocoa/libmpv: allow to embed mpv GL view in another windowGravatar Stefano Pigozzi2014-10-05
| | | | | | | | | | | | | | | | | | | This is just temporary code but is a good base for future work (and baby steps are required for these changes). The 'final destination' is embedding the video view into any NSView but that requires some more work (the mechanism will be the same: pass the view's pointer casted to int64_t through -wid). For instance we will need to remove as much usage of the window instance as possible, and use nil guards where not possible. For this reason I will remove stuff like the mission control fullscreen feature (it's a cute feature but annoying to support and quite limited, go make your GUIs), and a way to lookup the current screen directly from the NSView absolute coordinates (this is needed for ICC detection mostly, and reporting back the screen to mpv's core). Moreover the current view.m will need to be separated into 2 views: the actual video view that will be embedded, and a parent view that will not be embedded and will be responsibile for tracking events.
* cocoa: simplify the config code and run it on the main threadGravatar Stefano Pigozzi2014-10-05
| | | | | | This could be dangerous because we initialize the window asynchronously and return immediately from config, but since the OpenGL context is already created, this seems to work correctly and doesn't cause weird deadlock cases.
* options: add --no-keepaspect-windowGravatar wm42014-10-04
| | | | Seems silly, but was requested.
* cocoa: don't reset presentation options on uninitGravatar Stefano Pigozzi2014-10-04
| | | | | | This doesn't look to be needed anymore. Fullscreening with both the NSView and the NSWindow API works correctly. I guess this was forgotten in from older code which changed presentation options directly for going fullscreen.
* cocoa: only call resize for view changing frameGravatar Stefano Pigozzi2014-10-04
|
* cocoa: remove pointless drawRectGravatar Stefano Pigozzi2014-10-04
| | | | | | Apparently it causes deadlocks, and at the moment it does nothing. Fixes #778
* cocoa: make fullscreening look like an atomic operationGravatar Stefano Pigozzi2014-10-04
| | | | | | | | | | | At the moment when you fullscreen mpv there is a very small time interval where the fullscreen windows is semi-transparent. Apparently whem moving the view to another parent it's better to make Cocoa not draw anything globally. An Apple engineer said it, so it must be correct: http://www.cocoabuilder.com/archive/cocoa/142020-preventing-flicker-on-moving-nsview-to-different-superview.html I know I will regret this in the future.
* cocoa: make resizing wake the vo threadGravatar Stefano Pigozzi2014-10-04
|
* cocoa: remove dead codeGravatar Stefano Pigozzi2014-10-04
|
* vf_stereo3d: fix "auto" input format with libavGravatar Alessandro Ghedini2014-10-04
|
* x11: stupid workaround for XMonadGravatar wm42014-10-04
| | | | | | | | --x11-netwm=yes now forces NetWM fullscreen, while --x11-netwm=auto (detect whether NetWM fullsctreen support is available) is the old behavior and still the default. See #888.
* cocoa: move to a simpler threading modelGravatar Stefano Pigozzi2014-10-04
| | | | | | | | | | | | | | Unfortunately using dispatch_sync for synchronization turned out to be really bad for us. It caused a wide array of race conditions, deadlocks, etc. Moving to a very simple mutex. It's not clear to me how to do liveresizing with this, for now it just flickers with is unacceptable (maybe I'll draw black instead). This should fix all the threading cocoa bugs. Reopen if it's not the case! Fixes #751 Fixes #1129
* video: return responsibility of video redraw back to playloopGravatar wm42014-10-03
| | | | | | | | | | | | | | | | | | | | | | | | When the VO was moved it its own thread, responsibility for redrawing was given to the VO thread itself. So if there was a condition that indicated that redrawing was required, like expose events or certain VOCTRLs, the VO thread was redrawing itself. This worked fine, but there are some corner cases where this works rather badly. E.g. if I fullscreen the player and hit panscan controls with mpv's default autorepeat rate, playback stops. This happens because the VO redraws itself after every panscan change command. Running each (repeated) command takes so long due to redrawing and (involuntary) waiting on vsync, that it never leaves the input processing loop while the key is held down. I suspect that in my case, redrawing in fullscreen mode just gets slow enough that it takes 2 vsyncs instead of 1 on average, and the processing time gets larger than the autorepeat delay. Fix this by taking redraw control from the VO, and instead let the playloop issue a "real" redraw command to the VO if needed. This basically reverts redraw handling to what it was before moving the VO to a thread. CC: @mpv-player/stable
* x11: fix --wid=0Gravatar wm42014-10-02
| | | | | | | | | | Another fallout resulting from the changes whether or not to wait for mapping the window. In this case, it obviously makes no sense to wait for mapping, because the root window is always mapped. Mapping will never happen, and it would wait forever. Fixes #1139. CC: @mpv-player/stable
* vo_vdpau: don't try to create surfaces of size 0Gravatar wm42014-10-01
| | | | | | | | | | | | | | | | | | | | | | At least on kwin, we decide to proceed without waiting for the window being mapped (due to the frame exts hack, see commit 8c002b79). But that leaves us with a window size of 0x0, which causes VdpOutputSurfaceCreate to fail. This prints some warnings, although vo_vdpau recovers later and this has no other bad consequences. Do the following things to deal with this: - set the "known" window size to the suggested window size before the window is even created - allow calling XGetGeometry on the window even if the window is not mapped yet (this should work just fine) - make the output surface minimum size 1x1 Strictly speaking, only one of these would be required to make the warning disappear, but they're all valid changes and increase robustness and correctness. At no point we use a window size of 0x0 as magic value for "unset" or unknown size, so keeping it unset has no purpose anyway. CC: @mpv-player/stable
* w32_common: quit event loop on destroyGravatar James Ross-Gowan2014-09-30
| | | | | | | | | | | | When embedding, if the parent window is destroyed, it will cause mpv's window to be destroyed as well. Since WM_USER wakeups are sent to the window, destroying the window will prevent wakeups and cause uninit to hang. Fix this by quitting the event loop on WM_DESTROY. Events should only be processed for the lifetime of the window, from CreateWindowEx to WM_DESTROY. After the event loop is finished, mp_dispatch_queue_process can handle any remaining requests.
* vd_lavc: fix a small memory leak on init errorGravatar wm42014-09-29
| | | | | The private context wasn't free'd when codec init failed. Restructure the code so that it can't happen.
* x11: always wait for mapped when using --widGravatar wm42014-09-29
| | | | | | | Might help with embedding with mozplugger. I can't confirm whether it fixes the issue. See #1090.
* client API, X11: change default keyboard input handling againGravatar wm42014-09-28
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit 64b7811c tried to do the "right thing" with respect to whether keyboard input should be enabled or not. It turns out that X11 does something stupid by design. All modern toolkits work around this native X11 behavior, but embedding breaks these workarounds. The only way to handle this correctly is the XEmbed protocol. It needs to be supported by the toolkit, and probably also some mpv support. But Qt has inconsistent support for it. In Qt 4, a X11 specific embedding widget was needed. Qt 5.0 doesn't support it at all. Qt 5.1 apparently supports it via QWindow, but if it really does, I couldn't get it to work. So add a hack instead. The new --input-x11-keyboard option controls whether mpv should enable keyboard input on the X11 window or not. In the command line player, it's enabled by default, but in libmpv it's disabled. This hack has the same problem as all previous embedding had: move the mouse outside of the window, and you don't get keyboard input anymore. Likewise, mpv will steal all keyboard input from the parent application as long as the mouse is inside of the mpv window. Also see issue #1090.
* Fix build with libavfilter disabledGravatar wm42014-09-28
| | | | Although I'm not sure why we even support this.
* video: change automatic rotation and 3D filter insertionGravatar wm42014-09-27
| | | | | | | | | | | | | | | | | | | | | We inserted these filters with fixed parameters, which was ok. But this also didn't change image parameters for the filters down the filter chain and the VO. For example, if rotation by 90° was requested by the file, we would insert a filter and rotate the video, but the VO would still receive image parameters that direct rotation by 90°. This wasn't a problem, but it could become one. Fix this by letting the filters automatically pick up the image params. The image params are reset on application. (We could probably also always try to apply and reset image params in a filter, instead of having special "auto" parameters. This would probably work, and video.c would insert a "rotate=0" filter. But I'm afraid this would be confusing and the current solution is cosmetically slightly nicer.) Unfortunately, the vf_stereo3d.c change turned out a big mess, but once the "internal" filter is fully replaced with libavfilter, most of this can be radically simplified.
* vf_lavfi: make chaining from other filters more flexibleGravatar wm42014-09-27
| | | | | | | | | Some filters exists only to create a specific lavfi graph. Allow these filters to reset the graph exactly on reconfig, and allow them to modify some image parameters too. Also make vf_lw_update_graph() behave like vf_lw_set_graph() - they had a subtitle difference with filter==NULL. Useful for the following commit.
* Remove mpbswap.hGravatar wm42014-09-25
| | | | | | This was once central, but now it's almost unused. Only vf_divtc still uses it for extremely weird and incomprehensible reasons. The use in stream.c is trivial. Replace these, and remove mpbswap.h.
* video: remove BITMAPINFOHEADER from internal demuxer APIGravatar wm42014-09-25
| | | | | | | | | | MPlayer traditionally did this because it made sense: the most important formats (avi, asf/wmv) used Microsoft formats, and many important decoders (win32 binary codecs) also did. But the world has changed, and I've always wanted to get rid of this thing from the codebase. demux_mkv.c internally still uses it, because, guess what, Matroska has a VfW muxing mode, which uses these data structures natively.
* vf_vapoursynth: make it possible to get filter output incrementallyGravatar wm42014-09-23
| | | | | | | | | | | | | | | | | Until now, we always required the playback core to decode a new frame to get more output from the filter. That seems to be completely unnecessary, because filtered results may arrive before that. Add a filter_out callback, and restructure the code such that it can return any filtered frames, or block if it hasn't read at least one frame. In the worst case, it still can happen that bursts of input requests and output requests happen. (This commit tries to reduce burst-like behavior, but it's not entirely possible due to the indeterministic nature of VS threading.) This is a similar change as with 95bb0bb6.
* video: fix redrawing when pausing after framedropGravatar wm42014-09-21
| | | | | | | When pausing after a frame was just dropped, we're logically at the dropped frame, and thus should redraw the dropped frame. This was implemented, but didn't work after unpausing for the second time, because of a minor logic bug.
* video: fix some vo_direct3d crashes due to FFmpeg nonsenseGravatar wm42014-09-21
| | | | | | | | | | | | For incomprehensible reasons, AV_PIX_FMT_GRAY8 (and some others) have a palette. This literally makes no sense and this issue has bitten us before, but it is how it is. This also caused a crash with vo_direct3d: this mapped a texture as IMGFMT_Y8 (i.e. AV_PIX_FMT_GRAY8), and when copying this, it tried to copy the non-existent palette. Fixes #1113.
* vo_vdpau: better integration with the generic framedrop codeGravatar wm42014-09-20
| | | | | | | | | | | | | | | | | | | | vo_vdpau uses its own framedrop code, mostly for historic reasons. It has some tricky heuristics, of which I'm not sure how they work, or if they have any effect at all, but in any case, I want to keep this code for now. One day it might get fully ported to the vo.c framedrop code, or just removed. But improve its interaction with the user-visible framedrop controls. Make --framedrop actually enable and disable the vo_vdpau framedrop code, and increment the number of dropped frames correctly. The code path for other VOs should be equivalent. The vo_vdpau behavior should, except for the improvements mentioned above, be mostly equivalent as well. One minor change is that frames "shown" during preemption are always count as dropped. Remove the statement from the manpage that vo_vdpau is the default; this hasn't been the case for a while.
* vo_vdpau: fix confusion around vsync_intervalGravatar wm42014-09-20
| | | | | | | vc->vsync_interval and vsync_interval should be the same value, but actually vc->vsync_interval was updated after vsync_interval was initialized. This was probably not intended. Fix this by removing the duplicate local variable. There were probably no bad effects.
* wayland: use reported rete and delayGravatar Alexander Preisinger2014-09-19
| | | | | If native-keyrepeat is true then we set the rate and delay reported by the compositor.
* vf_lavfi: fetch output frames incrementallyGravatar wm42014-09-18
| | | | | | | Uses the new mechanism introduced in the previous commit. Depending on the actual filter, this distributes CPU load more evenly over time, although it probably doesn't matter.
* video/filter: allow better dataflowGravatar wm42014-09-18
| | | | | | | | | Consider a filter which turns 1 frame into 2 frames (such as an deinterlacer). Until now, we forced filters to produce all output frames at once. This was done for simplicity. Change the filter API such that a filter can produce frames incrementally.
* video: wake up core as soon as possibleGravatar wm42014-09-16
| | | | | | | | There's no reason to let the core wait until the frame is done displaying. In practice, the core normally didn't need this additional wakeup, and the VO was quick enough to fetch the new frame, before the core even attempted to queue a new frame. But it wasn't entirely clean, and the correct wakeup handling might matter in some cases.
* vo_wayland: remove unnecessary checkGravatar Alexander Preisinger2014-09-16
| | | | | buffer_pool_get_front now returns always a valid buffer. No need for corner cases.
* wayland/buffer: use buffer macros consistentlyGravatar Alexander Preisinger2014-09-16
|
* x11: if the WM supports _NET_FRAME_EXTENTS, don't wait for mapGravatar wm42014-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some window managers can prevent mapping of a window as a feature. i3 can put new windows on a certain workspace (with "assign"), so if mpv is started on a different workspace, the window will never be mapped. mpv currently waits until the window is mapped (blocking almost all of the player), in order to avoid race conditions regarding the window size. We don't want to remove this, but on the other hand we also don't want to block the player forever in these situations. So what we need is a way to know when the window manager is "done" with processing the map request. Unfortunately, there doesn't seem to be a standard way for this. So, instead we could do some arbitrary communication with the WM, that may act as "barrier" after map request and the "immediate" mapping of the window. If the window is not mapped after this barrier, it means the window manager decided to delay the mapping indefinitely. Use the _NET_REQUEST_FRAME_EXTENTS message as such a barrier. WMs supporting this message must set the _NET_FRAME_EXTENTS property on the mpv window, and we receive a PropertyNotify event. If that happens, we always continue and cancel waiting for the MapNotify event. I don't know if this is sane or if there's a better mechanism. Also, this works only for WMs which support this message, which are not many. But at least it appears to work on i3. It may reintroduce flickering on fullscreen with other WMs, though.