DecklinkBase.h 948 字节
Newer Older
C
Colin Edwards 已提交
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
#pragma once

#include <map>
#include <vector>
#include <mutex>

#include <obs-module.h>

#include "platform.hpp"

#include "decklink-device-discovery.hpp"
#include "decklink-device-instance.hpp"
#include "decklink-device-mode.hpp"

class DecklinkBase {

protected:
	DecklinkBase(DeckLinkDeviceDiscovery *discovery_);
	ComPtr<DeckLinkDeviceInstance>       instance;
	DeckLinkDeviceDiscovery              *discovery;
	std::recursive_mutex                 deviceMutex;
	volatile long                        activateRefs = 0;
	BMDPixelFormat                       pixelFormat = bmdFormat8BitYUV;
	video_colorspace                     colorSpace = VIDEO_CS_DEFAULT;
	video_range_type                     colorRange = VIDEO_RANGE_DEFAULT;
	speaker_layout                       channelFormat = SPEAKERS_STEREO;

public:
	virtual bool Activate(DeckLinkDevice *device, long long modeId);
	virtual void Deactivate();

	DeckLinkDevice *GetDevice() const;
};