Search Unity

App crash when recording with FaceCam

Discussion in 'Unity Everyplay' started by grafd, Nov 1, 2015.

  1. grafd

    grafd

    Joined:
    Oct 30, 2015
    Posts:
    6
    Hi there,

    we are testing recording with Everyplay and FaceCam in our game app (landscape only, iOS 9.1, testing on iPhone 5S and iPad 2) and it works fine, only the very first time. To stop recording we call:

    [[[EveryplaysharedInstance] capture] stopRecording]​

    The recording is stopped and the delegate method "everyplayRecordingStopped" is called. Automatically the FaceCam session is stopped, too, since the delegate method "everyplayFaceCamSessionStopped" gets also called. Now we preview the recording by calling:

    [[EveryplaysharedInstance] playLastRecording]​

    Everyplay's preview window is shown and everything seems fine. Now when closing this window the app crashes! Well... what's the point? Any idea?
     
  2. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Without a crash log it is impossible to say. I noticed your other thread about orientations and it is possible these issues are related. Are you using Unity or some other engine? What version?
     
  3. grafd

    grafd

    Joined:
    Oct 30, 2015
    Posts:
    6
    Hi there. Well the two problems are not related. The one with the orientation I have solved as described. For this one I have currently a work around where I had to make two things:

    1) Do not rely on stopping FaceCam automatically when stopping recording but do it manually => Then the crash happened in the line where I call [[[EveryplaysharedInstance] faceCam] startSession] next time.

    2) I make a call to "performSelector: withObject: afterDelay:" do give Everyplay some time for in-hounse cleaning. :) before triggering the recording again. I assume that it is a multi-threading issue in Everyplay; not sure.

    What do you think?
     
  4. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Interesting. Is the thread where you call playLastRecording the main thread? If not you could try to call it in main thread like

    Code (csharp):
    1.  
    2. dispatch_async(dispatch_get_main_queue(), ^{
    3.     [[EveryplaysharedInstance] playLastRecording];
    4. });
    5.  
    Same goes for the other methods like startSession.. try to do them in main thread.