Re: threads and sig10/11
Re: threads and sig10/11
- Subject: Re: threads and sig10/11
- From: Gregor Hofer <email@hidden>
- Date: Thu, 22 May 2003 17:12:51 +0200 (CEST)
I checked the appkit docs, and updating the display and nsimage are
thread safe. so my problem still persists...
the link to th original files:
http://developer.apple.com/samplecode/Sample_Code/QuickTime/Basics/CocoaVideoFrameToNSImage.htm
I was modifying the example VideoFrameToNSImage from the Apple
website
>
for video filtering. I created a seperate filtering class that does
all
>
the filtering and returns an NSimage wich will be displayed. This
>
happens in a seperate thread. When this thread is done the program
>
crashes with sig 10 or 11. This only happens when the filtering is
>
turned on. i fhte video is driectly displayed in the view then it
runs
>
normally.
>
here is the code:
>
-(void)runmovie_thread:(id) anObject
>
{
>
NSAutoreleasePool *pool = [NSAutoreleasePool new];
>
>
[filter_man awake:xsize:ysize:[myObject threshValue]:[image_out
>
copy] :myObject];
>
>
>
while ( movieFrameNumber < movieFrameCount & movierun ) //[self
>
movieup])
>
{
>
[self nextFrame];
>
>
[filter_man giveImage:[[self
gworldToNSImage:srcGWorld]
>
copy]];
>
>
>
int myfilter =[myObject whichfilter];
>
>
if (myfilter==0) {image_out = [[self
>
gworldToNSImage:srcGWorld] copy]; }
>
>
if (myfilter==1) {image_out = [[filter_man
>
filter_difference] copy]; }
>
if (myfilter==2) {image_out = [[filter_man
filter_flow]
>
copy];}
>
if (myfilter==3) {image_out = [[filter_man
>
filter_motionenergy] copy];}
>
[self drawFrame];
>
[self setNeedsDisplay:YES];
>
[NSThread sleepUntilDate:[NSDate
>
dateWithTimeIntervalSinceNow:0.04]];
>
>
}
>
>
[pool release];
>
[NSThread exit];
>
}
__________________________________________________________________
Gesendet von Yahoo! Mail -
http://mail.yahoo.de
Logos und Klingeltvne f|rs Handy bei
http://sms.yahoo.de
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.