"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Converting ImageTarget sample project into Static Library for use as an Adobe Air Native Extention

I am not a strong xcode developer, so pardon my lack of experience.

I've been successful at creating the static library and emulating the 'didFinishLaunchingWithOptions' function on the ImageTargetsAppDelegate.mm.

my function is currently called at first screen touch, so well after app has loaded.

- (void)cameraInit

{

   QCARutils *qUtils = [QCARutils getInstance];

    

    CGRect screenBounds = [[UIScreen mainScreen] bounds];

    window = [[UIWindow alloc] initWithFrame: screenBounds];

    

    // Provide a list of targets we're expecting - the first in the list is the default

    [qUtils addTargetName:@"Stones & Chips" atPath:@"StonesAndChips.xml"];

    [qUtils addTargetName:@"Tarmac" atPath:@"Tarmac.xml"];

    

    UIView *mainView = [UIApplication sharedApplication].keyWindow;

 

    // Add the EAGLView and the overlay view to the window

    arParentViewController = [[ARParentViewController alloc] init];

    arParentViewController.arViewRect = screenBounds;

    [window insertSubview:arParentViewController.view atIndex:0];

    [window makeKeyAndVisible];

    NSLog(@" >>> FINALLY!!! cameraInit() <<<");

}

 

 

 

Here si my crash log

 

 

Aug 16 00:39:02 iPad-2-Chewy-Software com.apple.launchd[1] (com.apple.UIKit.pasteboardd[3742]) <Warning>: (com.apple.UIKit.pasteboardd) Check-in of Mach service failed. Already active: com.apple.UIKit.pasteboardd

 

 

Aug 16 00:39:03 iPad-2-Chewy-Software kernel[0] <Debug>: launchd[3739] Builtin profile: container (sandbox)

 

 

Aug 16 00:39:03 iPad-2-Chewy-Software kernel[0] <Debug>: launchd[3739] Container: /private/var/mobile/Applications/BBB76857-84EB-4674-9668-ACE873571F35 [69] (sandbox)

 

 

Aug 16 00:39:03 iPad-2-Chewy-Software kernel[0] <Debug>: launchd[3742] Builtin profile: PasteBoard (sandbox)

 

 

Aug 16 00:39:07 iPad-2-Chewy-Software MobileStorageMounter[3738] <Notice>: (0x3f14048c) idle_timer_callback: Exiting after idle timeout

 

 

Aug 16 00:39:12 iPad-2-Chewy-Software Vuforia[3739] <Warning>: ARParentVC: creating

 

 

Aug 16 00:39:12 iPad-2-Chewy-Software Vuforia[3739] <Warning>: ARVC: loadView

 

 

Aug 16 00:39:12 iPad-2-Chewy-Software Vuforia[3739] <Warning>: CARL isRetinaEnabled

 

 

Aug 16 00:39:12 iPad-2-Chewy-Software Vuforia[3739] <Warning>: QCAR OpenGL flag: 2

 

 

Aug 16 00:39:12 iPad-2-Chewy-Software Vuforia[3739] <Warning>: ARVC: viewDidLoad

 

 

Aug 16 00:39:12 iPad-2-Chewy-Software Vuforia[3739] <Warning>: QCARutils onCreate()

 

 

Aug 16 00:39:12 iPad-2-Chewy-Software Vuforia[3739] <Warning>: APPSTATUS_INIT_APP

 

 

Aug 16 00:39:12 iPad-2-Chewy-Software Vuforia[3739] <Warning>: APPSTATUS_INIT_QCAR

 

 

Aug 16 00:39:12 iPad-2-Chewy-Software Vuforia[3739] <Warning>: autofocus: 0, autofocusContinuous: 0, torch 0

 

 

Aug 16 00:39:12 iPad-2-Chewy-Software Vuforia[3739] <Warning>: ARParentVC: loading

 

 

Aug 16 00:39:12 iPad-2-Chewy-Software Vuforia[3739] <Warning>: ARVC: Rotating to Landscape Left

 

 

Aug 16 00:39:12 iPad-2-Chewy-Software Vuforia[3739] <Warning>: ARParentVC: appearing

 

 

Aug 16 00:39:12 iPad-2-Chewy-Software Vuforia[3739] <Warning>: INFO/AR(3739) 2012-08-16 00:39:12: QCAR SDK version 1.5.8

 

 

Aug 16 00:39:12 iPad-2-Chewy-Software Vuforia[3739] <Warning>: ARVC: Rotating to Landscape Left

 

 

Aug 16 00:39:12 iPad-2-Chewy-Software Vuforia[3739] <Warning>: ARVC: viewWillAppear

 

 

Aug 16 00:39:12 iPad-2-Chewy-Software Vuforia[3739] <Warning>: ARParentVC: appeared

 

 

Aug 16 00:39:12 iPad-2-Chewy-Software Vuforia[3739] <Warning>: ARVC: viewDidAppear

 

 

Aug 16 00:39:12 iPad-2-Chewy-Software Vuforia[3739] <Warning>: QCARutils onResume()

 

 

