Log in or register to post comments

VideoPlayBack, Image Targets and custom events

July 31, 2013 - 3:59pm #1

Hi...

 

Can anybody help me... Im trying to merge videoplayback, imagetargets and custom events in one app.

By now the videoplayback and imagetarget with custom 3d object are working like a charm, but the problem is when i try to make custom events for example if im trying to create a overlay view in the camera called by an especific texture recognition, it get crashed... 

 

Can anyone help me to call a view over the camera in this project, this is how i create custom events to the target


else if (playerIndex == 100){
                Object3D* obj3D = [objects3D objectAtIndex:OBJECT_KEYFRAME_1 + 7];
                frameTextureID = [[obj3D texture] textureID];
                aspectRatio = (float)[[obj3D texture] height] / (float)[[obj3D texture] width];
                texCoords = quadTexCoords;
}

 

So i was thinking that making something like this will work, but the code crashes


else if (playerIndex == 100){
                Object3D* obj3D = [objects3D objectAtIndex:OBJECT_KEYFRAME_1 + 7];
                frameTextureID = [[obj3D texture] textureID];
                aspectRatio = (float)[[obj3D texture] height] / (float)[[obj3D texture] width];
                texCoords = quadTexCoords;
                CGRect screenBounds = [[UIScreen mainScreen] bounds];
                CGRect frame;
                frame.origin.x = 0;
                frame.origin.y = 0;
                frame.size.width = screenBounds.size.height;
                frame.size.height = screenBounds.size.width;
                UIImageView *freeze = [[UIImageView alloc]initWithFrame:CGRectMake(frame.origin.x, 44, frame.size.height, frame.size.width)];
                [freeze setImage:[UIImage imageNamed:@"blur_5.png"]];
                [self addSubview:freeze];
}

I tryed to call from another class like AR_Eagleview.m, OverlayView.m, OverLayViewController.m, ARParentViewController.m, but it always get freeze when i try to make a custom view overlay ... thanks...

 

 

VideoPlayBack, Image Targets and custom events

August 1, 2013 - 9:21am #4

The log is pretty meaningless.

Have you narrowed down where the problem is or tried putting any UI on the main thread?

If you want events, you can always use NSNotification to signal and then do what you want.

 

N

VideoPlayBack, Image Targets and custom events

August 1, 2013 - 8:38am #3

Hi thanks for your time

 

By Custom event i mean something like put a view over the camera, alerts and things like that.

Whit your recomendation i have the folow debug

 

libobjc.A.dylib`objc_msgSend:

0x376e9b60:  cbz    r0, 0x376e9b9e            ; objc_msgSend + 62

0x376e9b62:  ldr.w  r9, [r0]

0x376e9b66:  ldrh.w r12, [r9, #12]

0x376e9b6a:  ldr.w  r9, [r9, #8]

0x376e9b6e:  and.w  r12, r12, r1

0x376e9b72:  add.w  r9, r9, r12, lsl #3

0x376e9b76:  ldr.w  r12, [r9]

0x376e9b7a:  teq.w  r12, r1

0x376e9b7e:  bne    0x376e9b86                ; objc_msgSend + 38

0x376e9b80:  ldr.w  r12, [r9, #4]

0x376e9b84:  bx     r12

0x376e9b86:  cmp.w  r12, #1

0x376e9b8a:  blo    0x376e9b98                ; objc_msgSend + 56

0x376e9b8c:  it     eq

0x376e9b8e:  ldreq.w r9, [r9, #4]

0x376e9b92:  ldr    r12, [r9, #8]!

0x376e9b96:  b      0x376e9b7a                ; objc_msgSend + 26

0x376e9b98:  ldr.w  r9, [r0]

0x376e9b9c:  b      0x376e9de0                ; _objc_msgSend_uncached

0x376e9b9e:  mov.w  r1, #0

0x376e9ba2:  bx     lr

0x376e9ba4:  nop    

0x376e9ba6:  nop    

0x376e9ba8:  nop    

0x376e9baa:  nop    

0x376e9bac:  nop    

0x376e9bae:  nop    

0x376e9bb0:  nop    

0x376e9bb2:  nop    

0x376e9bb4:  nop    

0x376e9bb6:  nop    

0x376e9bb8:  nop    

0x376e9bba:  nop    

0x376e9bbc:  nop    

0x376e9bbe:  nop 

 

And the code is executed in EAGleview.m...

 

 

VideoPlayBack, Image Targets and custom events

August 1, 2013 - 2:08am #2

It's not clear to me what you mean by "Custom Events", because typically in iOS events can also mean notifications.

It is also not clear where you have put this code and exactly what it is aiming to do.

Chances are that it is crashing because you are trying to do something with the user interface on a background thread - this should always be handled on the main thread i.e. you could try wrapping any UI into a block like this:

dispatch_async(dispatch_get_main_queue(), ^{

    // Do your UI here

});

The other obvious thing to try is to minimise you crashing code line by line or use the debugger to find out where the offending code is.

This should help you to narrow down the problem.

 

HTH

N

Log in or register to post comments