X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=bmusb.h;h=8178ac0ba3e992fd1a6cb350143c9b9cb57ca12f;hb=753cbaf5cec7411bdfe5171404c8586b8015faec;hp=17b5bc082d7a4dc266d25d80d93dcf1e3123b242;hpb=862d8ccf3a3d48602427eb2bfb319b2fc7181fe0;p=bmusb diff --git a/bmusb.h b/bmusb.h index 17b5bc0..8178ac0 100644 --- a/bmusb.h +++ b/bmusb.h @@ -78,6 +78,17 @@ private: std::stack> freelist; // All of size . }; +// Represents an input mode you can tune a card to. +struct VideoMode { + uint32_t id = 0; + std::string name; + bool autodetect = false; // If true, all the remaining fields are irrelevant. + unsigned width = 0, height = 0; + unsigned frame_rate_num = 0, frame_rate_den = 0; + bool interlaced = false; +}; + +// Represents the format of an actual frame coming in. struct VideoFormat { uint16_t id = 0; // For debugging/logging only. unsigned width = 0, height = 0, second_field_start = 0; @@ -102,6 +113,10 @@ class CaptureInterface { public: virtual ~CaptureInterface() {} + virtual std::vector get_available_video_modes() const = 0; + + virtual void set_video_mode(uint32_t video_mode_id) = 0; + // Does not take ownership. virtual void set_video_frame_allocator(FrameAllocator *allocator) = 0; @@ -137,6 +152,10 @@ class BMUSBCapture : public CaptureInterface { ~BMUSBCapture() {} + std::vector get_available_video_modes() const override; + + void set_video_mode(uint32_t video_mode_id) override; + // Does not take ownership. void set_video_frame_allocator(FrameAllocator *allocator) override {