From 487a136592e4bd5acda92d35cf52fe4489c69bbf Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Fri, 4 Mar 2016 01:23:56 +0100 Subject: [PATCH] Tweak get_available_video_modes() interface. --- bmusb.cpp | 5 ++--- bmusb.h | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/bmusb.cpp b/bmusb.cpp index 1eeedce..b400ac7 100644 --- a/bmusb.cpp +++ b/bmusb.cpp @@ -1231,14 +1231,13 @@ bool decode_video_format(uint16_t video_format, VideoFormat *decoded_video_forma return false; } -vector BMUSBCapture::get_available_video_modes() const +map BMUSBCapture::get_available_video_modes() const { // The USB3 cards autodetect, and seem to have no provision for forcing modes. VideoMode auto_mode; - auto_mode.id = 0; auto_mode.name = "Autodetect"; auto_mode.autodetect = true; - return { auto_mode }; + return {{ 0, auto_mode }}; } void BMUSBCapture::set_video_mode(uint32_t video_mode_id) diff --git a/bmusb.h b/bmusb.h index 8178ac0..e905e05 100644 --- a/bmusb.h +++ b/bmusb.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -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,7 +113,7 @@ class CaptureInterface { public: virtual ~CaptureInterface() {} - virtual std::vector get_available_video_modes() const = 0; + virtual std::map get_available_video_modes() const = 0; virtual void set_video_mode(uint32_t video_mode_id) = 0; @@ -152,7 +152,7 @@ class BMUSBCapture : public CaptureInterface { ~BMUSBCapture() {} - std::vector get_available_video_modes() const override; + std::map get_available_video_modes() const override; void set_video_mode(uint32_t video_mode_id) override; -- 2.39.2