IEnumerator FrameRequest()
        {
            yield return(new WaitForEndOfFrame());

            if (currentState == State.WaitingForFirstFrame)
            {
                #if HDRP_AVAILABLE
                if (UnityHelpers.UsingHDRP())
                {
                    Camera[] cams = Camera.allCameras;
                    foreach (var c in cams)
                    {
                        HDCamera hdcam = HDCamera.GetOrCreate(c);
                        HDAdditionalCameraData hdCameraData = c.GetComponent <HDAdditionalCameraData>();
                        if (hdcam != null && hdCameraData != null && hdCameraData.antialiasing == HDAdditionalCameraData.AntialiasingMode.TemporalAntialiasing)
                        {
                            hdcam.Reset();
                        }
                    }
                }
                #endif
                // We need to wait one more frame to overcome the GameView resolution change
                // REC-589
                yield return(new WaitForEndOfFrame());
            }

            FrameReady();

            if (currentState == State.WaitingForFirstFrame)
            {
                EnterRunningState();
            }

            frameProducedCount++;
        }
        /// <summary>
        /// This is the main entry point for drawing the Recorder editor in the inspector.
        /// </summary>
        public override void OnInspectorGUI()
        {
            if (target == null)
            {
                return;
            }

            EditorGUI.BeginChangeCheck();
            serializedObject.Update();
            if (DrawCaptureSection())
            {
                showCapture.value = DrawHeaderFoldout(Styles.CaptureLabel, showCapture, false);
                if (showCapture)
                {
                    EditorGUILayout.Separator();
                    AOVGUI();
                    ImageRenderOptionsGUI();
                    ExtraOptionsGUI();
#if HDRP_ACCUM_API
                    if (UnityHelpers.UsingHDRP())
                    {
                        AccumulationGUI();
                    }
#endif
                    EditorGUILayout.Separator();
                }
            }

            showFormat.value = DrawHeaderFoldout(Styles.FormatLabel, showFormat, false);
            if (showFormat)
            {
                EditorGUILayout.Separator();
                FileTypeAndFormatGUI();
                OnEncodingGui();
                EditorGUILayout.Separator();
            }
            showOutputFile.value = DrawHeaderFoldout(Styles.OutputFileLabel, showOutputFile, false);
            if (showOutputFile)
            {
                EditorGUILayout.Separator();
                NameAndPathGUI();
                EditorGUILayout.Separator();
            }

            EditorGUILayout.Separator();
            serializedObject.ApplyModifiedProperties();

            EditorGUI.EndChangeCheck();

            if (GUI.changed)
            {
                ((RecorderSettings)target).SelfAdjustSettings();
            }

            OnValidateSettingsGUI();
        }