private void StartCapture() { _lastFileSize = 0; CreateComponents(); if (_capture != null) { _capture._audioCapture = _audioCapture; Configure(_capture); _capture.SelectCodec(false); if (!_capture._noAudio) { _capture.SelectAudioCodec(false); _capture.SelectAudioDevice(false); } _capture.QueueStartCapture(); } }
private void CreateGUI() { _downScales = new string[6]; _downScales[0] = "Original"; _downScales[1] = "Half"; _downScales[2] = "Quarter"; _downScales[3] = "Eighth"; _downScales[4] = "Sixteenth"; _downScales[5] = "Specific"; switch (_movieCapture._downScale) { default: case AVProMovieCaptureBase.DownScale.Original: _downScaleIndex = 0; break; case AVProMovieCaptureBase.DownScale.Half: _downScaleIndex = 1; break; case AVProMovieCaptureBase.DownScale.Quarter: _downScaleIndex = 2; break; case AVProMovieCaptureBase.DownScale.Eighth: _downScaleIndex = 3; break; case AVProMovieCaptureBase.DownScale.Sixteenth: _downScaleIndex = 4; break; case AVProMovieCaptureBase.DownScale.Specific: _downScaleIndex = 5; break; } _frameRates = new string[6]; _frameRates[0] = "15"; _frameRates[1] = "24"; _frameRates[2] = "25"; _frameRates[3] = "30"; _frameRates[4] = "50"; _frameRates[5] = "60"; switch (_movieCapture._frameRate) { default: case AVProMovieCaptureBase.FrameRate.Fifteen: _frameRateIndex = 0; break; case AVProMovieCaptureBase.FrameRate.TwentyFour: _frameRateIndex = 1; break; case AVProMovieCaptureBase.FrameRate.TwentyFive: _frameRateIndex = 2; break; case AVProMovieCaptureBase.FrameRate.Thirty: _frameRateIndex = 3; break; case AVProMovieCaptureBase.FrameRate.Fifty: _frameRateIndex = 4; break; case AVProMovieCaptureBase.FrameRate.Sixty: _frameRateIndex = 5; break; } int numVideoCodecs = AVProMovieCapturePlugin.GetNumAVIVideoCodecs(); if (numVideoCodecs > 0) { _videoCodecNames = new string[numVideoCodecs + 1]; _videoCodecNames[0] = "Uncompressed"; _videoCodecConfigurable = new bool[numVideoCodecs]; for (int i = 0; i < numVideoCodecs; i++) { _videoCodecNames[i + 1] = AVProMovieCapturePlugin.GetAVIVideoCodecName(i); _videoCodecConfigurable[i] = AVProMovieCapturePlugin.IsConfigureVideoCodecSupported(i); } } int numAudioDevices = AVProMovieCapturePlugin.GetNumAVIAudioInputDevices(); if (numAudioDevices > 0) { _audioDeviceNames = new string[numAudioDevices + 1]; _audioDeviceNames[0] = "Unity"; for (int i = 0; i < numAudioDevices; i++) { _audioDeviceNames[i + 1] = AVProMovieCapturePlugin.GetAVIAudioInputDeviceName(i); } } int numAudioCodecs = AVProMovieCapturePlugin.GetNumAVIAudioCodecs(); if (numAudioCodecs > 0) { _audioCodecNames = new string[numAudioCodecs + 1]; _audioCodecNames[0] = "Uncompressed"; _audioCodecConfigurable = new bool[numAudioCodecs]; for (int i = 0; i < numAudioCodecs; i++) { _audioCodecNames[i + 1] = AVProMovieCapturePlugin.GetAVIAudioCodecName(i); _audioCodecConfigurable[i] = AVProMovieCapturePlugin.IsConfigureAudioCodecSupported(i); } } _movieCapture.SelectCodec(false); _movieCapture.SelectAudioCodec(false); _movieCapture.SelectAudioDevice(false); }