summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* stream: remove padding parameter from stream_read_complete()wm42013-06-231-1/+1
| | | | | | | | Seems like a completely unnecessary complication. Instead, always add a 1 byte padding (could be extended if a caller needs it), and clear it. Also add some documentation. There was some, but it was outdated and incomplete.
* fix compile, sorryRudolf Polzer2013-06-161-0/+1
|
* encode_lavc strings: use new option syntaxRudolf Polzer2013-06-161-2/+2
|
* vf_dlopen filters: add an "ildetect" filter that detects interlacingRudolf Polzer2013-06-161-4/+21
| | | | | The filter analyzes each frame for combing, and decides at the end whether the content is likely interlaced, telecined or progressive.
* cocoa_common: implement VOCTRL_UPDATE_WINDOW_TITLEStefano Pigozzi2013-06-161-2/+11
| | | | | Unfortunately this backend creates the window lazily and a call to `cocoa_set_window_title` is needed inside config.
* wayland: use VOCTRL_UPDATE_WINDOW_TTILEAlexander Preisinger2013-06-161-1/+3
|
* vo: fix build on Libavwm42013-06-151-0/+2
|
* video/out: introduce VOCTRL_UPDATE_WINDOW_TITLEwm42013-06-154-5/+21
| | | | | | | | | | | Instead of implicitly changing the window title on config(), do it as part of the new VOCTRL. At first I wanted to make all VOs use the VOCTRL argument directly, but on a second thought it appears vo_get_window_title() is much more useful for some (namely, if the window is created lazily on first config()). Not all VOs are changed. Wayland and OSX have to follow.
* vo: define VO_TRUE/FALSE to C99 constantswm42013-06-151-2/+2
| | | | | | | | | This make the intention more apparent, and some VOs are actually using true instead of VO_TRUE in some places. Hopefully this changes makes it less confusing (instead of more). The C99 constants true/false are defined to 1/0 as well, so this commit doesn't actually change anything.
* w32_common: remove some unneeded codewm42013-06-151-5/+3
| | | | vo_w32_init() can be called only once on a VO.
* w32_common: fix non-sensewm42013-06-151-2/+3
| | | | Seriously...
* vo_xv: always request redraw on resizewm42013-06-151-3/+3
| | | | Fixes using panscan controls with OSD off and video paused.
* vo: redo video display rectangle calculationswm42013-06-151-24/+49
| | | | | | | | | | | | | | | | | This code calculates the source/display video rectangle for scaling with most VOs. It's responsible for clipping the display rectangle against the screen and adjusting the source rectangle accordingly. Until now, it assumed that the video was centered on the screen. Change this so that any rectangle is possible. Basically, the clipping is extended to two sides (e.g. left and right), instead of handling both at the same time. The rounding behavior slightly changes. It seems to be slightly better than before. On the other hand, the video is not strictly centered anymore (due to different rounding on either side). When using panscan controls, the video can "jitter" by 1 or 2 pixels around the center as the panscan value is changed.
* gl_video: rearrange some codewm42013-06-151-23/+20
| | | | I think this is slightly nicer. Shouldn't change anything functionally.
* gl_video: fix scaling when image is cropped, or with no-npotwm42013-06-151-22/+39
| | | | | | | | | | | | | | | | | | | | | | | When the displayed image is cropped in Y direction (like using panscan controls when playing 4:3 video on a 16:9 monitor), and separated scaling is used, the texture size for the FBO holding the intermediate result was calculated incorrectly. This could lead to artifacts, which were quite apparent with extreme scale factors. Actually, the size of that texture is OK, but the texture shouldn't be used to hold the complete scaled image. Instead, it should be used for the visible part of the image only. Because separate scaling works by scaling in Y direction first, it's still fine to scale the image on the full image width on the first pass. This helps avoiding artifacts on the left/right border of the image when scaling in X direction, as the scaler will try to fetch pixels from beyond the border. (The left border is still kind of fine, but the right border will fetch garbage, unless the texture is strictly sized, or explicit clamping is added to the shader. Too much trouble, so using the full image width is simpler.) Also fix some issues with no-npot mode, which enables use of power-of-2 textures. Maybe this mode isn't really useful anymore (modern hardware is faster with smaller non-power-of-2 textures), but keep it for now.
* gl_video: typo in commentwm42013-06-151-1/+1
|
* image_writer: Add PNG filter option (default "mixed")Martin Herkt2013-06-152-1/+6
| | | | | | The use of filters prior to PNG compression can greatly improve compression ratio, with "mixed" (ImageMagick calls it "adaptive") typically achieving the best results.
* cocoa_common: remove play/pause VOCTRL functionsStefano Pigozzi2013-06-142-14/+2
| | | | | Make VOCTRL_RESTORE_SCREENSAVER / VOCTRL_KILL_SCREENSAVER use the power management functions directly.
* w32: enable screensaver when pausedwm42013-06-142-2/+13
| | | | | | | This is quite similar to the previous commit. Untested. I'm not sure if this is how it's supposed to work. At least --no-stop-screensaver should work in any case.
* x11: enable screensaver when paused, rename/change --stop-xscreensaverwm42013-06-141-3/+7
| | | | | | | | | | | Use the recently introduced screensaver VOCTRLs to control the screensaver in the X11 backend. This means the behavior when paused changes: the old code always kept the screensaver disabled, but now the screensaver is reenabled on pausing. Rename the --stop-xscreensaver option to --stop-screensaver and make it more generic. Now it affects all backends that respond to the screensaver VOCTRLs.
* core: introduce separate VOCTRLs for screensaver stop/resumewm42013-06-142-3/+5
| | | | | | | | | | | | | | | | | | | | | | This is slightly better because VOCTRL_RESUME/VOCTRL_PAUSE are usually needed by VOs to know whether video is actually being played (for whatever reason), and they wouldn't be passed to the backend's VOCTRL handler, like vo_x11_control(). Also try to make sure that these flags (both pause state and screensaver state) are set consistently in some corner cases. For example, it seems enabling video in the middle of playing a file while the player is paused would not set the paused flag. If codec initialization fails, destroy the VO instead of keeping it around to make sure the state is consistent. Framestepping is implemented by unpausing the player for the duration of a frame. Remove the special handling of VOCTRL_PAUSE/RESUME in these cases. It was most likely needed because these VOCTRLs used to be important for screen redrawing (blatant guess), which is now handled completely differently. The only potentially bad side-effect is that the screensaver will be disabled/reenabled for the duration of one frame.
* 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.
* Merge branch 'sub_mess'wm42013-06-041-11/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | This branch heavily refactors the subtitle code (both loading and rendering), and adds support for a few new formats through FFmpeg. We don't remove any of the old code yet. There are still some subtleties related to subreader.c to be resolved: code page detection & conversion, timing post-processing, UTF-16 subtitle support, support for the -subfps option. Also, SRT reading and loading ASS via libass should be turned into proper demuxers. (SRT is needed because Libav's is gravely broken, and we want ASS loading via libass to cover full libass format support. Both should be demuxers which are probed _before_ libavformat, so that all subtitles can be loaded through the demuxer infrastructure, and libavformat subtitles don't need to be treated in a special way.)
| * core: add common function to initialize AVPacketwm42013-06-031-11/+2
| | | | | | | | | | | | | | | | | | | | Audio and video had their own (very similar) functions to initialize an AVPacket (ffmpeg's packet struct) from a demux_packet (mplayer's packet struct). Add a common function for these. Also use this function for sd_lavc_conv. This is actually a functional change, as some libavfilter subtitle demuxers add weird out-of-band stuff as side-data.
* | 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.
* options: remove some questionable -lavdopts suboptionswm42013-05-291-15/+0
| | | | | | Most of these are rather questionable, the rest you rarely need to set manually. You still can set all of them with -lavdopts-o (because libavcodec has AVOptions for them).
* 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.
* vf_delogo: copy in non-direct case, fix double-freewm42013-05-261-9/+1
| | | | | | | | | If the image is not writeable, the image actually has to be copied beforehand. This was overlooked when converting the video chain to reference counted images. Fix a double free issue. This was overlooked when vf.c was changed to free filter priv data automatically.
* gl_video: improve ditheringwm42013-05-267-23/+330
| | | | | |</