mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-28 02:06:12 -04:00
decklink: Add HDR playback support
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "platform.hpp"
|
||||
#include "obs.hpp"
|
||||
#include <atomic>
|
||||
|
||||
class OBSVideoFrame : public IDeckLinkMutableVideoFrame {
|
||||
private:
|
||||
@@ -75,3 +76,70 @@ public:
|
||||
virtual ULONG STDMETHODCALLTYPE AddRef() override { return 1; }
|
||||
virtual ULONG STDMETHODCALLTYPE Release() override { return 1; }
|
||||
};
|
||||
|
||||
class HDRVideoFrame : public IDeckLinkVideoFrame,
|
||||
public IDeckLinkVideoFrameMetadataExtensions {
|
||||
public:
|
||||
HDRVideoFrame(IDeckLinkMutableVideoFrame *frame);
|
||||
virtual ~HDRVideoFrame() {}
|
||||
|
||||
// IUnknown interface
|
||||
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid,
|
||||
LPVOID *ppv);
|
||||
virtual ULONG STDMETHODCALLTYPE AddRef(void);
|
||||
virtual ULONG STDMETHODCALLTYPE Release(void);
|
||||
|
||||
// IDeckLinkVideoFrame interface
|
||||
virtual long STDMETHODCALLTYPE GetWidth(void)
|
||||
{
|
||||
return m_videoFrame->GetWidth();
|
||||
}
|
||||
virtual long STDMETHODCALLTYPE GetHeight(void)
|
||||
{
|
||||
return m_videoFrame->GetHeight();
|
||||
}
|
||||
virtual long STDMETHODCALLTYPE GetRowBytes(void)
|
||||
{
|
||||
return m_videoFrame->GetRowBytes();
|
||||
}
|
||||
virtual BMDPixelFormat STDMETHODCALLTYPE GetPixelFormat(void)
|
||||
{
|
||||
return m_videoFrame->GetPixelFormat();
|
||||
}
|
||||
virtual BMDFrameFlags STDMETHODCALLTYPE GetFlags(void)
|
||||
{
|
||||
return m_videoFrame->GetFlags() | bmdFrameContainsHDRMetadata;
|
||||
}
|
||||
virtual HRESULT STDMETHODCALLTYPE GetBytes(void **buffer)
|
||||
{
|
||||
return m_videoFrame->GetBytes(buffer);
|
||||
}
|
||||
virtual HRESULT STDMETHODCALLTYPE
|
||||
GetTimecode(BMDTimecodeFormat format, IDeckLinkTimecode **timecode)
|
||||
{
|
||||
return m_videoFrame->GetTimecode(format, timecode);
|
||||
}
|
||||
virtual HRESULT STDMETHODCALLTYPE
|
||||
GetAncillaryData(IDeckLinkVideoFrameAncillary **ancillary)
|
||||
{
|
||||
return m_videoFrame->GetAncillaryData(ancillary);
|
||||
}
|
||||
|
||||
// IDeckLinkVideoFrameMetadataExtensions interface
|
||||
virtual HRESULT STDMETHODCALLTYPE
|
||||
GetInt(BMDDeckLinkFrameMetadataID metadataID, int64_t *value);
|
||||
virtual HRESULT STDMETHODCALLTYPE
|
||||
GetFloat(BMDDeckLinkFrameMetadataID metadataID, double *value);
|
||||
virtual HRESULT STDMETHODCALLTYPE
|
||||
GetFlag(BMDDeckLinkFrameMetadataID metadataID, decklink_bool_t *value);
|
||||
virtual HRESULT STDMETHODCALLTYPE
|
||||
GetString(BMDDeckLinkFrameMetadataID metadataID,
|
||||
decklink_string_t *value);
|
||||
virtual HRESULT STDMETHODCALLTYPE
|
||||
GetBytes(BMDDeckLinkFrameMetadataID metadataID, void *buffer,
|
||||
uint32_t *bufferSize);
|
||||
|
||||
private:
|
||||
ComPtr<IDeckLinkMutableVideoFrame> m_videoFrame;
|
||||
std::atomic<ULONG> m_refCount;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user