Exemplo n.º 1
0
    public void Awake()
    {
        try
        {
            if (AVProMovieCapturePlugin.Init())
            {
                Debug.Log("[AVProMovieCapture] Init plugin version: " + AVProMovieCapturePlugin.GetPluginVersion().ToString("F2") + " with GPU " + SystemInfo.graphicsDeviceVersion);
#if AVPRO_MOVIECAPTURE_GLISSUEEVENT_52
                _renderEventFunction = AVProMovieCapturePlugin.GetRenderEventFunc();
                _freeEventFunction   = AVProMovieCapturePlugin.GetFreeResourcesEventFunc();
#endif
            }
            else
            {
                Debug.LogError("[AVProMovieCapture] Failed to initialise plugin version: " + AVProMovieCapturePlugin.GetPluginVersion().ToString("F2") + " with GPU " + SystemInfo.graphicsDeviceVersion);
            }
        }
        catch (DllNotFoundException e)
        {
            Debug.LogError("[AVProMovieCapture] Unity couldn't find the DLL, did you move the 'Plugins' folder to the root of your project?");
            throw e;
        }

        _isDirectX11 = SystemInfo.graphicsDeviceVersion.StartsWith("Direct3D 11");

        SelectCodec(_listVideoCodecsOnStart);
        SelectAudioCodec(_listVideoCodecsOnStart);
        SelectAudioDevice(_listVideoCodecsOnStart);
    }
Exemplo n.º 2
0
    public void Awake()
    {
        try
        {
            float pluginVersion = AVProMovieCapturePlugin.GetPluginVersion();

            // Check that the plugin version number is not too old
            if (pluginVersion < ScriptVersion)
            {
                Debug.LogWarning("[AVProMovieCapture] Plugin version number " + pluginVersion.ToString("F2") + " is older than script version number " + ScriptVersion.ToString("F2") + ".  It looks like the plugin didn't upgrade correctly.  To resolve this please restart Unity and try to upgrade the package again.");
            }

            if (AVProMovieCapturePlugin.Init())
            {
                Debug.Log("[AVProMovieCapture] Init plugin version: " + pluginVersion.ToString("F2") + " with GPU " + SystemInfo.graphicsDeviceVersion);

#if AVPRO_MOVIECAPTURE_GLISSUEEVENT_52
                _renderEventFunction = AVProMovieCapturePlugin.GetRenderEventFunc();
                _freeEventFunction   = AVProMovieCapturePlugin.GetFreeResourcesEventFunc();
#endif
            }
            else
            {
                Debug.LogError("[AVProMovieCapture] Failed to initialise plugin version: " + pluginVersion.ToString("F2") + " with GPU " + SystemInfo.graphicsDeviceVersion);
            }
        }
        catch (DllNotFoundException e)
        {
            Debug.LogError("[AVProMovieCapture] Unity couldn't find the DLL, did you move the 'Plugins' folder to the root of your project?");
            throw e;
        }

        _isDirectX11 = SystemInfo.graphicsDeviceVersion.StartsWith("Direct3D 11");

        SelectCodec(_listVideoCodecsOnStart);
        SelectAudioCodec(_listVideoCodecsOnStart);
        SelectAudioDevice(_listVideoCodecsOnStart);
    }