private IEnumerator FrameOutFinalize()
        {
            this.Manager.RemoveCamera(this);
            yield return(new WaitForEndOfFrame());

            SfMovieRecord.EndMovieRecord(this.outputFilePath, this.outputFileTitle);
            this.isRecording = false;
        }
 public void StartMovieRecord()
 {
     if (!this.isRecording && (this.texture.GetNativeTexturePtr() != IntPtr.Zero) && this.Manager.IsEncoderAddable)
     {
         SfMovieRecord.StartMovieRecord(this.outputFilePath, this.outputFileTitle, this.texture.GetNativeTexturePtr(), this.Manager.FPS, this.withAudio, (ulong)this.audioDeviceIndex);
         this.Manager.AddCamera(this);
         this.isRecording = true;
     }
 }
        void Start()
        {
            var manager = GameObject.FindObjectOfType(typeof(GPUVideoEncodeManager));

            if (manager == null)
            {
                manager      = (GameObject)Instantiate(Resources.Load("Prefabs/GPUVideoEncodeManager"));
                manager.name = "GPUVideoEncodeManager";
                this.Manager = (manager as GameObject).GetComponent <GPUVideoEncodeManager>();
            }
            else
            {
                this.Manager = (manager as GPUVideoEncodeManager);
            }

            var debugDelegate   = new SfMovieRecord.DebugDelegate(SfMovieRecordPluginDebugCallBack);
            var functionPointer = Marshal.GetFunctionPointerForDelegate(debugDelegate);

            SfMovieRecord.SetDebugFunction(functionPointer);
        }
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            MovieRecordCamera mrc = (this.target as MovieRecordCamera);

            var count = SfMovieRecord.GetAudioDeviceCount();

            //Debug.Log(string.Format("{0}", count));
            audioDeviceNames = new string[count];
            for (ulong i = 0; i < count; i++)
            {
                audioDeviceNames[i] = SfMovieRecord.GetAudioDeviceName(i);
                //Debug.Log(string.Format("{0}", name.ToString()));
            }
            var index = EditorGUILayout.Popup("Audio Device", mrc.audioDeviceIndex, audioDeviceNames);

            if (index != mrc.audioDeviceIndex)
            {
                Undo.RecordObject(mrc, "AudioDeviceIndex Change");
                mrc.audioDeviceIndex = index;
                EditorUtility.SetDirty(mrc);
            }
        }
Beispiel #5
0
 private void FrameOutInMainThread()
 {
     GL.IssuePluginEvent(SfMovieRecord.GetRenderEventFunc(), 1);
 }
 public void OnApplicationQuit()
 {
     this.EndMovieRecord();
     SfMovieRecord.SetDebugFunction(IntPtr.Zero);
 }