示例#1
0
    void CreateMovie()
    {
        if (mInternalCreateDelay > 0)
        {
            mInternalCreateDelay -= Time.deltaTime;
            return;
        }

        DebugLog("Creating movie...");

        PopMovieParams Params = new PopMovieParams();

        Params.mPreSeekMs                 = (ulong)(mPreSeekSecs * 1000.0f);
        Params.mSkipPushFrames            = mSkipPushFrames;
        Params.mSkipPopFrames             = mSkipPopFrames;
        Params.mAllowGpuColourConversion  = mAllowGpuColourConversion;
        Params.mAllowCpuColourConversion  = mAllowCpuColourConversion;
        Params.mPixelClientStorage        = mPixelClientStorage;
        Params.mAllowFastCopy             = mAllowFastCopy;
        Params.mAllowSlowCopy             = mAllowSlowCopy;
        Params.mDebugFrameSkipping        = mDebugFrameSkipping;
        Params.mPeekBeforeDefferedCopy    = mPeekBeforeDefferedCopy;
        Params.mDebugNoNewPixelBuffer     = mDebugNoNewPixelBuffer;
        Params.mDebugRenderThreadCallback = mDebugRenderThreadCallback;
        Params.mResetInternalTimestamp    = mResetInternalTimestamp;
        Params.mDebugBlit                 = mDebugBlit;
        Params.mApplyVideoTransform       = mApplyVideoTransform;
        Params.mPopNearestFrame           = mPopNearestFrame;
        Params.mGenerateMipMaps           = mGenerateMipMaps;
        Params.mStretchImage              = mStretchToFillTexture;
        Params.mDecoderUseHardwareBuffer  = mDecoderUseHardwareBuffer;

        try
        {
            mMovie = new PopMovie(filename, Params, true);
            if (mEnableDebugLog)
            {
                mMovie.AddDebugCallback(DebugLog);
            }
            mMovie.AddOnFinishedCallback(OnFinished);
        }
        catch (System.Exception e)
        {
            Debug.LogError("Error creating PopMovieTexture: " + e.Message);
        }
    }