[MPlayer-dev-eng] [PATCH] ggi osd support corrected, and page flipping added
Ivan Kalvachev
ikalvachev at gmail.com
Sun Jul 2 09:29:54 CEST 2006
2006/7/2, spdepagn at ncsu.edu <spdepagn at ncsu.edu>:
> Hi, I corrected the osd code so it does the correct thing without memory
> poking.
>
> I also noticed shearing effects when watching movies with fast action, so
> I added support so ggi creates two video frames and implements page
> flipping. If ggi cannot allocate two full frames, it defaults to one
> frame. I tested this and the shearing effects are gone. I tested
> allocation by allocating more pages than my video card supported to make
> sure it caught this.
>
> I also added support for the keys 1, 2, 3, 4 so that brightness and
> contrast can be adjusted.
>
> I tried to create the patch from a level so you can use
> patch < mplayer_ggi.patch
+static void draw_alpha(int x, int y, int w, int h, unsigned char *src,
+ unsigned char *srca, int stride) {
+ int bytespp = (vo_dbpp + 1) >> 3;
+ char box[w*h*bytespp];
+
+ ggiGetBox(ggi_conf.drawvis, vo_dx + x, vo_dy + y, w, h, box);
+ switch (vo_dbpp) {
+ case 32:
+ vo_draw_alpha_rgb32(w, h, src, srca, stride, box, w * bytespp);
+ break;
[...]
+ }
+ ggiPutBox(ggi_conf.drawvis, vo_dx + x, vo_dy + y, w, h, box);
+}
1. allocating image buffer in the stack is not recommended at all.
Especally when you multiply 3 variables with random values. Better
malloc a buffer at config() time.
2. If I understand your code correctly you are coping the drawn area
in local buffer, draw subtitles and then put it back in the buffer.
Somehow I don't think this is very optimal...
(if we assume that ggi access directly video memory, then we know that
old pci cards and all agp cards are much faster on writing to video
memory than reading from it).
More information about the MPlayer-dev-eng
mailing list