decklink-device.hpp 1.1 KB

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