summaryrefslogtreecommitdiffstats
path: root/libvo/vo_vdpau.c
Commit message (Collapse)AuthorAgeFilesLines
* debug output: reduce verbosity of some frequent messagesUoti Urpala2011-07-051-5/+4
| | | | | Drop from frequent (per-frame) messages from DBG2 to DBG3. Drop VDPAU clock adjustment messages from V to DBG2.
* sub/OSD: move some related files to sub/Uoti Urpala2011-01-261-3/+3
|
* cleanup: some random minor code simplification and cleanupUoti Urpala2011-01-261-1/+1
|
* vo_vdpau: allow "deint=-N" to specify mode without enabling deintUoti Urpala2011-01-041-3/+7
| | | | | | | | | Allow negative values of the "deint" parameter and make them select the same deinterlacing mode as the corresponding positive value, but without enabling deinterlace on startup. This is useful for configuration files. Also tweak the overall manpage description of vo_vdpau a bit to make it sound less as if the VO would be for hardware acceleration only.
* cosmetics: remove unused code, small formatting tweaksUoti Urpala2010-12-201-6/+6
|
* vo_vdpau: remove wrong mp_image usage_count change (no visible effect)Uoti Urpala2010-12-131-1/+1
| | | | | | | The wrong variable was used as a function argument, and as a result the code modified the usage_count field of non-refcounted mp_image types. This error did not have any effect on visible behavior as no code cares about the field value in the affected case.
* vo_vdpau: fix indentation of some switch statementsUoti Urpala2010-11-021-49/+49
|
* vo_vdpau: add extra check for unknown image formatUoti Urpala2010-11-021-2/+4
| | | | | | | | | Add a default case for unknown image format in create_vdp_decoder. I think this condition shouldn't currently happen, but it's worth a sanity check. Avoids a compiler warning about vdp_decoder_profile being possibly used uninitialized. Also remove an obsolete #ifdef (should always be true now).
* vo_vdpau: fix loop initializing output surfaces as invalidUoti Urpala2010-05-261-5/+10
| | | | | | | | | | | | | The loop initializing handles in the output surface table to VDP_INVALID_HANDLE ran over indices from 0 to vc->num_output_surfaces. However it is first called before that variable is initialized. As a result later code could try to destroy the handles which still had the "non-invalid" value 0. Most likely this caused no visible effects; at least on my machine no valid surface gets handle 0, and libvdpau just returns an error for the resulting invalid calls. Change the code to loop over the whole table. Also add code to print visible warnings if libvdpau rejects a surface destroy call (some other places already had checks but not all).
* vo_vdpau: support queuing an arbitrary number of frames aheadUoti Urpala2010-05-141-37/+56
| | | | | | | | | | | | Make the number of output surfaces allocated by vo_vdpau configurable and allow queuing multiple future frames with the VDPAU frame timing functionality. There are two known issues that could be polished in the future for particularly long queue time cases. First, toplevel code should possibly wait for the queued changes to finish displaying in some situations like switching files. Second, the VO can block waiting for a surface to become available, and in the worst case this wait can be almost as long as the maximum queuing time (potentially causing audio underruns). However those issues are not high priority.
* vo_vdpau: add option for studio level outputUoti Urpala2010-05-121-0/+15
| | | | | | | Add -vo vdpau suboption "studio" to produce output in RGB range 16-235. Man page description mostly taken from a patch by Lauri Mylläri (but not code). Also slightly tweak the description of two other suboptions on the man page.
* vdpau: drop support for old versionsUoti Urpala2010-05-111-5/+0
| | | | | | | | Since I dropped the hack to support older libvdpau versions (without MPEG4 / hqscaling features) from the FFmpeg version used in the build repo it's better to disable those libvdpau versions in MPlayer too. Change the configure check to require a newer libvdpau version, and drop compatibility code in vo_vdpau.c.
* vo_vdpau.c cosmetics: add WRAP_ADD macroUoti Urpala2010-05-061-6/+9
| | | | | The macro is meant to simplify the handling of some code dealing with circular buffers.
* build/vdpau: drop support for dynamic loading of libvdpauUoti Urpala2010-02-261-26/+2
| | | | | | | | | | After a recent library update on my system MPlayer started crashing on exit in XCloseDisplay() if -vo vdpau had been used. With normal linking it works OK. Since there should be little need for the dynamic loading functionality any more, I'll just drop it rather than try investigating the exact problem with dynamic loading and whether it would be fixable. VDPAU is now linked normally with -lvdpau if available.
* vo_vdpau: improve VOCTRL_GET_EOSD_RES codeUoti Urpala2010-02-261-10/+4
| | | | | | | | Remove the special case for fullscreen; the same variables should have the correct values in windowed and fullscreen modes. This fixes libass subtitle positioning in the (non-typical) case where you have black bands inside a window. Behavior in fullscreen and in the typical windowed case without borders should not be affected.
* vo_vdpau: make queuing future frame flips adjustableUoti Urpala2010-02-051-0/+8
| | | | | | | | | | Add -vo vdpau suboptions "queuetime_windowed" and "queuetime_fs" to specify the maximum number of milliseconds how far into the future a frame flip can be queued using the VDPAU presentation queue functionality. The intended main use of these options is to allow disabling use of the queuing feature on systems where using it causes choppiness in other graphics behavior (this is an NVIDIA driver issue; the video itself isn't affected).
* vo_vdpau.c: Fix compilation with old libvdpau versionsUoti Urpala2009-11-291-2/+2
| | | | | | | Misplaced #endif broke compilation with old libvdpau versions that lack VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1 #define. Also add missing space to the text in related mp_msg() call.
* vo_vdpau: Check return value when setting video mixer featuresUoti Urpala2009-11-171-3/+6
|
* cosmetics: remove some unused variablesUoti Urpala2009-11-171-1/+0
|
* vo_vdpau: Check return value when setting video attributesUoti Urpala2009-11-171-24/+24
| | | | | | | Check the return value when setting any video mixer attribute and print an error message if the operation failed. Also simplify code by changing update_csc_matrix() to use the utility function added for this.
* Support VDPAU MPEG4 hardware decodingUoti Urpala2009-11-161-0/+6
| | | | Original patch by NVIDIA.
* vo_vdpau: Remove custom help messageUoti Urpala2009-11-161-24/+7
| | | | | | | | | | Remove the help text explaining -vo vdpau suboptions that was printed in case of parsing errors. It did perhaps have some value, but there are also reasons to remove it: it was printed in an ugly manner in the middle of output, most other MPlayer options do not have such internal help texts either, and it was detailed enough that it required maintaining documentation about the options in two separate places (the man page and the help message).
* vo_vdpau: Add support for high-quality scaling featureUoti Urpala2009-11-151-2/+24
| | | | | | | Part of the code is currently under #ifdef to allow compilation with older VDPAU library versions; that can be removed later. Partially based on a patch by Carl Eugen Hoyos.
* vo_vdpau: add support for VFCAP_FLIPUoti Urpala2009-11-151-3/+6
| | | | Patch by Carl Eugen Hoyos.
* vo_vdpau: Free buffers allocated by FFmpeg on uninitUoti Urpala2009-11-151-0/+4
|
* Add yuv_colorspace property, implemented in vo_vdpau and vo_xvUoti Urpala2009-11-151-14/+45
| | | | | | | | | | | | | | | | Add a property to select YUV colorspace. Currently implemented only in vo_vdpau and vo_xv. Allows switching between BT.601, BT.709 and SMPTE-240M (vdpau only). The xv support uses the "XV_ITURBT_709" attribute. At least my NVIDIA card supports that; I don't know whether other xv implementations do. Bind the colorspace switch to the 'c' key by default. 'c' is currently used by vo_sdl for some fullscreen mode change thing, but at the moment that does not conflict and if it will in the future then vo_sdl can change. VDPAU part based on a patch from Lauri Mylläri <lauri.myllari@gmail.com>
* Implement vsync-aware frame timing for VDPAUUoti Urpala2009-11-151-13/+217
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Main things added are custom frame dropping for VDPAU to work around the display FPS limit, frame timing adjustment to avoid jitter when video frame times keep falling near vsyncs, and use of VDPAU's timing feature to keep one future frame queued in advance. NVIDIA's VDPAU implementation refuses to change the displayed frame more than once per vsync. This set a limit on how much video could be sped up, and caused problems for nearly all videos on low-FPS video projectors (playing 24 FPS video on a 24 FPS projector would not work reliably as MPlayer may need to slightly speed up the video for AV sync). This commit adds a framedrop mechanism that drops some frames so that no more than one is sent for display per vsync. The code tries to select the dropped frames smartly, selecting the best one to show for each vsync. Because of the timing features needed the drop functionality currently does not work if the correct-pts option is disabled. The code also adjusts frame timing slightly to avoid jitter. If you for example play 24 FPS video content on a 72 FPS display then normally a frame would be shown for 3 vsyncs, but if the frame times happen to fall near vsyncs and change between just before and just after then there could be frames alternating between 2 and 4 vsyncs. The code changes frame timing by up to one quarter vsync interval to avoid this. The above functionality depends on having reliable vsync timing information available. The display refresh rate is not directly provided by the VDPAU API. The current code uses information from the XF86VidMode extension if available; I'm not sure how common cases where that is inaccurate are. The refresh rate can be specified manually if necessary. After the changes in this commit MPlayer now always tries to keep one frame queued for future display using VDPAU's internal timing mechanism (however no more than 50 ms to the future). This should make video playback somewhat more robust against timing inaccuracies caused by system load.
* vo_vdpau: Modify frame buffering codeUoti Urpala2009-11-151-54/+77
| | | | | | | | | | | | | | Clean up code related to frame buffering and generate pts information also for the next frame in the output queue. The timing information will be used in a following framedrop patch. This commit adds one frame of buffering delay in vo_vdpau and increases the number of buffered vdpau video surfaces from 3 to 4. The delay increase makes it more important to fix remaining code in MPlayer that doesn't deal well with filter/VO delay; OTOH it should help any decoding/filtering parallelism in the underlying VDPAU implementation as now filtering a frame for display can happen while the next one is being decoded.
* cosmetics: Add two missing "static"Uoti Urpala2009-10-221-1/+1
| | | | Add missing 'static' to internal functions in vo_xv.c and vo_vdpau.c.
* vo_vdpau: Fix X event handling bugsUoti Urpala2009-09-191-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | check_events() first checked for a RESIZE event and called resize() if needed, and then queued a frame to be reshown if in pause state and the event was either RESIZE or EXPOSE. The most obvious problems with the code were: - resize() already called flip_page() internally, so the code in check_events could lead to _two_ frames being queued. - The call in resize() didn't depend on pause status, so the behavior was inconsistent. - The code in check_events() actually queued the wrong output surface. It showed the same surface as flip_page() would show _next_, while it should have shown the previously shown one. This typically led to the screen contents changing to a previous state, as the new surface had not been initialized and had contents from a previous use. Fix the double update. Make resize() also only immediately update the video if paused (this also affects changing to/from fullscreen) and otherwise leave the old window contents be until the next frame. Queue the right frame in check_events(). Also make resize() a bit more careful to only show contents if they were successfully updated (though a case where we're paused without content to show shouldn't normally happen).
* core/VO: Allow VO drivers to add/modify framesUoti Urpala2009-09-181-72/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add interfaces to allow VO drivers to add or remove frames from the video stream and to alter timestamps. Currently this functionality only works with in correct-pts mode. Use the new functionality in vo_vdpau to properly support frame-adding deinterlace modes. Frames added by the VDPAU deinterlacing code are now properly timed. Before every second frame was always shown immediately (probably next monitor refresh) after the previous one, even if you were watching things in slow motion, and framestepping didn't stop at them at all. When seeking the deinterlace algorithm is no longer fed a mix of frames from old and new positions. As a side effect of the changes a problem with resize events was also fixed. Resizing calls video_to_output_surface() to render the frame at the new resolution, but before this function also changed the list of history frames, so resizing could give an image different from the original one, and also corrupt next frames due to them seeing the wrong history. Now the function has no such side effects. There are more resize-related problems though that will be fixed in a later commit. The deint_mpi[] list of reserved frames is increased from 2 to 3 entries for reasons related to the above. Having 2 entries is enough when you initially get a new frame in draw_image() because then you'll have those two entries plus the new one for a total of 3 (the code relied on the oldest mpi implicitly staying reserved for the duration of the call even after usage count was decreased). However if you want to be able to reproduce the rendering outside draw_image(), relying on the explicitly reserved list only, then it needs to store 3 entries.
* VO interface: Remove obsolete draw_frame() from new interfaceUoti Urpala2009-09-171-6/+0
|
* vo_vdpau: Support recovering from VDPAU display preemptionUoti Urpala2009-09-071-61/+165
| | | | | | | Add code to reinitialize all VDPAU objects if a display preemption condition occurs. Reinitializing them in the middle of playback will cause video corruption at least until the next keyframe when using hardware decoding, but decoding does seem to recover after a keyframe.
* vo_vdpau: Support updating OSD while pausedUoti Urpala2009-09-051-0/+6
|
* vo_vdpau.c: Reindent control() switch statementUoti Urpala2009-09-051-77/+76
|
* vo_vdpau: Allocate one large surface for EOSD contentUoti Urpala2009-09-051-78/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create a single large bitmap surface for EOSD objects and pack all the bitmap rectangles inside that. The old code created a separate bitmap surface for every bitmap and then resized the cached surfaces when drawing later frames. The number of surfaces could be large (at least about 2000 for one sample subtitle script) so this was very inefficient. The old code also used a very simple strategy for pairing existing surfaces to new bitmaps; it could resize tiny surfaces to hold large glyphs while using existing large surfaces to hold tiny glyphs and as a result allocate arbitrarily much more total surface area than was necessary. The new code only supports using a single surface, freeing it and allocating a larger one if necessary. It would be possible to support multiple surfaces in case of hitting the maximum bitmap surface size, but I'll wait to see if that is actually needed before implementing it. NVIDIA seems to support bitmap surface sizes up to 8192x8192, so it would take either a really pathological subtitle script rendered at a high resolution or an implementation with lower limits before multiple surfaces would be necessary. The packing algorithm should successfully pack the bitmaps into a surface of size w*h as long as the total area of the bitmaps does not exceed 16/17 (w-max_bitmap_width)*(h-max_bitmap_height), so there should be no totally catastrophic failure cases. The 16/17 factor comes from approximate sorting used in the algorithm. On average performance should be better than this minimum guaranteed level.
* Merge branch 'vdpau_old' into vdpauUoti Urpala2009-08-311-684/+757
|\
| * vo_vdpau.c: cosmeticsUoti Urpala2009-08-291-198/+258
| |
| * vo_vdpau: reindent after GUI code removalUoti Urpala2009-08-291-30/+28
| |
| * vo_vpdau: Clean up uninit logicUoti Urpala2009-08-291-52/+54
| |
| * vo_vdpau: Make CHECK_ST macro saferUoti Urpala2009-08-291-41/+51
| | | | | | | | Also contains a couple of changes in destroy_vdpau_objects.
| * vo_vdpau: Move all remaining static/global variables to contextUoti Urpala2009-08-291-103/+103
| |
| * vo_vdpau: Move things to context structUoti Urpala2009-08-291-254/+257
| |
| * vo_vdpau: Make info struct constUoti Urpala2009-08-291-1/+1
| |
| * vo_vdpau: Replace global function table with context variableUoti Urpala2009-08-291-91/+148
| |
| * vo_vdpau: Move VDPAU interface pointers into one structUoti Urpala2009-08-291-53/+55
| | | | | | | | | | | | Replace a bunch of vdp_* function pointer variables with one struct. A variable that was before named "vdp_xyz" is now the struct field "vdp.xyz".
| * vo_vdpau: Add template file for VDPAU functionsUoti Urpala2009-08-291-86/+7
| | | | | | | | | | | | | | | | Add a template file that contains a single listing of various information needed about the VDPAU interface functions, and is then included multiple times to create required declarations and tables. Previously some of the information needed to be duplicated for each of those uses.
| * vo_vdpau: Make compile as new-style VOUoti Urpala2009-08-291-78/+97
| |
| * vo_vdpau: Delete GUI stuff, include font_load.h for force_load_fontUoti Urpala2009-08-291-8/+1
| | | | | | | | font_load.h was previously included through gui/interface.h
* | Change type names to match upstream libassGrigori Goronzy2009-08-071-2/+2
| |
* | Remove internal libass treeUoti Urpala2009-07-261-2/+1
| | | | | | | | | | Remove the libass/ directory and use the newest standalone version of the library instead.
* | Remove the internal GUIAnton Khirnov2009-07-071-9/+1
| | | | | | | | | | | | | | | | | | The GUI is badly designed and too closely coupled to the internal details of other code. The GUI code is in bad shape and unmaintained for years. There is no indication that anyone would maintain it in the future either. Even if someone did volunteer to implement a better integrated GUI having the current code in the tree probably wouldn't help much. So get rid of it.
* | Remove trailing whitespace from most filesUoti Urpala2009-07-071-1/+1
|/
* Merge svn changes up to r29277Uoti Urpala2009-05-081-1/+3
|\
| * Do not use flag CWBackPixel when calling vo_x11_create_vo_window():cehoyos2009-05-081-1/+3
| | | | | | | | | | | | | | | | | | It leads to VDPAU errors after video aspect ratio changes. Patch by Stephen Warren. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29276 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge branch 'ordered_chapters'Uoti Urpala2009-04-081-1/+0
|\ \
| * | VO: Don't reset pause status in VO config() functionsUoti Urpala2009-04-021-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Many VOs kept track of pause status, but reset the value when their config() function was called. However it can be called while playback stays in pause mode. Modify the VOs to not change anything in config(). Also send the VO either VOCTRL_PAUSE or VOCTRL_RESUME when the playback of a new file is starting to make sure they have the right status.
* | | Merge svn changes up to r29117Uoti Urpala2009-04-011-55/+152
|\ \ \ | |/ / |/| / | |/
| * Support IMGFMT_NV12 for vo vdpau.cehoyos2009-03-301-0/+6
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29109 b3059339-0415-0410-9bf9-f77b7e298cf2 </