GNOME Bugzilla – Bug 306292
[PATCH] move some xshm code from ximagesrc.c to ximageutil.c and add xshm support to ximagesrc
Last modified: 2005-12-18 21:45:47 UTC
This patch does some thing: - add ximageutil.c and ximageutil.h - move some xshm util code from ximagesrc to ximageutil - add xshm support to ximagesrc I've done this work hoping that it'll improve ximagesrc's performance but i was wrong :/ So i'm not going to apply this patch, i'm adding this to bugzilla so my work won't be lost. Maybe a day it'll be usefull.. btw, the patch is not finished, some things that need to be done: - free the bufferpool - better bufferpool management - test ximagesrc w/o xshm
Created attachment 47151 [details] [review] first not finished patch
marking as WONTFIX because xshm doesn't make ximagesrc faster (at least in my pc).
Then you're doing it wrong. :)
It's really possible! :) I'm definitily not a X guru.. If you (or someone else) want to try to improve (or fix) the patch.. feel free to do it!! I've attached it here and not just deleted it for this reason..
I've just found this: http://lists.freedesktop.org/pipermail/xorg/2005-April/007266.html So.. can someone with a good video card test the patch? (my desktop has a voodoo3 card..) See cpu usage before and after the patch using: gst-launch-0.8 ximagesrc ! video/x-raw-rgb,framerate=10.0 ! fakesink Reopening the bug. I'll fix all the patch issues if someone can see an improvement.
Created attachment 47204 [details] [review] second not finished patch gstreamer moves too fast ;) new patch against current cvs.
It definitely makes it faster, I can run at 5-10 FPS. The old could run at 1-2 FPS at best. However... You broke colors, too. :). I don't know why yet...
Old: /pipeline0/ximagesrc0.src: caps = video/x-raw-rgb, bpp=(int)32, endianess=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)1680, height=(int)1050, framerate=(double)1, depth=(int)24, endianness=(int)4321 New: /pipeline0/ximagesrc0.src: caps = video/x-raw-rgb, bpp=(int)32, endianess=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)1680, height=(int)1050, framerate=(double)1, depth=(int)24, endianness=(int)4321 So the mask swapped from xRGB to BGRx or the other way around. Please fix that before applying.
Created attachment 47764 [details] [review] updated patch New patch. Features: * implement xshm in ximagesrc (performance gain) * moves some useful code from ximagesink to ximageutil.[ch] * fix some bugs in ximagesrc (for ex. display property) * make ximagesrc uses functions in ximageutil.[ch] * add a bufferpool to ximagesrc (performance gain) * fix some memory leak in ximagesrc Adding support for capturing a window and not the whole display should be easier now. It should also work w/o xshm but i've not tested it.. if someone can test and report it :) The patch is quite big so i would like to have some testing before commiting.. (both ximagesrc and ximagesink). to BBB: i can't reproduce your bug but maybe i've fixed it :) can you test? thanks!
See also bug #304795, about porting ximagesrc to 0.9. Let's keep this bug open (or a bug) until this makes it into HEAD.
Because it seems ximagesrc and ximagesink will end up in different modules this file will need to be put in both modules. Adding Julien to cc because he's working on this right now.
I am not going to use those files. So please just commit your stuff in gst-plugins-bad when you are happy enough with your port of ximagesrc.
ok i ll apply that to -bad myself
So we have 2 bugs for the same thing i m going to close this one and check tomorrow how to grab the correct ported code that can go in gst-plugins-bad. This patch is obsolete because there won't be code shared between ximagesink and ximagesrc.