1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
|
#include "OBSVideoFrame.h"
OBSVideoFrame::OBSVideoFrame(long width, long height,
BMDPixelFormat pixelFormat)
{
int bpp = 2;
this->width = width;
this->height = height;
this->rowBytes = width * bpp;
this->data = new unsigned char[width * height * bpp + 1];
this->pixelFormat = pixelFormat;
}
OBSVideoFrame::~OBSVideoFrame()
{
delete this->data;
}
HRESULT OBSVideoFrame::SetFlags(BMDFrameFlags newFlags)
{
flags = newFlags;
return S_OK;
}
HRESULT OBSVideoFrame::SetTimecode(BMDTimecodeFormat format,
IDeckLinkTimecode *timecode)
{
UNUSED_PARAMETER(format);
UNUSED_PARAMETER(timecode);
return 0;
}
HRESULT
OBSVideoFrame::SetTimecodeFromComponents(BMDTimecodeFormat format,
uint8_t hours, uint8_t minutes,
uint8_t seconds, uint8_t frames,
BMDTimecodeFlags flags)
{
UNUSED_PARAMETER(format);
UNUSED_PARAMETER(hours);
UNUSED_PARAMETER(minutes);
UNUSED_PARAMETER(seconds);
UNUSED_PARAMETER(frames);
UNUSED_PARAMETER(flags);
return 0;
}
HRESULT OBSVideoFrame::SetAncillaryData(IDeckLinkVideoFrameAncillary *ancillary)
{
UNUSED_PARAMETER(ancillary);
return 0;
}
HRESULT OBSVideoFrame::SetTimecodeUserBits(BMDTimecodeFormat format,
BMDTimecodeUserBits userBits)
{
UNUSED_PARAMETER(format);
UNUSED_PARAMETER(userBits);
return 0;
}
long OBSVideoFrame::GetWidth()
{
return width;
}
long OBSVideoFrame::GetHeight()
{
return height;
}
long OBSVideoFrame::GetRowBytes()
{
return rowBytes;
}
BMDPixelFormat OBSVideoFrame::GetPixelFormat()
{
return pixelFormat;
}
BMDFrameFlags OBSVideoFrame::GetFlags()
{
return flags;
}
HRESULT OBSVideoFrame::GetBytes(void **buffer)
{
*buffer = this->data;
return S_OK;
}
|