[gstreamer-bugs] [Bug 587443] New: gstffmpegcodecmap.c: fix to RGB24->I420 wrong color / endian problem

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Tue Jun 30 09:51:52 PDT 2009


If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=587443

  GStreamer | gst-plugins-base | Ver: 0.10.23
           Summary: gstffmpegcodecmap.c: fix to RGB24->I420 wrong color /
                    endian problem
           Product: GStreamer
           Version: 0.10.23
          Platform: Other
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-base
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: hcoin at quietfountain.com
         QAContact: gstreamer-bugs at lists.sourceforge.net
     GNOME version: Unversioned Enhancement
   GNOME milestone: Unspecified


A webcam producing RGB24 was verified to produce accurate snapshots.  However
outputting through ffmpegcolorspace to xvimagesink suffered wrong colors / bad
colors , specifically blue / red reversal as it gets converted to I420
colorspace.   For instance:

gst-launch-0.10 -v v4lsrc device=/dev/video1 ! 
video/x-raw-rgb,width=640,height=480,bpp=24 !  ffmpegcolorspace ! xvimagesink 

on little endian machines would always produce accurate images except for red /
blue being swapped.  I noticed this first on Debian lenny and also in Debian
testing / squeeze

This fix corrects the issue.

--- gstffmpegcodecmap.c 2009-04-01 06:49:11.000000000 -0500
+++ /home/library/dvl/slidesaver/gstffmpegcodecmap.c    2009-06-30
11:21:06.000000000 -0500
@@ -695,7 +695,11 @@
             }
             break;
           case 24:
+#if (G_BYTE_ORDER == G_BIG_ENDIAN)
             if (rmask == 0x0000FF)
+#else
+            if (rmask == 0xFF0000)
+#endif
               context->pix_fmt = PIX_FMT_BGR24;
             else
               context->pix_fmt = PIX_FMT_RGB24;


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=587443.




More information about the Gstreamer-bugs mailing list