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 377400 - [xvimagesink] Bad resizing
[xvimagesink] Bad resizing
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.x
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 540401 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-11-20 14:27 UTC by Bastien Nocera
Modified: 2009-03-11 09:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
dbg.log (10.44 KB, text/plain)
2006-11-20 17:17 UTC, Bastien Nocera
Details
screenshot showing the problem (133.89 KB, image/png)
2008-06-24 17:59 UTC, Bastien Nocera
Details

Description Bastien Nocera 2006-11-20 14:27:20 UTC
Available here for example:
http://www.peregrinehw.com/downloads/junk/cool/moveyourfeet/moveyourfeet.mov

$ totem-video-indexer moveyourfeet.mov 
Can't open moveyourfeet.mov: Video codec 'png ' is not handled. You might need to install additional plugins to be able to play some types of movies

I'm pretty sure it would be possible to play it...
Comment 1 Tim-Philipp Müller 2006-11-20 14:56:40 UTC
 - This does not look like a GStreamer error message at first glance

 - This file plays fine for me with current releases and CVS. This
   has been fixed ~ gst-plugins-good 0.10.3 time AFAIK.

 - What's the output of
     $ gst-inspect-0.10 pngdec | grep Version
     $ gst-inspect-0.10 qtdemux | grep Version

 - Is this with qtdemux from -bad or the fluendo iso demuxer?
Comment 2 Bastien Nocera 2006-11-20 15:51:04 UTC
Brain crap. I rebuilt totem against xine-lib after testing the configure.in changes to make GStreamer the default ;)
Comment 3 Bastien Nocera 2006-11-20 15:54:46 UTC
Ha, instead I get:
Failed to create output image buffer of 90x72 pixels

(Don't know what I was thinking).

Using gstreamer-plugins-good-0.10.4-1.fc6, and without the iso demuxer installed.

pngdec:
Factory Details:
  Long name:    PNG image decoder
  Class:        Codec/Decoder/Image
  Description:  Decode a png video frame to a raw image
  Author(s):    Wim Taymans <wim@fluendo.com>
  Rank:         primary (256)

Plugin Details:
  Name:                 png
  Description:          PNG plugin library
  Filename:             /usr/lib/gstreamer-0.10/libgstpng.so
  Version:              0.10.4
  License:              LGPL
  Source module:        gst-plugins-good
  Binary package:       Fedora Core gstreamer-plugins-good package
  Origin URL:           http://download.fedora.redhat.com/fedora

GObject
 +----GstObject
       +----GstElement
             +----GstPngDec

Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-raw-rgb
                    bpp: 32
                  depth: 32
             endianness: 4321
               red_mask: -16777216
             green_mask: 16711680
              blue_mask: 65280
             alpha_mask: 255
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
      video/x-raw-rgb
                    bpp: 24
                  depth: 24
             endianness: 4321
               red_mask: 16711680
             green_mask: 65280
              blue_mask: 255
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]

  SINK template: 'sink'
    Availability: Always
    Capabilities:
      image/png


Element Flags:
  no flags set

Element Implementation:
  No loopfunc(), must be chain-based or not configured yet
  Has change_state() function: 0x500dc0
  Has custom save_thyself() function: gst_element_save_thyself
  Has custom restore_thyself() function: gst_element_restore_thyself

Element has no clocking capabilities.
Element has no indexing capabilities.

Pads:
  SRC: 'src'
    Implementation:
    Pad Template: 'src'
  SINK: 'sink'
    Implementation:
      Has chainfunc(): 0x502020
      Has custom eventfunc(): 0x500e70
    Pad Template: 'sink'

Element Properties:
  name                : The name of the object
                        flags: readable, writable
                        String. Default: null Current: "pngdec0"

qtdemux:
Factory Details:
  Long name:    QuickTime demuxer
  Class:        Codec/Demuxer
  Description:  Demultiplex a QuickTime file into audio and video streams
  Author(s):    David Schleef <ds@schleef.org>
  Rank:         primary (256)

