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 315312 - Gstreamer Xv uses RGB instead of YUV.
Gstreamer Xv uses RGB instead of YUV.
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.8.x
Other Linux
: Normal normal
: 0.10.8
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-09-05 20:14 UTC by Pat Suwalski
Modified: 2006-05-26 09:58 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
Debug level 5 output. (27.66 KB, text/x-gzip)
2005-09-05 20:16 UTC, Pat Suwalski
  Details
Output from xvinfo. (5.09 KB, text/plain)
2005-09-05 20:16 UTC, Pat Suwalski
  Details
Patch to prevent crashing on bad allocation from the Xserver (1.30 KB, patch)
2005-09-05 22:14 UTC, Jan Schmidt
committed Details | Review
Photo of bad Xv output. (72.55 KB, image/jpeg)
2005-09-30 02:01 UTC, Pat Suwalski
  Details

Description Pat Suwalski 2005-09-05 20:14:31 UTC
Distribution/Version: X.org 7.0.0 RC0

Gstreamer would fail when set Video output is set to Xv. The test output in the
capplet would crash. Thaytan on IRC helped me get to the source of the problem.

The X server is X.org 7.0.0 RC0, with the radeon driver.

Thaytan looked at debug output:

thaytan pat__: so for some reason we try and output RGB into what seems to be a
YUV buffer
thaytan pat__: does gst-launch-0.8 videotestsrc !
video/x-raw-yuv,format='(fourcc)I420' ! xvimagesink work?
pat__ thaytan: that does, indeed, work.
pat__ x-raw-rgb does not.
thaytan pat__: so our problem is that with your Xv driver, it thinks it can do
RGB output and then messes up
Comment 1 Pat Suwalski 2005-09-05 20:16:04 UTC
Created attachment 51841 [details]
Debug level 5 output.
Comment 2 Pat Suwalski 2005-09-05 20:16:32 UTC
Created attachment 51842 [details]
Output from xvinfo.
Comment 3 Jan Schmidt 2005-09-05 22:13:10 UTC
After some investigation, it appears that XvShmCreateImage returns an xvimage
structure with a data_size set to half what it should be for the 32bit format
that was negotiated. It is unclear why this happens, but it seems to be an
Xserver bug.

Attaching patch that at least catches this error and prevents us from crashing
when the Xserver hands us this garbage.
Comment 4 Jan Schmidt 2005-09-05 22:14:06 UTC
Created attachment 51843 [details] [review]
Patch to prevent crashing on bad allocation from the Xserver
Comment 5 Pat Suwalski 2005-09-05 22:53:19 UTC
Using this patch,

** (process:27280): WARNING **: gst_xvimagesink_xvimage_new failed to create
image of suitable size (Wanted 307200, got 153600)

With an image size of 320x240, that means that 4 bytes per pixel (32bpp) we
requested, but we only got 16bpp.

An alternative explanation is that, looking through the radeon_video.c code, we
have the width passed to a function being multiplied and divided by two.
Comment 6 Luca Ognibene 2005-09-20 20:14:37 UTC
Committed thaythan's patch. It fixes the segfault!
Have you reported your issues to the x.org bugzilla ? any news ?
Comment 7 Pat Suwalski 2005-09-30 02:01:26 UTC
Created attachment 52837 [details]
Photo of bad Xv output.

I have opened the bug at freedesktop:

    https://bugs.freedesktop.org/show_bug.cgi?id=4640

The image shows how the (broken) output looks.
Comment 8 Jan Schmidt 2006-01-20 11:26:01 UTC
Pat, I notice noone ever commented on the fdo bug. Could you please test if this is still ongoing or if it got silently fixed?

Comment 9 Pat Suwalski 2006-01-21 07:29:36 UTC
The error still exists in gstreamer-0.8, with Xorg 7.0.0.
Comment 10 Pat Suwalski 2006-01-21 07:51:09 UTC
Further attempts reveal that it does not work with 0.10 either. There is no surprise here, since it appears to be a bug in X.org.
Comment 11 Jan Schmidt 2006-01-21 14:38:43 UTC
We need to ping the upstream bug then, and find out what's happening with it.
Comment 12 Wim Taymans 2006-03-07 10:03:24 UTC
this is a plugins issue
Comment 13 Jan Schmidt 2006-04-12 11:45:11 UTC
Making some progress upstream, but this bug's not ready to be closed yet.
Comment 14 Jan Schmidt 2006-05-26 09:58:19 UTC
I just committed some fixes to xvimagesink in 0.10 that make it so 

a) It should be handling RGB Xv overlays correctly 
b) It always prefers YUV over RGB formats 
c) It gracefully errors out when the X server hands back a broken video buffer.

Closing, I believe the remaining problems are all on the X Server side now.