summaryrefslogtreecommitdiffstats
path: root/video
Commit message (Collapse)AuthorAgeFilesLines
* video: change everythingwm42014-05-024-40/+33
| | | | | | | Change how the video decoding loop works. The structure should now be a bit easier to follow. The interactions on format changes are (probably) simpler. This also aligns the decoding loop with future planned changes, such as moving various things to separate threads.
* video: handle colorspace and aspect overrides separatelywm42014-05-023-9/+24
| | | | | Now the video filter code handles these explicitly, which should increase robustness (or at least find bugs earlier).
* vf: sanitize filter input, instead of overriding itwm42014-05-021-1/+2
| | | | | | | | | vf_fix_img_params() takes care of overwriting image parameters that are normally not set correctly by filters. But this makes no sense for input images. So instead, check that the input is correct. It still has to be done for the first input image, because that's used to handle some overrides (see video_reconfig_filters()).
* vf: add alternate functions for retrieving filter outputwm42014-05-022-13/+57
| | | | | | | These replace vf_read_output_frame(), although we still emulate that function. This change is preparation for another commit (and this is basically just to reduce the diff and signal/noise ratio in that commit).
* vf: expose input parameters; clear parameters on failurewm42014-05-022-2/+3
| | | | Preparation (and simplification) for following commits.
* vf: mark auto-inserted conversion filters in verbose outputwm42014-05-021-0/+2
| | | | | Nota that this flag is not set for other auto-inserted filters (like deinterlacing or rotation).
* vf_lavfi: reinit after libavfilter EOFwm42014-05-021-13/+25
| | | | | | Basically, if we feed the filter a new image even after the EOF state has been reached (e.g. because the input stream "recovered"), we want the filter to restart, instead of returning an error forever.
* vo: verify format of queued imagewm42014-05-021-0/+1
| | | | | Currently, only the configured format is accepted, so assert that the playback core code (which handles format changes) is correct.
* video: fix screenshots with anamorphic videowm42014-05-021-2/+2
| | | | | | | (Again.) This was caused by mp_image_set_params() not properly copying d_w/d_h, because mp_image_set_size() resets them.
* vf_vdpaupp: always provide past and future fieldswm42014-05-021-1/+1
| | | | | | | | | | | Some non-deinterlacing filters (potentially denoising) also use additional frames for filtering. The vdpau docs suggest providing at least 1 future and 2 past _fields_, which means we need to provide 1 past frame (the future field is already the other field of the current field, and both fields are in the same frame). We can easily achieve this by buffering an additional frame in the non- deint case.
* vo_vdpau: keep colorspace flagswm42014-05-021-1/+2
| | | | | Since vdpau_mixer.c initializes the YUV conversion using the mp_image flags, these images should have all flags set properly.
* video: move video frame queue from vo_vdpau.c to vo.cwm42014-05-023-145/+102
| | | | | | | | | | | | | | | | | | | | | Remove the special casing of vo_vdpau vs. other VOs. Replace the complicated interaction between vo.c and vo_vdpau.c with a simple queue in vo.c. VOs other than vdpau are handled by setting the length of the queue to 1 (this is essentially what waiting_mpi was). Note that vo_vdpau.c seems to have buffered only 1 or 2 frames into the future, while the remaining 3 or 4 frames were past frames. So the new code buffers 2 frames (vo_vdpau.c requests this queue length by setting vo->max_video_queue to 2). It should probably be investigated why vo_vdpau.c kept so many past frames. The field vo->redrawing is removed. I'm not really sure what that would be needed for; it seems pointless. Future directions include making the interface between playloop and VO simpler, as well as making rendering a frame a single operation, as opposed to the weird 3-step sequence of rendering, drawing OSD, and flipping.
* vo_vdpau: always use mp_image for internal buffer queuewm42014-05-021-44/+39
|
* command, vo_vdpau: respect vdpau deint sub-optionwm42014-05-022-0/+5
| | | | | This is a horrible hack to keep compatibility with the vo_vdpau deint sub-option.
* vf_vdpaupp: allow toggling deinterlacewm42014-05-021-4/+19
| | | | | Basically makes the 'D' key work again. (But only if the filter is already inserted.)
* vo_vdpau: apply vo_vdpau postprocessing optionswm42014-05-021-2/+16
| | | | | | | | | | | | | The previous commits changed vo_vdpau so that these options are set by vf_vdpaupp, and the corresponding vo_vdpau were ignored. But for compatibility, keep the "old" options working. The value of this is questionable - maybe the vo_vdpau options should just be removed. For now, at least demonstrate that it's possible. The "deint" suboption still doesn't work, because the framerate doubling logic required for some deint modes was moved to vf_vdpaupp. This requires more elaborate workarounds.
* vdpau_mixer: allow overriding frame optswm42014-05-024-4/+10
| | | | So a caller can override the filter options dictated by vf_vdpaupp.
* vo_vdpau: support vf_vdpauppwm42014-05-021-248/+43
| | | | | | | | | | This is slightly incomplete: the mixer options, such as sharpen and especially deinterlacing, are ignored. This also breaks automatic enabling of interlacing with 'D' or --deinterlace. These issues will be fixed later in the following commits. Note that we keep all the custom vdpau queue stuff. This will also be simplified later.
* vo_opengl: make it work with vf_vdpauppwm42014-05-021-50/+8
| | | | | | | This uses mp_vdpau_mixer_render(). The benefit is that it makes vdpau deinterlacing just work. One additional minor advantage is that the video mixer creation code is factored out (although that is a double- edged sword).
* vf_vdpaupp: allow non-vdpau inputwm42014-05-021-5/+42
| | | | | | | So you can use vdpau deinterlacing without using vdpau hardware decoding. vf_vavpp does something similar.
* vdpau: add a postprocessing pseudo-filterwm42014-05-024-0/+550
| | | | | | | | | | | This factors out some code from vo_vdpau.c, especially deinterlacing handling. The intention is to use this for vo_vdpau.c to make the logic significantly easier, and to use it for vo_opengl (gl_hwdec_vdpau.c) to allow selecting deinterlace and postprocessing modes. As of this commit, the filter actually does nothing, since both vo_vdpau and vo_opengl treat the generated images as normal vdpau images. This will change in the following commits.
* vo: document draw_imagewm42014-04-301-0/+6
|
* vo_lavc: remove code with no effectwm42014-04-301-1/+0
| | | | This field will also removed in the future.
* video: improve error messageswm42014-04-301-1/+1
|
* vf: print error if filtering a frame failswm42014-04-301-1/+4
| | | | | The filters don't always print an error on their own, and printing an error is better than silently dropping the frame.
* vf_lavfi: reset metadata in reset()Kevin Mitchell2014-04-291-0/+4
| | | | | | It might have been nice not to do this so that metadata could accumulate accross seeks, but it seems libavfilter looses its copy anyway on recreate_graph.
* vf-metadata: fix handling of NULL metadataKevin Mitchell2014-04-291-4/+7
| | | | | | lavfi would segfault due to a NULL dereference if it was asked for its metadata and none had been allocated (oops). This happens for libav which has no concept of filter metadata.
* video: remove redundant mp_image display_w/_h memberswm42014-04-293-18/+6
| | | | | | | | | | | | | | | | | Commit 5e4e248 added a mp_image_params field to mp_image, and moved many parameters to that struct. display_w/h was left redundant with mp_image_params.d_w/d_h. These fields were supposed to be always in sync, but it seems some code forgot to do this correctly, such as vf_fix_img_params() or mp_image_copy_attributes(). This led to the problem in github issue #756, because display_w/_h could become incorrect. It turns out that most code didn't use the old fields anyway. Just remove them. Note that mp_image_params.d_w/d_h are supposed to be always valid, so the additional checks for 0 shouldn't be needed. Remove these checks as well. Fixes #756.
* vo_vdpau: let vdpau scale anamorphic screenshotswm42014-04-291-8/+4
| | | | | | | In theory, returning the screenshot with original pixel aspect would allow avoiding scaling them with image formats that support non-square pixels, but in practice this isn't used anyway (nothing seems to understand e.g. jpeg aspect ratio tags).
* vf_vapoursynth: add more VS frame propertieswm42014-04-281-0/+26
| | | | | | | We only support them for input. The frame properties of output frames are ignored (except frame durations). Properties not set for now: _ChromaLocation, _Field, _FieldBased
* vf_vapoursynth: use frame durations instead of _AbsoluteTimewm42014-04-281-6/+25
| | | | | | | | | | | | | Set _DurationNum/_DurationDen on each VS frame, instead of _AbsoluteTime. The duration is the difference between the timestamp of the frame and the next frame, and when receiving filtered VS frames, we convert them back to an absolute PTS by summing them. We pass the timestamps with microsecond resolution. mpv uses double for timestamps internally, so we don't know the "real" timebase or FPS. VS on the other hand uses fractions for frame durations. We can't pass through the numbers exactly, but microseconds ought to be enough to be even safe from accumulating rounding errors.
* vf_vapoursynth: fix memory leak on errorwm42014-04-281-1/+3
| | | | | | Since this leaks video images, and the player keeps feeding new images to the fitler even if it fails, this would probably have disastrous consequences.
* vf_vapoursynth: remove incorrect copyright noticewm42014-04-281-2/+0
| | | | | This file merely started out by copy&pasting vf_lavfi.c and removing everything to have a basic skeleton.
* vf_lavfi: distinguish real errors from other stateswm42014-04-281-2/+11
| | | | Don't just hide real errors, should a filter return them.
* video: don't drop last frame when deinterlacing with yadifwm42014-04-287-6/+32
| | | | | | | | | | | | | | | | | | Or in other words, add support for properly draining remaining frames from video filters. vf_yadif is buffering at least one frame, and the buffered frame was not retrieved on EOF. For most filters, ignore this for now, and just adjust them to the changed semantics of filter_ext. But for vf_lavfi (used by vf_yadif), real support is implemented. libavfilter handles this simply by passing a NULL frame to av_buffersrc_add_frame(), so we just have to make mp_to_av() handle NULL arguments. In load_next_vo_frame(), we first try to output a frame buffered in the VO, then the filter, and then (if EOF is reached and there's still no new frame) the VO again, with draining enabled. I guess this was implemented slightly incorrectly before, because the filter chain still could have had remaining output frames.
* cocoa: refactor sync scheduling to a functionStefano Pigozzi2014-04-281-14/+18
| | | | | | | | | This extracts the scheduling logic to a single function which is nicer to keep it consistent. Additionally make sure we don't schedule sync operations from a sync operation itself since that could cause deadlocks (even if it should not be happening with the current code).
* cocoa: use mainScreen as a fallback for window constrainingStefano Pigozzi2014-04-281-1/+1
|
* cocoa: disallow the titlebar to exit the visibleFrame on the bottom edgeStefano Pigozzi2014-04-281-6/+7
|
* cocoa: add constraints to prevent the window to exit the screenStefano Pigozzi2014-04-281-9/+21
| | | | | | | | Previously the window could be made to completly exit the screen with a combination or moving it close to an edge and halving it's size (via cmd+0). This commit address the problem in the most simple way possibile by constraining the window to the closest edge in these edge cases.
* cocoa: move sync section assignments in vo_controlRyan Goulden2014-04-281-4/+4
|
* cocoa: cosmetics: use NSMakeSizeRyan Goulden2014-04-281-1/+1
|
* cocoa: fix native fullscreenRyan Goulden2014-04-283-62/+71
| | | | | | | | | | | | | | | | | | | | | | | This fixes a couple of issues with the Cocoa `--native-fs` mode, primarily: - A ghost titlebar at the top of the screen in full screen: This was caused by the window constraining code kicking in during fullscreen. Simply returning the unconstrained rect from the constraining method fixes the problem. - Incorrect behavior when using the titlebar buttons to enter/exit fullscreen, as opposed to the OSD button. This was caused by mpv's internal fullscreen state going out of sync with the NSWindow's one. This was the case because `toggleFullScreen:` completely bypassed the normal event flow that mpv expects. Signed-off-by: Ryan Goulden <percontation@gmail.com> Change style for mpv, simplify and refactor some of the constraining code. Signed-off-by: Stefano Pigozzi <stefano.pigozzi@gmail.com>
* vf_vapoursynth: use official AbsoluteTime propertywm42014-04-271-2/+2
| | | | | | | | I thought the "_" in "_AbsoluteTime" was part of the documentation markup. This still doesn't help us with VS filters that change timing; apparently you must use frame durations instead.
* vf_vapoursynth: keep pixel aspect ratiowm42014-04-271-3/+3
| | | | | | | | | | | | Make the filter apply the pixel aspect ratio of the input to the output. This is more useful than forcing 1:1 PAR when playing anamorphic video such as DVDs. VapourSynth itself actually allows passing through the aspect ratio, but it's in a not very useful form for us: it's per video-frame instead of constant (i.e in VSVideoInfo). As long as we don't have a way to allow a filter to spontaneously change output parameters, we can't use this. (And I don't really feel like making this possible.)
* Revert "wayland: print waylands display erros"Alexander Preisinger2014-04-261-39/+0
| | | | | | | | | | | | This reverts commit 6e34b0ec1f50612cb2767da3dbc27be0be63041d. There has always been an error message "proxy already has a listener" and I couldn't reproduce where it is comming from until now. The display interface already has a listener and we can't overwrite it. Now remove the code and avoid this error message. Conflicts: video/out/wayland_common.c
* vf_pp: PP_PICT_TYPE_QP2 is always definedwm42014-04-251-4/+0
|
* vo: do not check for events on unconfigured VOMartin Herkt2014-04-251-1/+3
| | | | fixes #741
* video: add a "hwdec" property to enable or disable hw decoding at runtimewm42014-04-233-0/+11
|
* vo: simplify event_fd handlingwm42014-04-222-22/+13
| | | | | | Add the event FD after preinit, remove it before destroy. There's no need to do it on vo_config, and there's no need to remove the event FD when vo_config fails.
* vo: cosmetics: move around some codewm42014-04-221-134/+136
| | | | Group together related functionality.
* vo: minor cosmetic changewm42014-04-221-2/+1
|
* vf: print all image parameter information in verbose outputwm42014-04-221-0/+5
|
* vo: warn if the VO doesn't support certain flagswm42014-04-221-1/+15
| | | | | | | | | Unfortunately, if a VO can't display something as intended, we can just complain to the user, and leave it at it. But it's still better than silently displaying things differently with different VOs. For now, this is used for rotation only. Other things that we should check includes colorspace and colorlevels stuff.
* vf: remove autoinserted filters on reconfigwm42014-04-212-0/+8
| | | | | | | When using rotation with hw decoding, and the VO does not support rotation, vf_rotate is attempted to be inserted. This will go wrong, and after that it can't recover because a vf_scale filter was autoinserted. Just removing all autoinserted filters before reconfig fixes this.
* vf: add function to remove a filter from the chainwm42014-04-212-0/+14
|
* vo_opengl: support rotationwm42014-04-212-15/+48
| | | | | | | | | | | This turned out much more complicated than I thought. It's not just a matter of adjusting the texture coordinates, but you also have to consider separated scaling and panscan clipping, which make everything complicated. This actually still doesn't clip 100% correctly, but the bug is only visible when rotating (or flipping with --vf=flip), and using something like --video-pan-x/y at the same time.
* vo: add some general support code for VOs that allow rotationwm42014-04-214-12/+30
| | | | | | For rotation, we assume that the source image will be rotated within the VO, so the aspect/panscan code needs to calculate its param using rotated coordinates. VOs which support rotation natively can use this.
* vo_opengl: clean up rendering pathwm42014-04-211-76/+94
| | | | | Shuffle the special cases around so that it looks cleaner. The result should be equivalent to the code before.
* demux: export video rotation parameterwm42014-04-211-0/+1
| | | | | Now the rotation hint is propagated everywhere. It just isn't used anywhere yet.
* mp_image: add rotation parameterwm42014-04-212-1/+4
|
* video: make mp_image use mp_image_params directlywm42014-04-215-69/+37
| | | | | Minor cleanup, so that we can stuff more information into mp_image_params later.
* vf_rotate: support all multiples of 90 degreeswm42014-04-212-92/+23
| | | | | | | | | | | | | This couldn't rotate by 180°. Add this, and also make the parameter in degrees, instead of magic numbers. For now, drop the flipping stuff. You can still flip with --vf=flip or --vf=mirror. Drop the landscape/portrait stuff - I think this is something almost nobody will use. If it turns out that we need some of these things, they can be readded later. Make it use libavfilter. Its vf_transpose implementation looks pretty simple, except that it uses slice threading and should be much faster.
* Fix some libav* include statementswm42014-04-196-13/+13
| | | | | | | | | | | | | Fix all include statements of the form: #include "libav.../..." These come from MPlayer times, when FFmpeg was somehow part of the MPlayer build tree, and this form was needed to prefer the local files over system FFmpeg. In some cases, the include statement wasn't needed or could be replaced with mpv defined symbols.
* Remove CPU detection and inline asm handlingwm42014-04-191-2/+5
| | | | | | | | | | | | | | Not needed anymore. I'm not opposed to having asm, but inline asm is too much of a pain, and it was planned long ago to eventually get rid fo all inline asm uses. For the note, the inline asm use that was removed with the previous commits was almost worthless. It was confined to video filters, and most video filtering is now done with libavfilter. Some mpv filters (like vf_pullup) actually redirect to libavfilter if possible. If asm is added in the future, it should happen in the form of external files.
* vf_pp: fix include statementwm42014-04-191-1/+1
|
* vf_pp: use native libpostproc CPU detectionwm42014-04-191-5/+1
|
* vf_divtc: remove inline asmwm42014-04-191-50/+0
| | | | | | Becomes a bit slower (tested with progressive solid color video only), but this filter is pretty obscure and I'm not even sure what it's useful for.
* vf_pullup: remove inline asmwm42014-04-193-218/+0
| | |