File: decklink-device.hpp

package info (click to toggle)
obs-studio 30.2.3%2Bdfsg-3.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 47,928 kB
  • sloc: ansic: 202,137; cpp: 112,403; makefile: 868; python: 599; sh: 275; javascript: 19
file content (66 lines) | stat: -rw-r--r-- 2,037 bytes parent folder | download | duplicates (2)
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
#pragma once

#include "decklink-device-mode.hpp"

#include <map>
#include <string>
#include <vector>
#include <stdint.h>

class DeckLinkDevice {
	ComPtr<IDeckLink> device;
	std::map<long long, DeckLinkDeviceMode *> inputModeIdMap;
	std::vector<DeckLinkDeviceMode *> inputModes;
	std::map<long long, DeckLinkDeviceMode *> outputModeIdMap;
	std::vector<DeckLinkDeviceMode *> outputModes;
	std::string name;
	std::string displayName;
	std::string hash;
	int32_t maxChannel = 0;
	decklink_bool_t supportsExternalKeyer = false;
	decklink_bool_t supportsInternalKeyer = false;
	decklink_bool_t supportsHDRMetadata = false;
	int64_t subDeviceIndex = 0;
	int64_t numSubDevices = 0;
	int64_t minimumPrerollFrames = 3;
	int64_t supportedVideoInputConnections = -1;
	int64_t supportedVideoOutputConnections = -1;
	int64_t supportedAudioInputConnections = -1;
	int64_t supportedAudioOutputConnections = -1;
	int keyerMode = 0;
	volatile long refCount = 1;

public:
	DeckLinkDevice(IDeckLink *device);
	~DeckLinkDevice(void);

	ULONG AddRef(void);
	ULONG Release(void);

	bool Init();

	DeckLinkDeviceMode *FindInputMode(long long id);
	DeckLinkDeviceMode *FindOutputMode(long long id);
	const std::string &GetDisplayName(void);
	const std::string &GetHash(void) const;
	const std::vector<DeckLinkDeviceMode *> &GetInputModes(void) const;
	const std::vector<DeckLinkDeviceMode *> &GetOutputModes(void) const;
	int64_t GetVideoInputConnections();
	int64_t GetAudioInputConnections();
	bool GetSupportsExternalKeyer(void) const;
	bool GetSupportsInternalKeyer(void) const;
	bool GetSupportsHDRMetadata(void) const;
	int64_t GetSubDeviceCount();
	int64_t GetSubDeviceIndex();
	int64_t GetMinimumPrerollFrames();
	int GetKeyerMode(void);
	void SetKeyerMode(int newKeyerMode);
	const std::string &GetName(void) const;
	int32_t GetMaxChannel(void) const;

	bool GetInput(IDeckLinkInput **input);
	bool GetOutput(IDeckLinkOutput **output);
	bool GetKeyer(IDeckLinkKeyer **keyer);

	inline bool IsDevice(IDeckLink *device_) { return device_ == device; }
};