decklink-device.hpp 2.3 KB

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