decklink: Fix automatic pixel format detection

This commit is contained in:
Colin Edwards 2020-12-16 14:44:37 -06:00 • committed by Jim
commit 8285141ba5
9 changed files with 76 additions and 28 deletions

View file

@ -1,11 +1,14 @@
#include "OBSVideoFrame.h"
OBSVideoFrame::OBSVideoFrame(long width, long height)
OBSVideoFrame::OBSVideoFrame(long width, long height,
BMDPixelFormat pixelFormat)
{
int bpp = 2;
this->width = width;
this->height = height;
this->rowBytes = width * 2;
this->data = new unsigned char[width * height * 2 + 1];
this->rowBytes = width * bpp;
this->data = new unsigned char[width * height * bpp + 1];
this->pixelFormat = pixelFormat;
}
HRESULT OBSVideoFrame::SetFlags(BMDFrameFlags newFlags)