Plugin Details:
  Name:                 qtdemux
  Description:          Quicktime stream demuxer
  Filename:             /usr/lib/gstreamer-0.10/libgstqtdemux.so
  Version:              0.10.3
  License:              LGPL
  Source module:        gst-plugins-bad
  Binary package:       GStreamer Bad Plug-ins source release
  Origin URL:           Unknown package origin

GObject
 +----GstObject
       +----GstElement
             +----GstQTDemux

Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      video/quicktime
      audio/x-m4a
      application/x-3gp

  SRC template: 'audio_%02d'
    Availability: Sometimes
    Capabilities:
      ANY

  SRC template: 'video_%02d'
    Availability: Sometimes
    Capabilities:
      ANY


Element Flags:
  no flags set

Element Implementation:
  No loopfunc(), must be chain-based or not configured yet
  Has change_state() function: 0x12ae40
  Has custom save_thyself() function: gst_element_save_thyself
  Has custom restore_thyself() function: gst_element_restore_thyself

Element has no clocking capabilities.
Element has no indexing capabilities.

Pads:
  SINK: 'sink'
    Implementation:
      Has chainfunc(): 0x129be0
      Has custom eventfunc(): 0x1211d0
    Pad Template: 'sink'

Element Properties:
  name                : The name of the object
                        flags: readable, writable
                        String. Default: null Current: "qtdemux0"

Comment 4 Tim-Philipp Müller 2006-11-20 16:49:53 UTC
> Failed to create output image buffer of 90x72 pixels

Looks like a problem ximagesink or xvimagesink. Could you do this:

 $ GST_DEBUG=*imagesink:5 totem moveyourfeet.mov 2>dbg.log

and attach the log?

Also, what's the version of gst-plugins-base?
Comment 5 Bastien Nocera 2006-11-20 17:17:48 UTC
Created attachment 76922 [details]
dbg.log

Here goes
Comment 6 Tim-Philipp Müller 2006-11-20 20:15:44 UTC
From the log:

Creating new XvImageBuffer
creating 90x72
XShm image size is 19440
XServer ShmAttached to 0x462801e, id 0x3e00003
error: Failed to create output image buffer of 90x72 pixels
error: XServer allocated buffer size did not match input buffer

The image size looks wrong (19440/72 = 270). Looks to me like xvimagesink doesn't calculate or query the stride properly for RGB caps with certain widths.
Comment 7 Jan Schmidt 2006-11-21 10:45:16 UTC
"The image size looks wrong (19440/72 = 270). Looks to me like xvimagesink
doesn't calculate or query the stride properly for RGB caps with certain
widths."

... which is probably lucky - the last time I tried RGB caps into xvimagesink (which only works on ATI cards with x.org drivers afaik), it crashed the X server because that code path in the driver was actually completely untested.

That fix might have been released and made it into your distro by now though.
Comment 8 Tim-Philipp Müller 2006-11-21 12:49:04 UTC
Good thing we made xvimagesink advertise RGB caps in the first place then ...
Comment 9 David Schleef 2006-11-21 20:42:09 UTC
This is likely an X bug, since every overlay hardware I've seen requires strides in multiples of 4.  270 isn't a multiple of 4.

The XV extension is pretty craptastic in this area.  We could attempt to deduce the stride from the SHM size / height, and when it's wrong, assign the blame to X with a little more confidence than "huh.  must be an X bug".
Comment 10 David Schleef 2007-05-13 01:05:12 UTC
I added some code for sanity checking the size number we get back from X.  It only works for YUV variants currently, because I can't remember what the ID codes for RGB XVideo are.

It outputs a GST_WARNING(), which may not be exactly what we want.

To actually fix this problem, we might as well just turn off RGB XVideo.  I don't think anyone uses it productively.
Comment 11 Sebastian Dröge (slomo) 2008-05-05 12:52:44 UTC
Not sure if this is fixed with latest CVS... but I can't reproduce it at all. Works fine with xvimagesink with either rgb or yuv input.

