decklink-device.hpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. int64_t subDeviceIndex = 0;
  20. int64_t numSubDevices = 0;
  21. int64_t minimumPrerollFrames = 3;
  22. int64_t supportedVideoInputConnections = -1;
  23. int64_t supportedVideoOutputConnections = -1;
  24. int64_t supportedAudioInputConnections = -1;
  25. int64_t supportedAudioOutputConnections = -1;
  26. int keyerMode = 0;
  27. volatile long refCount = 1;
  28. public:
  29. DeckLinkDevice(IDeckLink *device);
  30. ~DeckLinkDevice(void);
  31. ULONG AddRef(void);
  32. ULONG Release(void);
  33. bool Init();
  34. DeckLinkDeviceMode *FindInputMode(long long id);
  35. DeckLinkDeviceMode *FindOutputMode(long long id);
  36. const std::string &GetDisplayName(void);
  37. const std::string &GetHash(void) const;
  38. const std::vector<DeckLinkDeviceMode *> &GetInputModes(void) const;
  39. const std::vector<DeckLinkDeviceMode *> &GetOutputModes(void) const;
  40. int64_t GetVideoInputConnections();
  41. int64_t GetAudioInputConnections();
  42. bool GetSupportsExternalKeyer(void) const;
  43. bool GetSupportsInternalKeyer(void) const;
  44. int64_t GetSubDeviceCount();
  45. int64_t GetSubDeviceIndex();
  46. int64_t GetMinimumPrerollFrames();
  47. int GetKeyerMode(void);
  48. void SetKeyerMode(int newKeyerMode);
  49. const std::string &GetName(void) const;
  50. int32_t GetMaxChannel(void) const;
  51. bool GetInput(IDeckLinkInput **input);
  52. bool GetOutput(IDeckLinkOutput **output);
  53. bool GetKeyer(IDeckLinkKeyer **keyer);
  54. inline bool IsDevice(IDeckLink *device_) { return device_ == device; }
  55. };