Beispiel #1
0
    public void Awake()
    {
        VideoDecoderPlugin.ResetVideoPluginSettings();

        if (VideoDecoderPlugin.GetLastPluginError() != VideoPluginEror.NoError)
        {
            Debug.LogError("VideoDecoderPlugin has an error = " + VideoDecoderPlugin.GetLastPluginError());
        }
    }
Beispiel #2
0
    void LoadVideo()
    {
        videoContext = VideoDecoderPlugin.CreateVideoContext(FullVideoPath, HasAlphaChannel, videoFileOffset, videoFileLenght);

        if (VideoDecoderPlugin.GetLastPluginError() != VideoPluginEror.NoError)
        {
            Debug.LogError("CreateVideoContext has an error = " + VideoDecoderPlugin.GetLastPluginError());
            Stop();
            videoContext = IntPtr.Zero;
            return;
        }

        Width    = VideoDecoderPlugin.GetVideoFrameWidth(videoContext);
        Height   = VideoDecoderPlugin.GetVideoFrameHeight(videoContext);
        Duration = VideoDecoderPlugin.GetVideoDuration(videoContext);
        HasAudio = AudioSource != null && AudioSource.clip != null;

        AllocateTextures();

        ShowFirstFrame();
        GL.IssuePluginEvent(VideoDecoderPlugin.GetRenderEventFunc(), 773);
    }