DecklinkInput.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #pragma once
  2. #include "DecklinkBase.h"
  3. class DeckLinkInput : public DecklinkBase {
  4. protected:
  5. bool isCapturing = false;
  6. obs_source_t *source;
  7. void SaveSettings();
  8. static void DevicesChanged(void *param, DeckLinkDevice *device,
  9. bool added);
  10. public:
  11. DeckLinkInput(obs_source_t *source, DeckLinkDeviceDiscovery *discovery);
  12. virtual ~DeckLinkInput(void);
  13. long long GetActiveModeId(void) const;
  14. obs_source_t *GetSource(void) const;
  15. inline BMDPixelFormat GetPixelFormat() const { return pixelFormat; }
  16. inline void SetPixelFormat(BMDPixelFormat format)
  17. {
  18. pixelFormat = format;
  19. }
  20. inline video_colorspace GetColorSpace() const { return colorSpace; }
  21. inline void SetColorSpace(video_colorspace format)
  22. {
  23. colorSpace = format;
  24. }
  25. inline video_range_type GetColorRange() const { return colorRange; }
  26. inline void SetColorRange(video_range_type format)
  27. {
  28. colorRange = format;
  29. }
  30. inline speaker_layout GetChannelFormat() const { return channelFormat; }
  31. inline void SetChannelFormat(speaker_layout format)
  32. {
  33. channelFormat = format;
  34. }
  35. bool Activate(DeckLinkDevice *device, long long modeId,
  36. BMDVideoConnection bmdVideoConnection,
  37. BMDAudioConnection bmdAudioConnection) override;
  38. void Deactivate() override;
  39. bool Capturing();
  40. bool buffering = false;
  41. bool dwns = false;
  42. std::string hash;
  43. long long id;
  44. bool swap = false;
  45. bool allow10Bit = false;
  46. BMDVideoConnection videoConnection;
  47. BMDAudioConnection audioConnection;
  48. };