public void StartCapture(IDeckLinkDisplayMode displayMode, IDeckLinkScreenPreviewCallback screenPreviewCallback, bool applyDetectedInputMode) { if (m_currentlyCapturing) { return; } var videoInputFlags = _BMDVideoInputFlags.bmdVideoInputFlagDefault; m_applyDetectedInputMode = applyDetectedInputMode; m_validInputSignal = false; // Enable input video mode detection if the device supports it if (supportsFormatDetection && m_applyDetectedInputMode) { videoInputFlags |= _BMDVideoInputFlags.bmdVideoInputEnableFormatDetection; } // Set the screen preview m_deckLinkInput.SetScreenPreviewCallback(screenPreviewCallback); // Set capture callback m_deckLinkInput.SetCallback(this); // Set the video input mode m_deckLinkInput.EnableVideoInput(displayMode.GetDisplayMode(), _BMDPixelFormat.bmdFormat8BitYUV, videoInputFlags); // Start the capture m_deckLinkInput.StartStreams(); m_currentlyCapturing = true; }
public void StartCapture(_BMDDisplayMode mode, IDeckLinkScreenPreviewCallback screenPreviewCallback, bool applyDetectedInputMode) { logger.Debug("StartCapture(...) " + mode); if (currentlyCapturing) { return; } deckLinkInput.GetDisplayMode(_BMDDisplayMode.bmdModeHD1080i5994, out IDeckLinkDisplayMode displayMode); StartCapture(displayMode, screenPreviewCallback, applyDetectedInputMode); }
public void StartCapture(IDeckLinkDisplayMode displayMode, IDeckLinkScreenPreviewCallback screenPreviewCallback, bool applyDetectedInputMode) { logger.Debug("StartCapture(...)"); if (currentlyCapturing) { return; } validInputSignal = false; this.applyDetectedInputMode = applyDetectedInputMode; var videoInputFlags = _BMDVideoInputFlags.bmdVideoInputFlagDefault; // Enable input video mode detection if the device supports it if (SupportsFormatDetection && this.applyDetectedInputMode) { videoInputFlags |= _BMDVideoInputFlags.bmdVideoInputEnableFormatDetection; } var pixelFormat = _BMDPixelFormat.bmdFormat8BitYUV; var bdmDisplayMode = displayMode.GetDisplayMode(); // Set the screen preview //_deckLinkInput.SetScreenPreviewCallback(screenPreviewCallback); // Set capture callback deckLinkInput.SetCallback(this); // Set the video input mode deckLinkInput.EnableVideoInput(bdmDisplayMode, pixelFormat, videoInputFlags); deckLinkInput.EnableAudioInput(AudioSampleRate, AudioSampleType, (uint)AudioChannelsCount); // Start the capture deckLinkInput.StartStreams(); currentlyCapturing = true; }