[Bug 722587] New: videotestsrc does not generate correct data for GRAY16_LE and GRAY16_BE

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Mon Jan 20 00:28:36 PST 2014


https://bugzilla.gnome.org/show_bug.cgi?id=722587
  GStreamer | gst-plugins-base | 1.2.2

           Summary: videotestsrc does not generate correct data for
                    GRAY16_LE and GRAY16_BE
    Classification: Platform
           Product: GStreamer
           Version: 1.2.2
        OS/Version: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-base
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: comicfans44 at gmail.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


Created an attachment (id=266704)
 View: https://bugzilla.gnome.org/attachment.cgi?id=266704
 Review: https://bugzilla.gnome.org/review?bug=722587&attachment=266704

the patch file

when I tried to process GRAY16_LE/BE  data from videotestsrc, I found that
LE/BE data is just the same:

dump data to file:
gst-launch-1.0 videotestsrc num-buffers=1 ! video/x-raw,
format=\(string\)GRAY16_LE,width=\(int\)640, height=\(int\)480 ! filesink
location=le.bin
gst-launch-1.0 videotestsrc num-buffers=1 ! video/x-raw,
format=\(string\)GRAY16_BE,width=\(int\)640, height=\(int\)480 ! filesink
location=be.bin

no difference between them.hex looks like :  0000000: ebeb ebeb ebeb ebeb ebeb
ebeb ebeb ebeb  ................

actually there's almost no difference when display,since low byte affects very
little. 

after some digging , I found that GRAY code path
convert_hline_generic in videotestsrc.c use TO_16 just dump low byte to high
byte, 
I also found that frame->info.finfo->unpack_func seems to do
GRAY16_LE/BE->AYUV64 convert which confused me.
I tried a small hack , it can output correct GRAY16_LE/BE buffer ,but I didn't
follow every line in videotestsrc.c .

after this hack, 
GRAY16_LE dump data looks like :0000000: 00eb 00eb 00eb 00eb 00eb 00eb 00eb
00eb  ................
GRAY16_BE dump data looks like :0000000: eb00 eb00 eb00 eb00 eb00 eb00 eb00
eb00  ................


0001-fix-videotestsrc-generate-GRAY16_LE-BE-data-incorrec.patch

>From 7779afdb95c8b9243cc72fafb769caace0a937cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?"Wang=20Xin-yu=20(=E7=8E=8B=E6=98=95=E5=AE=87)"?=
 <comicfans44 at gmail.com>
Date: Mon, 20 Jan 2014 16:20:02 +0800
Subject: [PATCH] fix videotestsrc generate GRAY16_LE/BE data incorrectly bug

---
 gst/videotestsrc/videotestsrc.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gst/videotestsrc/videotestsrc.c b/gst/videotestsrc/videotestsrc.c
index 1235782..0d59bdc 100644
--- a/gst/videotestsrc/videotestsrc.c
+++ b/gst/videotestsrc/videotestsrc.c
@@ -1168,10 +1168,10 @@ convert_hline_generic (paintinfo * p, GstVideoFrame *
frame, int y)
   if (bits == 16) {
     /* 16 bits */
     for (i = 0; i < width; i++) {
-      p->tmpline_u16[i * 4 + 0] = TO_16 (p->tmpline[i * 4 + 0]);
-      p->tmpline_u16[i * 4 + 1] = TO_16 (p->tmpline[i * 4 + 1]);
-      p->tmpline_u16[i * 4 + 2] = TO_16 (p->tmpline[i * 4 + 2]);
-      p->tmpline_u16[i * 4 + 3] = TO_16 (p->tmpline[i * 4 + 3]);
+      p->tmpline_u16[i * 4 + 0] = 0xffff;
+      p->tmpline_u16[i * 4 + 1] = (p->tmpline[i * 4 + 1])<<8;
+      p->tmpline_u16[i * 4 + 2] = 0x8000;
+      p->tmpline_u16[i * 4 + 3] = 0x8000;
     }
     memcpy (dest, p->tmpline_u16, width * 8);
   } else {
-- 
1.7.9.5

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list