ssvb/xf86-video-sunxifb — pull request #13 by hglm (2013-07-20 12:36:14+00:00)
Title: Fix XV border artifacts when using gstreamer 1.0

Since version 1.0, gstreamer (when using xvimagesink) often allocates a larger XV image for the video with padding on all four sides and then calls XvPutImage() to render a part of this image. With the current XV implementation in sunxifb this results in artifacts on the borders of the image, with a green bar at the bottom.

I am observing this when playing a 1280x720 video on a 1920x1080 screen at 32bpp, the size of the video window doesn't matter.

This problem seems to be an exaggeration of the one described in https://bugzilla.gnome.org/show_bug.cgi?id=685305.

The solution appears to be to use the source area dimensions as requested in the XvPutImage() call, as opposed to the dimensions of the originally allocated image, and to honour the offsets (src_x, src_y) when setting the source region on the display controller. With this relatively simple change, the problem seems to go away, and gstreamer 1.0 (which is faster than gstreamer 0.10 due to a zero-copy strategy) provides an acceptable solution for video playback
(with NEON-optimized ffmpeg/libav being used for decoding).

Note : I am using a command line like
```
gst-launch-1.0 filesrc location=movie.mp4 ! decodebin ! xvimagesink
```

There are several media players for gstreamer, with some of them being ported from gstreamer 0.1 to gstreamer 1.0, but most have shortcomings such as using unnecesssary buffering or unnecessary intermediate processing elements that should be optimized away.

I have only tested the patch with a few gstreamer media players and with vlc, so it might need some more testing on diverse applications using xv.