GUI: Fix specific display device selection

This commit is contained in:
Martin Piatka
2023-03-13 15:23:59 +01:00
committed by Martin Pulec
parent 4bc5614fa6
commit be415f5cb4
2 changed files with 11 additions and 10 deletions

View File

@@ -28,16 +28,6 @@ struct DeviceMode{
std::vector<SettingVal> opts;
};
struct Device{
std::string name;
std::string type;
std::string deviceOpt;
std::map<std::string, std::string> extra;
std::vector<DeviceMode> modes;
};
struct CapabOpt{
std::string displayName; //Name displayed to user
std::string displayDesc; //Description displayed to user
@@ -52,6 +42,16 @@ struct CapabOpt{
bool booleanOpt; //If true, GUI shows a checkbox instead of text edit
};
struct Device{
std::string name;
std::string type; //UltraGrid module name (e.g. v4l2)
std::string deviceOpt; //Specific device (e.g. ":device=/dev/video0")
std::map<std::string, std::string> extra;
std::vector<DeviceMode> modes;
};
struct Encoder{
std::string name;
std::string optStr;

View File

@@ -92,6 +92,7 @@ std::vector<SettingItem> getVideoDisplay(AvailableSettings *availSettings){
SettingItem item;
item.name = i.name;
item.opts.push_back({optStr, i.type});
item.opts.push_back({optStr + "." + i.type + ".device", i.deviceOpt});
auto embedAudioIt = i.extra.find("embeddedAudioAvailable");
bool enableAudio = embedAudioIt != i.extra.end()
&& embedAudioIt->second == "t";