Can someone still reproduce this?
Comment 12 Bastien Nocera 2008-06-24 17:58:44 UTC
Nowadays I get no sound, and still a very very dodgy resizing in Totem.
Comment 13 Bastien Nocera 2008-06-24 17:59:32 UTC
Created attachment 113351 [details]
screenshot showing the problem
Comment 14 Jan Schmidt 2008-06-25 14:56:30 UTC
That looks like either it's not exposing the output on resize, and isn't receiving any new frames that would implicitly cause a repaint, or the window isn't being resized correctly, or the resize isn't being registered by xvimagesink.

Just to be clear, in that screenshot, it's definitely xvimagesink, not ximagesink or glimagesink or something?
Comment 15 Bastien Nocera 2008-06-27 00:26:41 UTC
(In reply to comment #14)
> That looks like either it's not exposing the output on resize, and isn't
> receiving any new frames that would implicitly cause a repaint, or the window
> isn't being resized correctly, or the resize isn't being registered by
> xvimagesink.

Possibly.

> Just to be clear, in that screenshot, it's definitely xvimagesink, not
> ximagesink or glimagesink or something?

I tested with ximagesink, just to be sure, and it does resize to the full size after a couple of frames have showed up.

Using xvimagesink, it won't resize over 9 times the original size (exactly): 90x72 -> 630x504.
Comment 16 Jan Schmidt 2008-06-30 22:17:36 UTC
The resizing works for me with ximagesink too. I don't have xvimagesink, so I can't test with that. Some debug capture of GST_DEBUG=xvimagesink:5 when resizing might help.

The lack of audio is a regression in gst-ffmpeg. With gst-ffmpeg 0.10.3, it plays fine. gst-ffmpeg CVS produces constant 'audio discontinuity' errors.
Comment 17 Jan Schmidt 2008-07-01 09:06:49 UTC
OK, I have a fix for the audio decoding regression. Testing to make sure there's no other side effects before committing.
Comment 18 Jan Schmidt 2008-07-01 10:35:43 UTC
Fix for audio is in gst-ffmpeg CVS
Comment 19 Wim Taymans 2008-07-01 15:48:46 UTC
*** Bug 540401 has been marked as a duplicate of this bug. ***
Comment 21 Jan Schmidt 2008-07-02 14:10:50 UTC
The last xvimage_put I see in there has

0:00:09.319338250 27720      0x2590d20 LOG            xvimagesink xvimagesink.c:822:gst_xvimagesink_xvimage_put:<videosink-actual-sink-xvimage> XvShmPutImage with image 90x72 and window 984x794, from xvimage 

That implies we're calling XvShmPutImage with the correct parameters - which would make me say that it has to be an X bug. Did you say somewhere that it works (using Xv) in some other player?

Can you try:

gst-launch videotestsrc ! video/x-raw-yuv,width=90,height=72 ! xvimagesink and scale it up?
Comment 22 Bastien Nocera 2008-07-02 14:57:41 UTC
(In reply to comment #21)
> Can you try:
> 
> gst-launch videotestsrc ! video/x-raw-yuv,width=90,height=72 ! xvimagesink and
> scale it up?

Yay! Borked as well.

mplayer doesn't want to playback using Xv on my machine, and xine doesn't understand the png video.

It's apparently hardware specific which maximum ratio you can get for the scaling.
Comment 23 Bastien Nocera 2008-07-02 15:26:32 UTC
Filed upstream:
https://bugs.freedesktop.org/show_bug.cgi?id=16587
Comment 24 Edward Hervey 2009-03-11 09:03:01 UTC
Bastien, is this still an issue ? Just tried it with intel driver 2.6.3 and it works fine.
Comment 25 Bastien Nocera 2009-03-11 09:09:09 UTC
I guess it would work using the OpenGL pipeline. Closing, thanks for the work guys.