Log in or register to post comments

Notification when Camera Loaded

June 24, 2013 - 1:25pm #1

I am creating an application similar to textReco.  As the camera's view does not come up immediately, I place a UIActivityIndicatorView (spinner) over the camera window.  I'm interested in a notification that is sent out when the camera is loaded so I can turn the activity indicator off.

Let me know if anyone knows of such a notification?

Thanks!

Notification when Camera Loaded

June 25, 2013 - 8:01am #4

It does not appear that the current TextReco example uses QCARUtils.

It seems that most of the examples have been refactored for 2.5.

Notification when Camera Loaded

June 25, 2013 - 3:30am #3

If you look in QCARUtils.mm you will see this code as part of the initialisation:

 

            case APPSTATUS_CAMERA_RUNNING:

                NSLog(@"APPSTATUS_CAMERA_RUNNING");

                // Start the camera and tracking

                [self startCamera];

                videoStreamStarted = YES;

                [self cameraDidStart];

                break;

...which also calls this code:

 

- (void)cameraDidStart

{

    // Inform the delegate

    if ((delegate != nil) && [delegate respondsToSelector:@selector(cameraDidStart)]) {

        [delegate performSelectorOnMainThread:@selector(cameraDidStart) withObject:nil waitUntilDone:YES];

    }

}

 

So you could choose to post your notification there.

BTW I went through the mechanics of notifications (setting up observers and posting with completion blocks here if it is useful:

https://developer.vuforia.com/forum/ios/trackableeventhandler-equivalent-ios

 

Finally, you might want to investigate MBProgressHUD as it is a commonly used component just fr this purpose.

 

HTH

 

N

 

Notification when Camera Loaded

June 24, 2013 - 2:50pm #2

There does not appear to be one currently, but you could add one in QCARControl::startCameraForViewWidth:andHeight

Log in or register to post comments