mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-10-20 05:01:51 -04:00
decklink: detect BMDPixelFormat in instance constructor
cleaning up my previous commit a bit. we can just keep the appropriate BMDPixelFormat as a data member and keep StartCapture() a bit clearer. this might also be helpful if (when?) the detection code needs to be more robust or configurable
This commit is contained in:
1 parent
1effaca226
commit
ec9d2b42c4
2 files changed
+3
-9
No files matched your search
@@ -17,10 +17,10 @@ DeckLinkDeviceInstance::DeckLinkDeviceInstance(DeckLink *decklink_,
|
||||
// implement BMDDeckLinkPersistentID
|
||||
if (std::string("Intensity Pro 4K").compare(device_->GetName()) == 0) {
|
||||
currentFrame.format = VIDEO_FORMAT_BGRX;
|
||||
doRgb = true;
|
||||
pixelFormat = bmdFormat8BitBGRA;
|
||||
} else {
|
||||
currentFrame.format = VIDEO_FORMAT_UYVY;
|
||||
doRgb = false;
|
||||
pixelFormat = bmdFormat8BitYUV;
|
||||
}
|
||||
|
||||
currentPacket.samples_per_sec = 48000;
|
||||
@@ -91,14 +91,8 @@ bool DeckLinkDeviceInstance::StartCapture(DeckLinkDeviceMode *mode_)
|
||||
|
||||
input->SetCallback(this);
|
||||
|
||||
BMDPixelFormat pixelFormat;
|
||||
const BMDDisplayMode displayMode = mode_->GetDisplayMode();
|
||||
|
||||
if (doRgb)
|
||||
pixelFormat = bmdFormat8BitBGRA;
|
||||
else
|
||||
pixelFormat = bmdFormat8BitYUV;
|
||||
|
||||
const HRESULT videoResult = input->EnableVideoInput(displayMode,
|
||||
pixelFormat, bmdVideoInputFlagDefault);
|
||||
|
||||
|
||||
Reference in new issue
Block a user