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 401118 - [visual] error if width not a multiple of 4
[visual] error if width not a multiple of 4
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.11
Other Linux
: Normal normal
: 0.10.12
Assigned To: Wim Taymans
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-01-26 20:06 UTC by Ed Catmur
Modified: 2007-01-29 10:25 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
visual-no-round-up-4.patch (501 bytes, patch)
2007-01-26 20:28 UTC, Ed Catmur
none Details | Review
visual-no-round-up-4.patch (481 bytes, patch)
2007-01-26 21:25 UTC, Ed Catmur
rejected Details | Review

Description Ed Catmur 2007-01-26 20:06:12 UTC
** (totem:17295): WARNING **: Size 547840 is not a multiple of unit size 545280
** Message: Error: subclass did not specify output size
gstbasetransform.c(1487): gst_base_transform_handle_buffer (): /play/visbin/vbin/vconv:
subclass did not specify output size

Breakpoint 1, gst_base_transform_transform_size (trans=0x844b078, 
    direction=GST_PAD_SINK, caps=0x83c3bc0, size=547840, othercaps=0x83be220, 
    othersize=0xb3640274) at gstbasetransform.c:484
484     {
(gdb) bt
  • #0 gst_base_transform_transform_size
    at gstbasetransform.c line 484
  • #1 gst_base_transform_handle_buffer
    at gstbasetransform.c line 1432
  • #2 gst_base_transform_chain
    at gstbasetransform.c line 1542
  • #3 gst_pad_chain_unchecked
    at gstpad.c line 3412
  • #4 gst_pad_push
    at gstpad.c line 3578
  • #5 gst_base_transform_chain
    at gstbasetransform.c line 1548
  • #6 gst_pad_chain_unchecked
    at gstpad.c line 3412
  • #7 gst_pad_push
    at gstpad.c line 3578
  • #8 gst_proxy_pad_do_chain
    at gstghostpad.c line 189
  • #9 gst_pad_chain_unchecked
    at gstpad.c line 3412
  • #10 gst_pad_push
    at gstpad.c line 3578
  • #11 gst_proxy_pad_do_chain
    at gstghostpad.c line 189
  • #12 gst_pad_chain_unchecked
    at gstpad.c line 3412
  • #13 gst_pad_push
    at gstpad.c line 3578
  • #14 gst_base_transform_chain
    at gstbasetransform.c line 1548
  • #15 gst_pad_chain_unchecked
    at gstpad.c line 3412
  • #16 gst_pad_push
    at gstpad.c line 3578
  • #17 gst_visual_chain
    at visual.c line 713
  • #18 gst_pad_chain_unchecked
    at gstpad.c line 3412
  • #19 gst_pad_push
    at gstpad.c line 3578
  • #20 gst_proxy_pad_do_chain
    at gstghostpad.c line 189
  • #21 gst_pad_chain_unchecked
    at gstpad.c line 3412
  • #22 gst_pad_push
  • #23 gst_base_transform_chain
    at gstbasetransform.c line 1548
  • #24 gst_pad_chain_unchecked
    at gstpad.c line 3412
  • #25 gst_pad_push
    at gstpad.c line 3578
  • #26 gst_queue_loop
    at gstqueue.c line 786
  • #27 gst_task_func
    at gsttask.c line 192
  • #28 g_thread_pool_thread_proxy
    at gthreadpool.c line 265
  • #29 g_thread_create_proxy
    at gthread.c line 591
  • #30 start_thread
    at pthread_create.c line 296
  • #31 clone
    from /lib/libc.so.6
  • #17 gst_visual_chain
    at visual.c line 713
$1 = (GstBuffer *) 0x84f6da8
(gdb) p outbuf->size
$2 = 547840
(gdb) p outbuf->caps
$3 = (GstCaps *) 0x83c3bc0
(gdb) p gst_caps_to_string(outbuf->caps)
$6 = (
    gchar *) 0x84f7e00 "video/x-raw-rgb, width=(int)426, height=(int)320, framerate=(fraction)25/1, bpp=(int)32, depth=(int)24, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, endianness=(int)4321"
(gdb) p outbuf->size
$7 = 547840
(gdb) p 426*320*4
$8 = 545280
Comment 1 Ed Catmur 2007-01-26 20:21:49 UTC
OK, I can see no possible reason for the use of GST_ROUND_UP_4:

  /* precalc some values */
  visual->outsize =
      visual->video->height * GST_ROUND_UP_4 (visual->video->width) *
      visual->video->bpp;

Hacking around it in gdb works; let's try recompiling.
Comment 2 Tim-Philipp Müller 2007-01-26 20:27:46 UTC
I'd guess it should be GST_ROUND_UP_4 (visual->video->width * visual->video->bpp) instead.
Comment 3 Ed Catmur 2007-01-26 20:28:28 UTC
Created attachment 81287 [details] [review]
visual-no-round-up-4.patch

This is scary; I think I'm getting better at this.
Comment 4 Ed Catmur 2007-01-26 21:11:28 UTC
(In reply to comment #2)
> I'd guess it should be GST_ROUND_UP_4 (visual->video->width *
> visual->video->bpp) instead.

Hmm, I don't think libvisual works like that; look at visual_video_set_dimension():

int visual_video_set_dimension (VisVideo *video, int width, int height)
{
	visual_log_return_val_if_fail (video != NULL, -VISUAL_ERROR_VIDEO_NULL);

	video->width = width;
	video->height = height;

	video->pitch = video->width * video->bpp;

	visual_buffer_set_size (video->buffer, video->pitch * video->height);

	return VISUAL_OK;
}

Actually, it'd be better to go straight in and use visual->video->buffer->datasize, I think.
Comment 5 Ed Catmur 2007-01-26 21:25:02 UTC
Created attachment 81298 [details] [review]
visual-no-round-up-4.patch

Use visual->video->buffer->datasize.
Comment 6 Wim Taymans 2007-01-29 10:25:26 UTC
        * ext/libvisual/visual.c: (gst_visual_src_setcaps):
        Fix strides in libvisual. Gst uses X strides.
        Inspired by: <ed at catmur dot co dot uk> and
        <tim at centricular dot net>
        Fixes #401118.