Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 97785 - media-video/camorama crashes upon enabling laplace or mirror image
Summary: media-video/camorama crashes upon enabling laplace or mirror image
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-02 21:31 UTC by Philip Allison
Modified: 2006-12-01 04:31 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Allison 2005-07-02 21:31:53 UTC
I recently emerged camorama 0.17 and usb-pwc-re 10.0.7 on my Pentium 4 laptop,
got camera capture working, but then noticed I can't enable the "laplace" or
"mirror image" effects without the application crashing. Recompiling with
+debug, and running with -D, does not seem to produce any useful output (nothing
other than the initial startup output appears on the terminal prior to the crash).
A week or two ago, I went through the same get-the-webcam-working dance on my
Athlon 64 desktop, and I'm pretty sure I didn't get this problem there.

Reproducible: Always
Steps to Reproduce:
1. Start camorama
2. Enable "laplace" or "mirror image"

Actual Results:  
Application crashes, with the GNOME crash dialogue ("Application X has quit
unexpectedly")

Expected Results:  
Program keeps running, with specified effect enabled

Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.3.5-20050130,
glibc-2.3.4.20041102-r1, 2.6.11-gentoo-r11 i686)
=================================================================
System uname: 2.6.11-gentoo-r11 i686 Intel(R) Pentium(R) 4 CPU 2.80GHz
Gentoo Base System version 1.6.12
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Jun 11 2005, 15:20:55)]
dev-lang/python:     2.3.5
sys-apps/sandbox:    [Not Present]
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.5, 1.7.9-r1, 1.9.5, 1.6.3, 1.4_p6, 1.8.5-r3
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.16
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium4 -O3 -funroll-loops -fomit-frame-pointer
-fprefetch-loop-arrays -pipe -ftracer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium4 -O3 -funroll-loops -fomit-frame-pointer
-fprefetch-loop-arrays -pipe -ftracer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/
http://gentoo.ccccom.com/
http://www.die.unipd.it/pub/Linux/distributions/gentoo-sources/
http://ftp-mirror.internap.com/pub/gentoo/"
LC_ALL="en_GB.utf8"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X aalib acpi adns alsa apache2 avi bitmap-fonts cdr crypt cscope cups
curl dga divx4linux dvd dvdread eds emboss encode flac foomaticdb gdbm gif gnome
gpm gstreamer gtk gtk2 hal imagemagick imap imlib java joystick jpeg libg++
libwww mad matroska mikmod mmx mng mozilla moznocompose moznoirc mozsvg mp3 mpeg
ncurses nls nptl nptlonly offensive ogg oggvorbis openal opengl pam pcmcia
pdflib png quicktime readline samba sdl slang speex spell sse sse2 ssl tcltk
tcpd tetex theora tiff truetype truetype-fonts type1-fonts unicode vorbis
win32codecs wmf xine xml2 xv xvid zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LDFLAGS, LINGUAS
Comment 1 jose 2006-07-10 06:48:43 UTC
to get laplace working you have to change laplace function in  filter.c like this

void laplace (unsigned char *image, int z, int x, int y)
{
    int i;
    int neighbours;
    int total0, total1, total2;
    unsigned char *image2, *image3;
	
    image2 = (unsigned char *) malloc (sizeof (unsigned char) * x * y * z);
    memcpy (image2, image, x * y * z);
    image3 = image2;


    image2+=(x + 1) * 3; // this was missing in the original file

    for (i = 1; i < x * (y - 1); i++) {
        total0 = 0;
        total1 = 0;
        total2 = 0;
        neighbours = 0;

        image2 -= (x + 1) * 3;
        total0 = total0 + (int)image2[0];
        total1 = total1 + (int)image2[1];
        total2 = total2 + (int)image2[2];

        total0 = total0 + (int)image2[3];
        total1 = total1 + (int)image2[4];
        total2 = total2 + (int)image2[5];

        total0 = total0 + (int)image2[6];
        total1 = total1 + (int)image2[7];
        total2 = total2 + (int)image2[8];

        image2 += (x + 1) * 3;

        image2 += (x - 1) * 3;
        total0 = total0 + image2[0];
        total1 = total1 + image2[1];
        total2 = total2 + image2[2];

        total0 = total0 + image2[3];
        total1 = total1 + image2[4];
        total2 = total2 + image2[5];

        total0 = total0 + image2[6];
        total1 = total1 + image2[7];
        total2 = total2 + image2[8];

        image2 -= (x - 1) * 3;

        image2 += 3;
        total0 = total0 + image2[0];
        total1 = total1 + image2[1];
        total2 = total2 + image2[2];
        image2 -= 3;

        image2 -= 3;
        total0 = total0 + image2[0];
        total1 = total1 + image2[1];
        total2 = total2 + image2[2];
        image2 += 3;

        if (image[0] * 8 < total0) {
            image[0] = 0;
        } else {
            image[0] = (image[0] * 8) - total0;
        }
        if (image[1] * 8 < total1) {
            image[1] = 0;
        } else {
            image[1] = (image[1] * 8) - total1;
        }
        if (image[2] * 8 < total2) {
            image[2] = 0;
        } else {
            image[2] = (image[2] * 8) - total2;
        }

        image += 3;
        image2 += 3;
    }

    free (image3);

}
Comment 2 Matthias Schwarzott gentoo-dev 2006-11-20 04:35:43 UTC
Does release camorama-0.18 solves that issue?
Comment 3 Matthias Schwarzott gentoo-dev 2006-11-29 12:11:05 UTC
needinfo
Comment 4 Philip Allison 2006-12-01 04:31:12 UTC
(In reply to comment #2)
> Does release camorama-0.18 solves that issue?
> 

Not sure - the machine in question (P4 laptop) isn't running Gentoo any more. Still working without problems on the other machine mentioned (Athlon 64 desktop), though.