Aug 16 00:39:12 iPad-2-Chewy-Software Vuforia[3739] <Warning>: EAGLView: layoutSubviews

 

 

Aug 16 00:39:12 iPad-2-Chewy-Software Vuforia[3739] <Warning>: ARVC: Rotating to Landscape Left

 

 

Aug 16 00:39:12 iPad-2-Chewy-Software Vuforia[3739] <Warning>:  >>> FINALLY!!! cameraInit() <<<

 

 

Aug 16 00:39:13 iPad-2-Chewy-Software Vuforia[3739] <Warning>: APPSTATUS_INIT_TRACKER

 

 

Aug 16 00:39:13 iPad-2-Chewy-Software Vuforia[3739] <Warning>: Successfully initialized ImageTracker.

 

 

Aug 16 00:39:13 iPad-2-Chewy-Software Vuforia[3739] <Warning>: APPSTATUS_INIT_APP_AR

 

 

Aug 16 00:39:13 iPad-2-Chewy-Software Vuforia[3739] <Warning>: APPSTATUS_LOAD_TRACKER

 

 

Aug 16 00:39:13 iPad-2-Chewy-Software Vuforia[3739] <Warning>: INFO/AR(3739) 2012-08-16 00:39:13: ImageTracker: Successfully created dataset

 

 

Aug 16 00:39:13 iPad-2-Chewy-Software Vuforia[3739] <Warning>: Successfully loaded data set.

 

 

Aug 16 00:39:13 iPad-2-Chewy-Software Vuforia[3739] <Warning>: Successfully activated data set.

 

 

Aug 16 00:39:13 iPad-2-Chewy-Software Vuforia[3739] <Warning>: INFO/AR(3739) 2012-08-16 00:39:13: ImageTracker: Successfully created dataset

 

 

Aug 16 00:39:13 iPad-2-Chewy-Software Vuforia[3739] <Warning>: Successfully loaded data set.

 

 

Aug 16 00:39:13 iPad-2-Chewy-Software Vuforia[3739] <Warning>: APPSTATUS_INITED

 

 

Aug 16 00:39:13 iPad-2-Chewy-Software Vuforia[3739] <Warning>: APPSTATUS_CAMERA_RUNNING

 

 

Aug 16 00:39:13 iPad-2-Chewy-Software Vuforia[3739] <Warning>: DEBUG/AR(3739) UIView has CAEAGLLayer class

 

 

Aug 16 00:39:13 iPad-2-Chewy-Software Vuforia[3739] <Warning>: DEBUG/AR(3739) UIView does not respond to selector renderFrameQCAR

 

 

Aug 16 00:39:13 iPad-2-Chewy-Software Vuforia[3739] <Warning>: DEBUG/AR(3739) Could not find a UIView with CAEAGLLayer layer class that responds to selector renderFrameQCAR

 

 

Aug 16 00:39:13 iPad-2-Chewy-Software Vuforia[3739] <Warning>: DEBUG/AR(3739) UIView has CAEAGLLayer class

 

 

Aug 16 00:39:13 iPad-2-Chewy-Software Vuforia[3739] <Warning>: DEBUG/AR(3739) UIView responds to selector renderFrameQCAR

 

 

Aug 16 00:39:13 iPad-2-Chewy-Software Vuforia[3739] <Warning>: CARL 111

 

 

Aug 16 00:39:14 iPad-2-Chewy-Software kernel[0] <Debug>: AppleH4CamIn::newUserClient

 

 

Aug 16 00:39:14 iPad-2-Chewy-Software kernel[0] <Debug>: AppleH4CamInUserClient::init

 

 

Aug 16 00:39:14 iPad-2-Chewy-Software kernel[0] <Debug>: AppleH4CamInUserClient::start

 

 

Aug 16 00:39:14 iPad-2-Chewy-Software kernel[0] <Debug>: AppleH4CamIn::setPowerStateGated: 1

 

 

Aug 16 00:39:14 iPad-2-Chewy-Software kernel[0] <Debug>: AppleH4CamIn::power_on_hardware

 

 

Aug 16 00:39:14 iPad-2-Chewy-Software kernel[0] <Debug>: AppleH4CamIn::ISP_Init - Sending full-res lens-shading table for back-camera to firmware

 

 

Aug 16 00:39:14 iPad-2-Chewy-Software Vuforia[3739] <Error>: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[AVCaptureVideoDataOutput setVideoSettings:] - 1647522401 is not a supported pixel format type.  See AVCaptureOutput.h for a list of supported formats.  Available pixel format types on this platform are (

   875704438,

   875704422,

   1111970369

).'

*** Call stack at first throw:

