GNOME Bugzilla – Bug 401118
[visual] error if width not a multiple of 4
Last modified: 2007-01-29 10:25:26 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
+ Trace 105503
$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
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.
I'd guess it should be GST_ROUND_UP_4 (visual->video->width * visual->video->bpp) instead.
Created attachment 81287 [details] [review] visual-no-round-up-4.patch This is scary; I think I'm getting better at this.
(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.
Created attachment 81298 [details] [review] visual-no-round-up-4.patch Use visual->video->buffer->datasize.
* 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.