decklink-device.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #pragma once
  2. #include "decklink-device-mode.hpp"
  3. #include <map>
  4. #include <string>
  5. #include <vector>
  6. class DeckLinkDevice {
  7. ComPtr<IDeckLink> device;
  8. std::map<long long, DeckLinkDeviceMode *> inputModeIdMap;
  9. std::vector<DeckLinkDeviceMode *> inputModes;
  10. std::map<long long, DeckLinkDeviceMode *> outputModeIdMap;
  11. std::vector<DeckLinkDeviceMode *> outputModes;
  12. std::string name;
  13. std::string displayName;
  14. std::string hash;
  15. int32_t maxChannel;
  16. volatile long refCount = 1;
  17. public:
  18. DeckLinkDevice(IDeckLink *device);
  19. ~DeckLinkDevice(void);
  20. ULONG AddRef(void);
  21. ULONG Release(void);
  22. bool Init();
  23. DeckLinkDeviceMode *FindInputMode(long long id);
  24. DeckLinkDeviceMode *FindOutputMode(long long id);
  25. const std::string& GetDisplayName(void);
  26. const std::string& GetHash(void) const;
  27. const std::vector<DeckLinkDeviceMode *>& GetInputModes(void) const;
  28. const std::vector<DeckLinkDeviceMode *>& GetOutputModes(void) const;
  29. const std::string& GetName(void) const;
  30. int32_t GetMaxChannel(void) const;
  31. bool GetInput(IDeckLinkInput **input);
  32. bool GetOutput(IDeckLinkOutput **output);
  33. inline bool IsDevice(IDeckLink *device_)
  34. {
  35. return device_ == device;
  36. }
  37. };