Beispiel #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);
    }
    private void CreateGUI()
    {
        try
        {
            if (!AVProMovieCapturePlugin.Init())
            {
                Debug.LogError("[AVProMovieCapture] Failed to initialise");
                return;
            }
        }
        catch (System.DllNotFoundException e)
        {
            _isFailedInit = true;
            Debug.LogError("[AVProMovieCapture] Unity couldn't find the plugin DLL, please move the 'Plugins' folder to the root of your project.");
            throw e;
        }

        // Video codec enumeration
        int numVideoCodecs = Mathf.Max(0, AVProMovieCapturePlugin.GetNumAVIVideoCodecs());

        _videoCodecNames           = new string[numVideoCodecs + 2];
        _videoCodecNames[0]        = "Uncompressed";
        _videoCodecNames[1]        = null;
        _videoCodecConfigurable    = new bool[numVideoCodecs + 2];
        _videoCodecConfigurable[0] = false;
        _videoCodecConfigurable[1] = false;
        for (int i = 0; i < numVideoCodecs; i++)
        {
            _videoCodecNames[i + 2]        = i.ToString("D2") + ") " + AVProMovieCapturePlugin.GetAVIVideoCodecName(i).Replace("/", "_");
            _videoCodecConfigurable[i + 2] = AVProMovieCapturePlugin.IsConfigureVideoCodecSupported(i);
        }

        // Audio device enumeration
        int numAudioDevices = Mathf.Max(0, AVProMovieCapturePlugin.GetNumAVIAudioInputDevices());

        _audioDeviceNames    = new string[numAudioDevices + 2];
        _audioDeviceNames[0] = "Unity";
        _audioDeviceNames[1] = null;
        for (int i = 0; i < numAudioDevices; i++)
        {
            _audioDeviceNames[i + 2] = i.ToString("D2") + ") " + AVProMovieCapturePlugin.GetAVIAudioInputDeviceName(i).Replace("/", "_");
        }

        // Audio codec enumeration
        int numAudioCodecs = Mathf.Max(0, AVProMovieCapturePlugin.GetNumAVIAudioCodecs());

        _audioCodecNames           = new string[numAudioCodecs + 2];
        _audioCodecNames[0]        = "Uncompressed";
        _audioCodecNames[1]        = null;
        _audioCodecConfigurable    = new bool[numAudioCodecs + 2];
        _audioCodecConfigurable[0] = false;
        _audioCodecConfigurable[1] = false;
        for (int i = 0; i < numAudioCodecs; i++)
        {
            _audioCodecNames[i + 2]        = i.ToString("D2") + ") " + AVProMovieCapturePlugin.GetAVIAudioCodecName(i).Replace("/", "_");
            _audioCodecConfigurable[i + 2] = AVProMovieCapturePlugin.IsConfigureAudioCodecSupported(i);
        }

        _isInit = true;
    }
Beispiel #3
0
 private void ConfigureCodec()
 {
     AVProMovieCapturePlugin.Init();
     SelectCodec(false);
     if (_codecIndex >= 0)
     {
         AVProMovieCapturePlugin.ConfigureVideoCodec(_codecIndex);
     }
     //AVProMovieCapture.Deinit();
 }
Beispiel #4
0
 void Start()
 {
     if (AVProMovieCapturePlugin.Init())
     {
         // Find the index for the video codec
         _videoCodecIndex = FindVideoCodecIndex(X264CodecName);
     }
     else
     {
         this.enabled = false;
     }
 }
    public void Awake()
    {
        try
        {
            AVProMovieCapturePlugin.Init();
            Debug.Log("Using AVProMovieCapture plugin version: " + AVProMovieCapturePlugin.GetPluginVersion().ToString("F2"));
        }
        catch (DllNotFoundException e)
        {
            Debug.Log("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);
    }
    public void Awake()
    {
        try
        {
            AVProMovieCapturePlugin.Init();
            //Debug.Log("[AVProMovieCapture] Init plugin version: " + AVProMovieCapturePlugin.GetPluginVersion().ToString("F2") + " with GPU " + SystemInfo.graphicsDeviceVersion);
        }
        catch (DllNotFoundException e)
        {
            Debug.Log("[AVProMovieCapture] Unity couldn't find the DLL, did you move the 'Plugins' folder to the root of your project?");
#if UNITY_EDITOR
            AVProMovieCaptureCopyPluginWizard.DisplayCopyDialog();
#endif
            throw e;
        }

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

        SelectCodec(_listVideoCodecsOnStart);
        SelectAudioCodec(_listVideoCodecsOnStart);
        SelectAudioDevice(_listVideoCodecsOnStart);
    }
Beispiel #7
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);
    }