2019-08-26 15:58:20 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "platform.hpp"
|
2020-11-03 15:15:49 -08:00
|
|
|
#include "obs.hpp"
|
2019-08-26 15:58:20 -07:00
|
|
|
|
|
|
|
class OBSVideoFrame : public IDeckLinkMutableVideoFrame {
|
|
|
|
private:
|
|
|
|
BMDFrameFlags flags;
|
|
|
|
BMDPixelFormat pixelFormat = bmdFormat8BitYUV;
|
|
|
|
|
|
|
|
long width;
|
|
|
|
long height;
|
|
|
|
long rowBytes;
|
|
|
|
|
|
|
|
unsigned char *data;
|
|
|
|
|
|
|
|
public:
|
2020-12-16 12:44:37 -08:00
|
|
|
OBSVideoFrame(long width, long height, BMDPixelFormat pixelFormat);
|
2019-08-26 15:58:20 -07:00
|
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE SetFlags(BMDFrameFlags newFlags) override;
|
|
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE SetTimecode(
|
|
|
|
BMDTimecodeFormat format, IDeckLinkTimecode *timecode) override;
|
|
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE SetTimecodeFromComponents(
|
|
|
|
BMDTimecodeFormat format, uint8_t hours, uint8_t minutes,
|
|
|
|
uint8_t seconds, uint8_t frames,
|
|
|
|
BMDTimecodeFlags flags) override;
|
|
|
|
|
|
|
|
HRESULT
|
|
|
|
STDMETHODCALLTYPE
|
|
|
|
SetAncillaryData(IDeckLinkVideoFrameAncillary *ancillary) override;
|
|
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE
|
|
|
|
SetTimecodeUserBits(BMDTimecodeFormat format,
|
|
|
|
BMDTimecodeUserBits userBits) override;
|
|
|
|
|
|
|
|
long STDMETHODCALLTYPE GetWidth() override;
|
|
|
|
|
|
|
|
long STDMETHODCALLTYPE GetHeight() override;
|
|
|
|
|
|
|
|
long STDMETHODCALLTYPE GetRowBytes() override;
|
|
|
|
|
|
|
|
BMDPixelFormat STDMETHODCALLTYPE GetPixelFormat() override;
|
|
|
|
|
|
|
|
BMDFrameFlags STDMETHODCALLTYPE GetFlags() override;
|
|
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE GetBytes(void **buffer) override;
|
|
|
|
|
|
|
|
//Dummy implementations of remaining virtual methods
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE
|
|
|
|
GetTimecode(/* in */ BMDTimecodeFormat format,
|
2020-11-03 15:15:49 -08:00
|
|
|
/* out */ IDeckLinkTimecode **timecode) override
|
2019-08-26 15:58:20 -07:00
|
|
|
{
|
2020-11-03 15:15:49 -08:00
|
|
|
UNUSED_PARAMETER(format);
|
|
|
|
UNUSED_PARAMETER(timecode);
|
2019-08-26 15:58:20 -07:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
};
|
2020-11-03 15:15:49 -08:00
|
|
|
virtual HRESULT STDMETHODCALLTYPE GetAncillaryData(
|
|
|
|
/* out */ IDeckLinkVideoFrameAncillary **ancillary) override
|
2019-08-26 15:58:20 -07:00
|
|
|
{
|
2020-11-03 15:15:49 -08:00
|
|
|
UNUSED_PARAMETER(ancillary);
|
2019-08-26 15:58:20 -07:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
};
|
|
|
|
|
|
|
|
// IUnknown interface (dummy implementation)
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid,
|
2020-11-03 15:15:49 -08:00
|
|
|
LPVOID *ppv) override
|
2019-08-26 15:58:20 -07:00
|
|
|
{
|
2020-11-03 15:15:49 -08:00
|
|
|
UNUSED_PARAMETER(iid);
|
|
|
|
UNUSED_PARAMETER(ppv);
|
2019-08-26 15:58:20 -07:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
2020-11-03 15:15:49 -08:00
|
|
|
virtual ULONG STDMETHODCALLTYPE AddRef() override { return 1; }
|
|
|
|
virtual ULONG STDMETHODCALLTYPE Release() override { return 1; }
|
2019-08-26 15:58:20 -07:00
|
|
|
};
|