After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 354773 - xvimage assumes that XV_COLORKEY can be set in RGB888 format
xvimage assumes that XV_COLORKEY can be set in RGB888 format
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Windows
: Normal normal
: 0.10.11
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-09-07 14:31 UTC by Stefan Sauer (gstreamer, gtkdoc dev)
Modified: 2006-09-21 13:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
imlement colorkeying change (563 bytes, patch)
2006-09-07 14:37 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
none Details | Review
better version of the patch (1.09 KB, patch)
2006-09-18 11:24 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
none Details | Review

Description Stefan Sauer (gstreamer, gtkdoc dev) 2006-09-07 14:31:54 UTC
current implementation always assumes that XV_COLORKEY can be set in RGB888 format. However, in our gfx hardware the colorkey value is RGB565 instead. The element should check "max_value" range and set the attribute value accordingly.
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2006-09-07 14:37:23 UTC
Created attachment 72373 [details] [review]
imlement colorkeying change
Comment 2 Wim Taymans 2006-09-13 09:49:47 UTC
even better would be to detect the depth of the display and generate a tripplet based on the RGB masks. Also add a ckey = CLAMP (ckey, attr[i].min_value, attr[i].max_value);  to make sure it never sets something impossible.
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2006-09-18 11:24:07 UTC
Created attachment 72975 [details] [review]
better version of the patch

Not sure whats the best way to gte the depth and calculate the key from the masks.
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2006-09-18 12:00:32 UTC
would that be good?

        int ckey=0;

        switch(xcontext->depth) {
          case 15:
            ckey=(1<<10)|(2<<5)|3;
            break;
          case 16:
            ckey=(1<<11)|(2<<5)|3;
            break;
          case 24:
          case 32:
            ckey=(1<<16)|(2<<8)|3;
            break;
          default:
            GST_WARNING("unsupported color depth");
            break;
        }
Comment 5 Wim Taymans 2006-09-18 12:06:43 UTC
I think that would be acceptable for now, the main problem is to make sure it does not set invalid values, the exact color can be anything and is irrelevant.
Comment 6 Daniel Stone 2006-09-19 17:12:27 UTC
NACK to the patch in comment #4.  switching based on the display's depth is bogus, as it's perfectly common to have an RGB565 display that still expects a colour key in RGB888.  indeed, the only reason we never hit this is because everyone else on the planet always takes an RGB888 colour key.

the only sane way to do this is to key off max_value on the XV_COLORKEY attribute, which tells you exactly how many bits you have for the colour key.
Comment 7 Daniel Stone 2006-09-19 17:13:10 UTC
(the one in comment #3 is perfectly reasonable.)
Comment 8 Stefan Sauer (gstreamer, gtkdoc dev) 2006-09-21 13:16:00 UTC
I've changed it back in cvs