win-capture, libobs: Show names of displays in Display Capture
This commit is contained in:
@@ -273,13 +273,32 @@ static bool get_monitor_props(obs_property_t *monitor_list, int monitor_idx)
|
||||
if (!gs_get_duplicator_monitor_info(monitor_idx, &info))
|
||||
return false;
|
||||
|
||||
dstr_catf(&monitor_desc, "%s %d: %ldx%ld @ %ld,%ld", TEXT_MONITOR,
|
||||
monitor_idx + 1, info.cx, info.cy, info.x, info.y);
|
||||
struct dstr format_str = {0};
|
||||
dstr_copy(&format_str, "%s: %ldx%ld @ %ld,%ld");
|
||||
|
||||
struct dstr m = {0};
|
||||
dstr_copy(&m, info.monitor_name);
|
||||
if (dstr_is_empty(&m)) {
|
||||
// Fallback
|
||||
struct dstr d = {0};
|
||||
dstr_catf(&d, "%s %d", TEXT_MONITOR, monitor_idx + 1);
|
||||
dstr_free(&m);
|
||||
dstr_copy_dstr(&m, &d);
|
||||
dstr_free(&d);
|
||||
}
|
||||
|
||||
if (info.flags & MONITORINFOF_PRIMARY)
|
||||
dstr_catf(&format_str, " (%s)", TEXT_PRIMARY_MONITOR);
|
||||
|
||||
dstr_catf(&monitor_desc, format_str.array, m.array, info.cx, info.cy,
|
||||
info.x, info.y);
|
||||
|
||||
obs_property_list_add_int(monitor_list, monitor_desc.array,
|
||||
monitor_idx);
|
||||
|
||||
dstr_free(&monitor_desc);
|
||||
dstr_free(&format_str);
|
||||
dstr_free(&m);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user