decklink-device.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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;
  17. volatile long refCount = 1;
  18. public:
  19. DeckLinkDevice(IDeckLink *device);
  20. ~DeckLinkDevice(void);
  21. ULONG AddRef(void);
  22. ULONG Release(void);
  23. bool Init();
  24. DeckLinkDeviceMode *FindInputMode(long long id);
  25. DeckLinkDeviceMode *FindOutputMode(long long id);
  26. const std::string& GetDisplayName(void);
  27. const std::string& GetHash(void) const;
  28. const std::vector<DeckLinkDeviceMode *>& GetInputModes(void) const;
  29. const std::vector<DeckLinkDeviceMode *>& GetOutputModes(void) const;
  30. const std::string& GetName(void) const;
  31. int32_t GetMaxChannel(void) const;
  32. bool GetInput(IDeckLinkInput **input);
  33. bool GetOutput(IDeckLinkOutput **output);
  34. inline bool IsDevice(IDeckLink *device_)
  35. {
  36. return device_ == device;
  37. }
  38. };