Search Unity

Exporting for Android MobileMovieTexture Errors

Discussion in 'AR/VR (XR) Discussion' started by Petnew, May 24, 2016.

?

Exporting for Android MobileMovieTexture Errors

  1. Code Example

    0 vote(s)
    0.0%
  2. Help Programming

    0 vote(s)
    0.0%
Multiple votes are allowed.
  1. Petnew

    Petnew

    Joined:
    May 24, 2016
    Posts:
    2
    Hi guys,

    i'm trying to create my first VR apk for android. I'm stuck with two problems.
    The current verison i am using is Unity Pro 4.5.5, Mobile Movie Texture as Plugin.

    I want to watch a loading video, which will trigger my main video.
    The loading video (used a plane) gets transformed out of my sight as soon it's finished. My main video is triggered and starts playing untill it reaches the end and also gets transformed out of my sight. Now the next cycle beginns again: the loading video is getting moved back to inital position by my finishing main video.
    This is working pretty well until it reaches the 30th cycle which is causing an error named: Unable to open Movie.
    I tracked down this error and found m_nativeContext != IntPtr.Zero value is set to 0 after the 30th cycle.

    if (m_nativeContext != IntPtr.Zero && OpenStream(m_nativeContext, path, (int)offset, (int)length, powerOf2Textures, m_scanDuration, maxSkipFrames))
    {
    Width = GetPicWidth(m_nativeContext);
    Height = GetPicHeight(m_nativeContext);

    m_picX = GetPicX(m_nativeContext);
    m_picY = GetPicY(m_nativeContext);

    m_yStride = GetYStride(m_nativeContext);
    m_yHeight = GetYHeight(m_nativeContext);
    m_uvStride = GetUVStride(m_nativeContext);
    m_uvHeight = GetUVHeight(m_nativeContext);

    CalculateUVScaleOffset();
    }
    else
    {
    Debug.LogError("Unable to open PreviewMovie " + m_nativeContext, this);
    }

    My other problem is after the inital cycle it seems like, my textures are loaded too late (2-3frames) which causes a pink flash right in the beginning of each of the movies (loading and mainvideo).

    I can post the code here or pm you if needed,
    thank you