Ah. One moment.
Because i put the exit call into the if {} there is no changes thate =
there
is an image from the cam.
So a line like this (thanks to Peter Oost)
while( (dataPtr =3D (ARUint8 *)arVideoGetImage()) =3D=3D NULL ) =
arUtilSleep(2);
is better because it "waits" until there IS an image from the cam.
Thanks
-----Urspr=FCngliche Nachricht-----
Von: owner-artoolkit@h ..................
[mailto:owner-artoolkit@h ..................] Im Auftrag von Philip Lamb
Gesendet: Mittwoch, 8. Dezember 2004 21:40
An: Manuel B=FCchler ; artoolkit@h ..................
Betreff: Re: AW: arVideoGetImage
Manuel,
Getting NULL returned from arVideoGetImage is not cause for calling=20
exit(), so don't do that.
NULL can be returned when a frame is not ready from the camera, but=20
that doesn't mean one won't ever become ready. You should just keep=20
sleeping and calling arVideoGetImage until either you get a frame or=20
you reach some self-imposed time limit e.g. 10 seconds.
Regards,
Phil.
At 9:22 PM +0100 8/12/04, Manuel B=FCchler wrote:
>Hello
>
>Here i get you a more specific explanation what is my problem. I made =
all
of
>these init-stuff which Is also in the example project simple. Now I =
want to
>get an image from my camera with this code (the same as in simple =
except
the
>printf)
>
>if( (dataPtr =3D (ARUint8 *)arVideoGetImage()) =3D=3D NULL ) {
> arUtilSleep(2);
> printf("Videobild w=FCrde nicht
>geladen!!!!!!!!!!!!!!!!!!!!!!!");
> exit(1);
> }
>
>But everytime the programm stops with exit(1) because the dataPtr is =
NULL
>I tried to find the error in the libARvideo. I made some printf to get =
to
>know where the error begins in the function arVideoGetImage.
>But this function seem to be ignored. Every printf I made in this =
function
>don't come to the console. So it seem to be that this function isn't =
call.
>But there is a call as you can see in the code above.
>
>Does anyone know about this error and can help me to solve it?
>
>Thanks.
>
|