0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
obs-studio/plugins/decklink/decklink-device-instance.hpp
Skyler Lipthay 4225fa8eee decklink: Add Blackmagic DeckLink capture plugin
This is a cross-platform Blackmagic device capture plugin that makes use
of the manufacturer provided DeckLink SDK.
2015-03-21 16:40:05 -07:00

46 lines
1.4 KiB
C++

#pragma once
#include "decklink-device.hpp"
class DeckLinkDeviceInstance : public IDeckLinkInputCallback {
protected:
struct obs_source_frame currentFrame;
struct obs_source_audio currentPacket;
DeckLink *decklink = nullptr;
DeckLinkDevice *device = nullptr;
DeckLinkDeviceMode *mode = nullptr;
ComPtr<IDeckLinkInput> input;
volatile long refCount = 1;
void HandleAudioPacket(IDeckLinkAudioInputPacket *audioPacket,
const uint64_t timestamp);
void HandleVideoFrame(IDeckLinkVideoInputFrame *videoFrame,
const uint64_t timestamp);
public:
DeckLinkDeviceInstance(DeckLink *decklink, DeckLinkDevice *device);
inline DeckLinkDevice *GetDevice() const {return device;}
inline long long GetActiveModeId() const
{
return mode ? mode->GetId() : 0;
}
inline DeckLinkDeviceMode *GetMode() const {return mode;}
bool StartCapture(DeckLinkDeviceMode *mode);
bool StopCapture(void);
HRESULT STDMETHODCALLTYPE VideoInputFrameArrived(
IDeckLinkVideoInputFrame *videoFrame,
IDeckLinkAudioInputPacket *audioPacket);
HRESULT STDMETHODCALLTYPE VideoInputFormatChanged(
BMDVideoInputFormatChangedEvents events,
IDeckLinkDisplayMode *newMode,
BMDDetectedVideoInputFormatFlags detectedSignalFlags);
ULONG STDMETHODCALLTYPE AddRef(void);
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv);
ULONG STDMETHODCALLTYPE Release(void);
};