]> git.sesse.net Git - bmusb/blobdiff - bmusb.h
Add a way to get the current video mode.
[bmusb] / bmusb.h
diff --git a/bmusb.h b/bmusb.h
index 8178ac0ba3e992fd1a6cb350143c9b9cb57ca12f..9ba27bcc111234040d807bbcd0fafbb3f3cd9275 100644 (file)
--- a/bmusb.h
+++ b/bmusb.h
@@ -6,6 +6,7 @@
 #include <condition_variable>
 #include <deque>
 #include <functional>
+#include <map>
 #include <mutex>
 #include <stack>
 #include <string>
@@ -80,7 +81,6 @@ private:
 
 // 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;
@@ -113,8 +113,8 @@ class CaptureInterface {
  public:
        virtual ~CaptureInterface() {}
 
-       virtual std::vector<VideoMode> get_available_video_modes() const = 0;
-
+       virtual std::map<uint32_t, VideoMode> get_available_video_modes() const = 0;
+       virtual uint32_t get_current_video_mode() const = 0;
        virtual void set_video_mode(uint32_t video_mode_id) = 0;
 
        // Does not take ownership.
@@ -152,8 +152,8 @@ class BMUSBCapture : public CaptureInterface {
 
        ~BMUSBCapture() {}
 
-       std::vector<VideoMode> get_available_video_modes() const override;
-
+       std::map<uint32_t, VideoMode> get_available_video_modes() const override;
+       uint32_t get_current_video_mode() const override;
        void set_video_mode(uint32_t video_mode_id) override;
 
        // Does not take ownership.