summaryrefslogtreecommitdiffstats
path: root/video/out
Commit message (Collapse)AuthorAgeFilesLines
* gl_video: remove redundant conditionwm42013-06-131-6/+1
|
* vo_lavc: silence warning when writing y4mwm42013-06-131-1/+1
| | | | | Apparently a ffmpeg issue. Hide the warning because it's annoying. Workaround suggested by divVerent.
* cocoa_common: fix ontop switching when fullscreenStefano Pigozzi2013-06-111-2/+2
| | | | | | | `enterFullScreenMode:withOptions:` creates another window so set the level on both the windowed window and current window. Also remove NSFullScreenModeWindowLevel as it seems to be superfluous.
* cocoa_common: fix window level when going fullscreenStefano Pigozzi2013-06-101-1/+1
| | | | | | | | | This is a regression introduced by 0057aa4769. Fix it so that the fullscreen window uses the correct window level. [ci skip] Fixes #106
* encoding: fix -oneverdrop logic when -omaxfps is usedRudolf Polzer2013-06-091-5/+8
| | | | Not that anyone should ever do this...
* encoding -omaxfps: rewrite logicRudolf Polzer2013-06-091-29/+32
| | | | | | Now it properly hits the "0 times displayed" case when frames get skipped; this means the candidate frame for the case the next frame is "long" is set properly.
* encoding -omaxfps: do not shift pts when pts are repeated entirelyRudolf Polzer2013-06-091-1/+1
| | | | | This is just to make sure. I have no test case for this, but the logic seems saner that way.
* Option -omaxfps: limit fps when encodingRudolf Polzer2013-06-091-0/+16
| | | | | Lower-fps content is left alone (NOT aligned to this fps); higher fps content is decimated to this frame rate.
* osx: cocoa_common: use default wakeup periodStefano Pigozzi2013-06-031-1/+0
| | | | | Now that Cocoa's input handling is done on a separate thread from the playloop it is ridicolously simple to have longer asynchronous sleeps when paused.
* osx: create macosx_events to deal with keyDown eventsStefano Pigozzi2013-06-033-194/+9
| | | | | | On OSX with Cocoa enabled keyDown events are now handled with addLocalMonitorForEventsMatchingMask:handler:. This allows to respond to events even when there is no VO initialized but the GUI is focused.
* osx_common: remove outdated ifdefferyStefano Pigozzi2013-06-031-52/+0
| | | | It was definining keycodes not defined in OS X < 10.5.
* gl_video: reduce output with -v, skip useless header partswm42013-06-031-5/+8
| | | | | | Originally, the header wasn't supposed to contain random compatibility stuff, but now all that is printed with -v. Add a hack to skip it and to reduce the noise.
* gl_video: explicitly clamp colormatrix outputwm42013-06-031-0/+1
| | | | | | | This could lead to quite visible artifacts when using an appropriate ICC and float FBOs. The float FBOs allow storing out of range values, and my guess is that the rest of the precessing chain elevated these out of range values, resulting in artifacts.
* cocoa_common: autohide dock/menubar on fs only if on same screenStefano Pigozzi2013-06-011-7/+37
| | | | | | | | | | | | | Autohide the menubar and/or dock only if they are present in the screen the player is going to go fullscreen into. I thought the GUI would handle this for me when I switched 0057aa476 but lack of hardware to test made me embarass myself yet again. I reimplemented this feature with nicer code and behaviour. The code checks separately wether to hide menubar and dock separatly, while the old code used a single check possibly hiding stuff without need. Added the key checks as a some category additions to NSScreen for readability.
* cocoa_common: don't autohide mouse on mousedownStefano Pigozzi2013-06-011-2/+10
| | | | | Previews code allowed to click the same spot for a long time and the cursor would autohide. No more!
* cocoa_common: avoid window creation with VOFLAG_HIDDENStefano Pigozzi2013-06-011-76/+92
| | | | | | | | This takes an approach similar to the wayland OpenGL backend. VOFLAG_HIDDEN flag semantics doesn't mean "hide the window" but is simply ever used only to do detection of available OpenGL extensions. On OSX it's possibile to accomplish this task just by creating the OpenGL context without attaching it to a drawable.
* cocoa_common: dehack mouse autohide by clipping view bounds to visible screenStefano Pigozzi2013-06-011-17/+19
| | | | | This prevents the mouse to autohide when hovering the dock/menubar without any particular hack and seems to finally cover all edge cases.
* cocoa_common: fix mouse autohide on MenuBar/Dock interactionStefano Pigozzi2013-05-311-1/+7
| | | | | This is needed after last commit. A bug within a bug (yo dawg)! Serious explaination in the source code comment so that it's not forgotten.
* cocoa_common: fix empty window when going fs on different screenStefano Pigozzi2013-05-311-0/+9
| | | | | | | | | Using `enterFullScreenMode:withOptions:` with a screen handle than the current screen doesn't hide the current window in the current screen. This is a bug in Cocoa (preparing an isolated test case and sending the rdar later). To work around this, manually hide/show the window that the toolkit should hide/show for us.
* cocoa_common: fix mouse hiding outside of player viewStefano Pigozzi2013-05-301-9/+21
| | | | | | | | | | | | This bug was the result of crappy position detection in the previous code combined with the commits moving autohide delay out of the cocoa backend and into the core. The hit detection was improved and now takes also account of interactions with the Dock and Menubar. Moreover VOCTRL_SET_CURSOR_VISIBILITY now has an effect only if the mouse position matches with this improved hit detection. This means that both interaction with the Dock and Menubar are considered as well as moving the mouse inside another screen.
* cocoa_common: refactor fullscreen code for readabilityStefano Pigozzi2013-05-301-31/+53
| | | | | Break up the code into several methods and reduce code duplication. Also add comments to make the intention of all this clearer.
* cocoa_common: fix native-fs state savingStefano Pigozzi2013-05-301-1/+2
| | | | `opts->fs = VO_FALSE` was forgotten
* cocoa_common: fix a bug in window initialization errorStefano Pigozzi2013-05-301-1/+3
| | | | We didn't bail out soon enough. Bug was introduced by 134f3e97.
* cocoa_common: use cocoa APIs to go fullscreenStefano Pigozzi2013-05-302-219/+165
| | | | | | | | | | | | This removes a bit of ugly code and bookeeping which is never bad. `drawRect` needs to guard against different window instances since in fullscreen the view is wrapped in a fullscreen window provided by the toolkit (a instance of NSFullScreenWindow to be precise). The event handling was moved to the view so that it can still get all the events when in the fullscreen window. Ideally these should be moved to some NSResponder subclass within macosx_application and made available even when no window is present. I refrained from this because "small steps".
* macosx_application: move escape_loadfile_name in this fileStefano Pigozzi2013-05-302-24/+0
| | | | This allows to move back osx_common to raw C.
* cocoa_common: use better power management activity descriptionStefano Pigozzi2013-05-301-1/+1
| | | | | Now one might actually undestand why this power management assertion is used in the first place.
* osx: remove compatibility conditionals for 10.6Stefano Pigozzi2013-05-303-106/+13
| | | | | | | | At this point 10.6 is pretty old and we don't want to supporting old platforms. I'm killing all the 10.6 compatibility code before doing more refactorings. Next commits will also use newer Objective-C syntax such as literals and @autoreleasepool.
* gl_common: fix invalid alignmentwm42013-05-301-2/+2
| | | | | | | | 0 is invalid. The intention of the code turning off any additional alignment, so we need 1. Change a comment: obviously we don't try to set alignment parameters etc.to handle stride correctly, and instead do everything by row.
* gl_video: add some debug code for testing texture depthwm42013-05-301-7/+60
| | | | | | | | | | | | | | | | | | This probes and prints the depth of some texture formats with the help of a FBO. By default it tests the format used for scaling, as well as the format used for dithering and the 3D LUT (if any of these are enabled). The output is visible only with -v. Some representative values are probed, and the difference of input and output value is printed as hex- float. Hex-floats are used because they make the implied precision more obvious. Originally I wanted to do some more sophisticated guessing of the implied depth/precision for more user-friendly reporting, but then I decided that printing raw data is better for debugging, especially if things go wrong. This does not try to disable any functionality and does not print any warnings if the depth is lower than what it should be.
* gl_video: change a GLSL statementwm42013-05-301-1/+1
| | | | | | This might be better with dumb shader compilers, which won't vectorize this to a single vector-division, assuming the hardware does have such an instruction. Affects "bicubic_fast" scale mode only.
* gl_video: fix some dithering bugswm42013-05-302-15/+11
| | | | | | | | | | | | | | The internal texture format GL_RED is typically 8 bit, which is clearly not good enough for the new dither matrix. The idea was to use a float texture format, but this was somehow "forgotten". Use GL_R16, since 16 bit textures are more robust, and provide more precision for the same memory usage. Change how the offset for centering the dither matrix is applied. This is needed for making it possible to round up values to the target depth. Before this commit, this changed the output even if the input was exact and input and output depth were the same, which is not really what you want. Now it doesn't do that anymore.
* vo_opengl: remove most of the "inline" documentationwm42013-05-261-86/+8
| | | | | | | | | | | There's no point duplicating all the text that is already in the man pages, and synchronizing them is a pain. Place a link to the github generated pages instead. Unfortunately, the anchor '#vo-opengl' does not work. Maybe github's rst converter just sucks, as the actually generated HTML contains links using that anchor too, but does not generate the anchor itself. Too bad.
* gl_video: improve ditheringwm42013-05-267-23/+330
| | | | | | | | | | | | | | | | | | | | | | | | | | Use a different algorithm to generate the dithering matrix. This looks much better than the previous ordered dither matrix with its cross-hatch artifacts. The matrix generation algorithm as well as its implementation was contributed by Wessel Dankers aka Fruit. The code in dither.c is his implementation, reformatted and with static global variables removed by me. The new matrix is uploaded as float texture - before this commit, it was a normal integer fixed point matrix. This means dithering will be disabled on systems without float textures. The size of the dithering matrix can be configured, as the matrix is generated at runtime. The generation of the matrix can take rather long, and is already unacceptable with size 8. The default is at 6, which takes about 100 ms on a Core2 Duo system with dither.c compiled at -O2, which I consider just about acceptable. The old ordered dithering is still available and can be selected by putting the dither=ordered sub-option. The ordered dither matrix generation code was moved to dither.c. This function was originally written by Uoti Urpala.
* gl_video: add scaler-resizes-only sub-optionwm42013-05-262-0/+25
| | | | | This option disables the scaler set with lscale if the video image is not resized.
* Replace calls to usec_sleep()wm42013-05-262-2/+2
| | | | | | This is just dumb sed replacement to mp_sleep_us(). Also remove the now unused usec_sleep() wrapper.
* Replace all calls to GetTimer()/GetTimerMS()wm42013-05-265-18/+22
| | | | | | | | | | | | | | | | | | | | | | GetTimer() is generally replaced with mp_time_us(). Both calls return microseconds, but the latter uses int64_t, us defined to never wrap, and never returns 0 or negative values. GetTimerMS() has no direct replacement. Instead the other functions are used. For some code, switch to mp_time_sec(), which returns the time as double float value in seconds. The returned time is offset to program start time, so there is enough precision left to deliver microsecond resolution for at least 100 years. Unless it's casted to a float (or the CPU reduces precision), which is why we still use mp_time_us() out of paranoia in places where precision is clearly needed. Always switch to the correct time. The whole point of the new timer calls is that they don't wrap, and storing microseconds in unsigned int variables would negate this. In some cases, remove wrap-around handling for time values.
* vo: rip out VO timer wakeup mechanism againwm42013-05-262-19/+0
| | | | | | | This was used by some VOs to do timing of cursor autohiding, but we recently moved that out of the VOs. Even though this mechanism might be a good idea and could be needed again in future (but for what?), it's unused now. So better just get rid of it.
* cocoa_common: send mouse moved events to core when draggingStefano Pigozzi2013-05-261-2/+7
| | | | This change fixes mouse autohide when dragging mouse.
* wayland: use VOCTRL_SET_CURSOR_VISIBILITYAlexander Preisinger2013-05-262-36/+25
|
* wayland: introduce vo_wayland_configAlexander Preisinger2013-05-263-26/+24
| | | | | This removes the need for exposing vo_wayland_fullscreen and other functions also this will be usefull for other vos in the future.
* cocoa_common: implement VOCTRL_SET_CURSOR_VISIBILITYStefano Pigozzi2013-05-261-39/+20
| | | | Pass along cursor visibility hints to be more consistent with OSX's behaviour.
* cocoa_common: implement mouse movement notificationsStefano Pigozzi2013-05-261-0/+10
| | | | | | Notify the core of mouse movement events. The coordinates are converted to a coordinate system with the origin in upper left corner, since Cocoa has it in the lower left corner.
* w32: use VOCTRL_SET_CURSOR_VISIBILITYwm42013-05-261-6/+7
| | | | | This didn't even implement --cursor-autohide. Now it does, and the behavior of the VOs under Windows change accordingly.
* vo_sdl: use VOCTRL_SET_CURSOR_VISIBILITYwm42013-05-261-39/+3
|
* x11: remove cursor hiding logic, use VOCTRL_SET_CURSOR_VISIBILITYwm42013-05-262-48/+33
|
* core: do mouse cursor hiding business in frontendwm42013-05-261-0/+2
| | | | | Do this so that not every VO backend has to setup a timer for cursor hiding and interpret the --cursor-autohide option.
* vo: remove vo.check_events callbackwm42013-05-267-25/+8
| | | | | | Use VOCTRL_CHECK_EVENTS instead. Change the remaining VOs to use it. Only vo_sdl and vo_caca actually need this, and vo_null, vo_lavc, and vo_image had stubs only.
* w32: use vo_w32_control() for all VOswm42013-05-263-40/+15
|
* x11: use vo_x11_control() for all VOswm42013-05-265-80/+31
|
* video/out: introduce vo_control for gl_common based VOswm42013-05-2618-158/+138
| | | | | | | | | | | | | | | | Instead of having separate callbacks for each backend-handled feature (like MPGLContext.fullscreen, MPGLContext.border, etc.), pass the VOCTRL responsible for this directly to the backend. This allows removing a bunch of callbacks, that currently must be set even for optional/lesser features (like VOCTRL_BORDER). This requires changes to all VOs using gl_common, as well as all backends that support gl_common. Also introduce VOCTRL_CHECK_EVENTS. vo.check_events is now optional. VO backends can use VOCTRL_CHECK_EVENTS instead to implementing check_events. This has the advantage that the event handling code in VOs doesn't have to be duplicated if vo_control() is used.
* cocoa_common: authohide menu/dock in fullscreenStefano Pigozzi2013-05-261-2/+3
| | | | | This simple fix makes it possible to access the MainManu and Dock when in fullscreen when not using `--native-fs`.
* vo: remove unused callbackwm42013-05-231-1/+0
|
* Silence some compiler warningswm42013-05-212-3/+3
| | | | None of these were actual issues.
* vo_image: start image file numbers at 1wm42013-05-181-2/+2
| | | | Requested by a user.
* cocoa_common: vo_corevideo: fix window initializationStefano Pigozzi2013-05-161-5/+5
| | | | | vo_corevideo doesn't create a hidden window to perform OpenGL extensions detection. This caused the window to always stay close.
* cocoa_common: order front window only when invisible [2]Stefano Pigozzi2013-05-141-1/+5
| | | | | | Followup to 8df7127. This refines the condition for front ordering the condition to account for minimized or hidden state where the window should go to the front only as a consequnce of user interaction.
* cocoa_common: order front window only when invisibleStefano Pigozzi2013-05-131-1/+1
| | | | | | | Window creation code always made mpv the front window. Fix it to make it front only if the window is currently invisible. Fixes #84
* cocoa_common: don't use recursive lockingStefano Pigozzi2013-05-131-2/+2
| | | | | This was in the original change set for the threadsafety changes but I forgot to squash it in.
* cocoa_common: remove pointless locking when using -fsStefano Pigozzi2013-05-131-5/+10
| | | | | | | | When using --fs `vo_cocoa_fullscreen` was called from the primary thread. This occurred inside `vo_cocoa_config_window` which is scheduled for excution on the primary thread with libdispatch). All of this caused spam from NSRecursiveLock in standard output.
* cocoa_common: fix a bug in window dragging stateStefano Pigozzi2013-05-131-13/+9
| | | | | | | | | | | | When going in and going out of full screen the player lost information on the movableByWindowBackground behaviour. There were some hacks in place to fix it but they were broken with the recent native fullscreen changes in 74c15ec6. This commit removes the problem at the root and removes the hacks. The delegate method `isMovableByWindowBackground` seems to be called after setFrame and setPresentationOptions so change fs state in opts before that. Fixes #83
* cocoa_common: fix deadlock when calling resize_redrawStefano Pigozzi2013-05-121-4/+9
| | | | Fixes #82
* cocoa_common: add native OSX fullscreen supportStefano Pigozzi2013-05-121-20/+39
| | | | | | | | This adds Mission Control fullscreen functionality to mpv. Since this doesn't play well with many of mpv's features disable it by default. Users can activate this feature by using `--native-fs` when starting mpv. Fixes #34
* OSX: run native event loop in a separate threadStefano Pigozzi2013-05-125-104/+253
| | | | | | | | | | | | | | This commit is a followup on the previous one and uses a solution I like more since it totally decouples the Cocoa code from mpv's core and tries to emulate a generic Cocoa application's lifecycle as much as possible without fighting the framework. mpv's main is executed in a pthread while the main thread runs the native cocoa event loop. All of the thread safety is mainly accomplished with additional logic in cocoa_common as to not increase complexity on the crossplatform parts of the code.
* OSX: use native Cocoa's event loopStefano Pigozzi2013-05-121-139/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Schedule mpv's