1
0

decklink-device.hpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #pragma once
  2. #include "decklink-device-mode.hpp"
  3. #include <map>
  4. #include <string>
  5. #include <vector>
  6. #include <stdint.h>
  7. class DeckLinkDevice {
  8. ComPtr<IDeckLink> device;
  9. std::map<long long, DeckLinkDeviceMode *> inputModeIdMap;
  10. std::vector<DeckLinkDeviceMode *> inputModes;
  11. std::map<long long, DeckLinkDeviceMode *> outputModeIdMap;
  12. std::vector<DeckLinkDeviceMode *> outputModes;
  13. std::string name;
  14. std::string displayName;
  15. std::string hash;
  16. int32_t maxChannel = 0;
  17. decklink_bool_t supportsExternalKeyer = false;
  18. decklink_bool_t supportsInternalKeyer = false;
  19. decklink_bool_t supportsHDRMetadata = false;
  20. int64_t subDeviceIndex = 0;
  21. int64_t numSubDevices = 0;
  22. int64_t minimumPrerollFrames = 3;
  23. int64_t supportedVideoInputConnections = -1;
  24. int64_t supportedVideoOutputConnections = -1;
  25. int64_t supportedAudioInputConnections = -1;
  26. int64_t supportedAudioOutputConnections = -1;
  27. int keyerMode = 0;
  28. volatile long refCount = 1;
  29. public:
  30. DeckLinkDevice(IDeckLink *device);
  31. ~DeckLinkDevice(void);
  32. ULONG AddRef(void);
  33. ULONG Release(void);
  34. bool Init();
  35. DeckLinkDeviceMode *FindInputMode(long long id);
  36. DeckLinkDeviceMode *FindOutputMode(long long id);
  37. const std::string &GetDisplayName(void);
  38. const std::string &GetHash(void) const;
  39. const std::vector<DeckLinkDeviceMode *> &GetInputModes(void) const;
  40. const std::vector<DeckLinkDeviceMode *> &GetOutputModes(void) const;
  41. int64_t GetVideoInputConnections();
  42. int64_t GetAudioInputConnections();
  43. bool GetSupportsExternalKeyer(void) const;
  44. bool GetSupportsInternalKeyer(void) const;
  45. bool GetSupportsHDRMetadata(void) const;
  46. int64_t GetSubDeviceCount();
  47. int64_t GetSubDeviceIndex();
  48. int64_t GetMinimumPrerollFrames();
  49. int GetKeyerMode(void);
  50. void SetKeyerMode(int newKeyerMode);
  51. const std::string &GetName(void) const;
  52. int32_t GetMaxChannel(void) const;
  53. bool GetInput(IDeckLinkInput **input);
  54. bool GetOutput(IDeckLinkOutput **output);
  55. bool GetKeyer(IDeckLinkKeyer **keyer);
  56. inline bool IsDevice(IDeckLink *device_) { return device_ == device; }
  57. };