summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* Remove old demuxerswm42013-07-071-4/+1
| | | | | | | | | | Delete demux_avi, demux_asf, demux_mpg, demux_ts. libavformat does better than them (except in rare corner cases), and the demuxers have a bad influence on the rest of the code. Often they don't output proper packets, and require additional audio and video parsing. Most work only in --no-correct-pts mode. Remove them to facilitate further cleanups.
* dither: don't use long doublewm42013-07-051-2/+2
| | | | | | | | | | This fixes compilation with broken libcs, like on Cygwin. C99 absolutely requires long double and associated functions like expl, even if long double is double. But newlib (used by cygwin) omits declaration for these if long double is equivalent to double. The extra precision is not needed here, so remove it to make life easier for the single person using mpv with cygwin.
* core: remove mp_fifo leftoverswm42013-07-043-3/+0
|
* wayland: remove mp_fifo headerAlexander Preisinger2013-07-031-1/+0
|
* wayland: fix typoAlexander Preisinger2013-07-031-1/+1
|
* wayland: remove unused membersAlexander Preisinger2013-07-031-2/+0
|
* wayland: remove mp_fifoAlexander Preisinger2013-07-021-7/+7
|
* wayland: implement MOUSE_LEAVEAlexander Preisinger2013-07-021-0/+2
|
* core: cleanup more mp_fifo leftoverswm42013-07-025-34/+33
| | | | Now only the OSX and Wayland parts are using this.
* core: remove mp_fifo indirectionwm42013-07-022-3/+1
| | | | | | | | | | For some reason mp_fifo specifically handled double clicks, and other than that was a pointless wrapper around input.c functionality. Move the double click handling into input.c, and get rid of mp_fifo. Add some compatibility wrappers, because so much VO code uses these functions. Where struct mp_fifo is still used it's just a casted struct input_ctx.
* input: require VOs to send key up events, redo input key lookupwm42013-07-026-11/+14
| | | | | | | | | | | | | | Making key up events implicit was sort-of a nice idea, but it's too tricky and unreliable and makes the key lookup code (interpret_keys()) hard to reason about. See e.g. previous commit for subtle bugs and issues this caused. Make key-up events explicit instead. Add key up events to all VOs. Any time MP_KEY_STATE_DOWN is used, the matching key up event must use MP_KEY_STATE_UP. Rewrite the key lookup code. It should be simpler and more robust now. (Even though the LOC increases, because the new code is less "compact".)
* w32_common: prevent display power managementJames Ross-Gowan2013-06-301-0/+3
| | | | | | | | Handling SC_MONITORPOWER doesn't seem to prevent the screen from dimming. The recommended way to do this in Windows XP and Vista is to call SetThreadExecutionState with ES_DISPLAY_REQUIRED. Windows 7 also has the PowerCreateRequest/PowerSetRequest/PowerClearRequest APIs but they're probably too complicated for this task.
* w32_common: prevent that window dragging and mouse input interferewm42013-06-291-1/+1
|
* w32_common: refactor mouse button code, handle mouse up eventswm42013-06-291-31/+39
| | | | | Instead of sending a single event on click, send both down and up events.
* input: trigger mouse_leave key bindings if mouse leaves mouse areawm42013-06-291-2/+5
| | | | | | Also, implement mouse leave events for X11. But evne on other platforms, these events will be generated if mouse crosses a section's mouse area boundaries within the mpv window.
* input: handle mouse movement differentlywm42013-06-294-6/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, mouse movement events emitted a special command ("set_mouse_pos"), which was specially handled in command.c. This was once special-cased to the dvdnav and menu code, and did nothing after libmenu and dvdnav were removed. Change it so that mouse movement triggers a pseudo-key ("MOUSE_MOVE"), which then can be bound to an arbitrary command. The mouse position is now managed in input.c. A command which actually needs the mouse position can use either mp_input_get_mouse_pos() or mp_get_osd_mouse_pos() to query it. The former returns raw window-space coordinates, while the latter returns coordinates transformed to OSD- space. (Both are the same for most VOs, except vo_xv and vo_x11, which can't render OSD in window-space. These require extra code for mapping mouse position.) As of this commit, there is still nothing that uses mouse movement, so MOUSE_MOVE is mapped to "ignore" to silence warnings when moving the mouse (much like MOUSE_BTN0). Extend the concept of input sections. Allow multiple sections to be active at once, and organize them as stack. Bindings from the top of the stack are preferred to lower ones. Each section has a mouse input section associated, inside which mouse events are associated with the bindings. If the mouse pointer is outside of a section's mouse area, mouse events will be dispatched to an input section lower on the stack of active sections. This is intended for scripting, which is to be added later. Two scripts could occupy different areas of the screen without conflicting with each other. (If it turns out that this mechanism is useless, we'll just remove it again.)
* cocoa_common: uninit fs window properlyStefano Pigozzi2013-06-291-0/+3
| | | | | | | | In fullscreen `s->window` is the windowed window. So freeing that didn't get rid of the FS window and OpenGL view. Fixes #122 [ci skip]
* csputils.h: don't recursively include libavcodec headerwm42013-06-283-16/+16
| | | | | | | | Some functions (avcol_spc_to_mp_csp() etc.) used libavcodec enum types as parameters. Remove these in order to get rid of the avcodec.h include statement. This prevents that avcodec.h is recursively included by dozens of files. Fix mp_image.c, which used the header without explicitly including avcodec.h.
* vo_opengl: handle chroma locationwm42013-06-289-3/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the video decoder chroma location flags and render chroma locations other than centered. Until now, we've always used the intuitive and obvious centered chroma location, but H.264 uses something else. FFmpeg provides a small overview in libavcodec/avcodec.h: ----------- /** * X X 3 4 X X are luma samples, * 1 2 1-6 are possible chroma positions * X X 5 6 X 0 is undefined/unknown position */ enum AVChromaLocation{ AVCHROMA_LOC_UNSPECIFIED = 0, AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 AVCHROMA_LOC_TOPLEFT = 3, ///< DV AVCHROMA_LOC_TOP = 4, AVCHROMA_LOC_BOTTOMLEFT = 5, AVCHROMA_LOC_BOTTOM = 6, AVCHROMA_LOC_NB , ///< Not part of ABI }; ----------- The visual difference is literally minimal, but since videophiles apparently consider this detail as quality mark of a video renderer, support it anyway. We don't bother with chroma locations other than centered and left, though. Not sure about correctness, but it's probably ok.
* video: add a new method to configure filters and VOswm42013-06-2816-139/+211
| | | | | | | | | | | | | | | | | | The filter chain and the video ouputs have config() functions. They are strictly limited to transfering the video size and format. Other parameters (like color levels) have to be transferred separately. Improve upon this by introducing a separate set of reconfig() functions, which use mp_image_params to carry format parameters. This struct contains all image format related parameters from config(), plus additional parameters such as colorspace. Change vf_rotate to use it, as well as vo_opengl. vf_rotate is just an example/test case, but vo_opengl will need it later. The intention is also to get rid of VOCTRL_SET_YUV_COLORSPACE. This information is now handed to the VOs via reconfig(). The getter, VOCTRL_GET_YUV_COLORSPACE, will still be needed though.
* mp_image: copy palette only if allocatedwm42013-06-281-1/+2
| | | | | | Normally, we assume that IMGFMT_PAL8 always has a palette allocated in plane 1. But there may be corner cases in ffmpeg where it doesn't (namely pseudo-pal stuff).
* vf_rotate: fix params >= 4wm42013-06-281-0/+2
|
* options: remove -lavdopts debug suboptionwm42013-06-281-4/+0
| | | | This can be set as avopt instead.
* cocoa_common: schedule a redraw frame after a non live resizeStefano Pigozzi2013-06-251-3/+18
| | | | | | | | | | | A redraw forces recalculation of panscan and other stuff not accounted for in the resize_redraw codepath. This is actually a hack but works really well in my tests. Thanks @wm4 and @Cpuroast for the idea. Fixes #86 [ci skip]
* Merge branch 'sub_mess2'wm42013-06-251-1/+1
|\ | | | | | | ...the return.
| * 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.
* | OSX: fix compilation with 10.7 SDKStefano Pigozzi2013-06-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent work in the OS X parts of the code started using clang's support for Obj-C's support for Literals and Subscripting. These particular language features remove a lot of boilerplate code and allow to interact with collections as consicely as one would do in scripting languages like Ruby or Python. Even if these are compiler features, Subscripting needs some runtime support. This is provided with libarclite (coming with the compiler), but we need to add the proper method definitions since the 10.7 SDK headers do not include them. That is because 10.7 shipped before this language features. This will cause some warnings when compiling with the 10.7 SDK because the commit also redefines BOOL to make autoboxing/unboxing of BOOL literals to work. If you need to test this for whatever reason on 10.8, just pass in the correct SDK to configure's extra cflags: ./configure --extra-cflags='-mmacosx-version-min=10.7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk' Fixes #117
* | vo_lavc: remove unused variablewm42013-06-181-1/+1
| |
* | osdep: remove shmem wrapperwm42013-06-181-1/+0
| | | | | | | | This is unused now that the cache is always threaded.
* | vo_lavc: do NOT fill pict_type from the mp_imageRudolf Polzer2013-06-171-0/+4
| | | | | | | | | | | | | | | | Doing this makes the encoder force the same pict type as original, which is often not even possible. Rather let the codec decide! As there is no documented value to mean "decoder shall pick", I rather save/restore the default value filled by libavcodec.
* | vo_lavc: use mp_image_copy_fields_to_av_frameRudolf Polzer2013-06-171-4/+1
|/
* 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
| | | |