(

0   CoreFoundation                      0x3673564f __exceptionPreprocess + 114

1   libobjc.A.dylib                     0x330bbc5d objc_exception_throw + 24

2   AVFoundation                        0x3557351d -[AVCaptureVideoDataOutput setVideoSettings:] + 380

3   Vuforia                             0x00964c20 ExtFinalizer + 1148775

4   Vuforia                             0x00967cb0 ExtFinalizer + 1161207

5   Vuforia                             0x008f0a78 ExtFinalizer + 673215

6   Vuforia                             0x008f1358 ExtFinalizer + 675487

7   Vuforia                             0x00854f8c ExtFinalizer + 35539

8   Vuforia                             0x0084d9fd ExtFinalizer + 5444

9   Vuforia                             0x0084cfd5 ExtFinalizer + 2844

10  Vuforia                             0x0084cf9b ExtFinalizer + 2786

11  Vuforia                             0x0084d193 ExtFinalizer + 3290

12  CoreFoundation                      0x366a2f03 -[NSObject(NSObject) performSelector:withObject:] + 22

13  Foundation                          0x329ba7a9 __NSThreadPerformPerform + 268

14  CoreFoundation                      0x3670ca79 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12

15  CoreFoundation                      0x3670e75f __CFRunLoopDoSources0 + 382

16  CoreFoundation                      0x3670f4eb __CFRunLoopRun + 230

17  CoreFoundation                      0x3669fec3 CFRunLoopRunSpecific + 230

18  CoreFoundation                      0x3669fdcb CFRunLoopRunInMode + 58

19  GraphicsServices                    0x365da41f GSEventRunModal + 114

20  GraphicsServices                    0x365da4cb GSEventRun + 62

21  UIKit                               0x345e7d69 -[UIApplication _run] + 404

22  UIKit                               0x345e5807 UIApplicationMain + 670

23  Vuforia                             0x00165db0 main + 92

24  Vuforia                             0x0084c0a4 main + 7234384

)

 

 

Aug 16 00:39:14 iPad-2-Chewy-Software UIKitApplication:air.Vuforia[0xee4b][3739] <Notice>: terminate called after throwing an instance of 'NSException'

 

 

Aug 16 00:39:14 iPad-2-Chewy-Software ReportCrash[3744] <Notice>: Formulating crash report for process Vuforia[3739]

 

 

Aug 16 00:39:14 iPad-2-Chewy-Software com.apple.launchd[1] (UIKitApplication:air.Vuforia[0xee4b][3739]) <Warning>: (UIKitApplication:air.Vuforia[0xee4b]) Job appears to have crashed: Abort trap: 6

 

 

Aug 16 00:39:14 iPad-2-Chewy-Software SpringBoard[30] <Warning>: Application 'Vuforia' exited abnormally with signal 6: Abort trap: 6

 

 

Aug 16 00:39:14 iPad-2-Chewy-Software ReportCrash[3744] <Error>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/Vuforia_2012-08-16-003914_iPad-2-Chewy-Software.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0

 

 

Aug 16 00:39:15 iPad-2-Chewy-Software kernel[0] <Debug>: AppleH4CamIn::setPowerStateGated: 0

 

 

Aug 16 00:39:15 iPad-2-Chewy-Software kernel[0] <Debug>: AppleH4CamIn::power_off_hardware

 

 

Aug 16 00:39:15 iPad-2-Chewy-Software kernel[0] <Debug>: AppleH4CamInUserClient::clientClose

 

 

Aug 16 00:39:15 iPad-2-Chewy-Software kernel[0] <Debug>: AppleH4CamInUserClient::stop

 

 

Aug 16 00:39:15 iPad-2-Chewy-Software kernel[0] <Debug>: AppleH4CamInUserClient::free

 

 

Aug 16 00:41:14 iPad-2-Chewy-Software SpringBoard[30] <Notice>: MultitouchHID(1d973ad0) uilock state: 0 -> 1

 

 

Aug 16 00:42:35 iPad-2-Chewy-Software SCHelper[155] <Notice>: active (but IDLE) sessions

 

 

Aug 16 00:42:35 iPad-2-Chewy-Software SCHelper[155] <Notice>:   0x1cd4a4d0 {port = 0x1e17, caller = SpringBoard(30):com.apple.preferences, path = /Library/Preferences/SystemConfiguration/preferences.plist}

 

 

 

 

 

Based on my "Carl 111" log, it crashed here in QCARutils.mm

 

////////////////////////////////////////////////////////////////////////////////

// Start capturing images from the camera

- (void)startCamera

{

 

    // Initialise the camera

    if (QCAR::CameraDevice::getInstance().init()) {

        // Configure video background

        [self configureVideoBackground];

        

        NSLog(@"CARL 111");

        //// Select the default mode - given as example of how and where to set the Camera mode

        //if (QCAR::CameraDevice::getInstance().selectVideoMode(QCAR::CameraDevice::MODE_DEFAULT)) {

        

        // Start camera capturing

        if (QCAR::CameraDevice::getInstance().start()) {

            NSLog(@"CARL 222");

 

carlgloria

Thu, 08/16/2012 - 15:02

Nalin, thanks for your rapid response. I will give that a try today. Has any one at qualcomm tried yet? Is there a qualcomm roadmap to create an Adobe Air Extention?

carlgloria

Fri, 08/17/2012 - 00:18

Woowho, It worked! Air 3.4beta was the cure! Tracking and rending the converted sample Target image project. Now I have to understand how iOS layers stuff. Can't see the Adobe Air Stage anymore. Think I have to force Air view/window over the camera somehow.