decklink-device.hpp 1.8 KB

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