aja: Show/Hide SDI Transport/4K lists and options

Only show SDI Transport options if IOSelection is SDI and

only show 12G selection in Capture plugin
This commit is contained in:
Paul Hindt 2022-01-27 14:13:40 -08:00 committed by Colin Edwards
parent f559287723
commit 0ef3b29cad
2 changed files with 36 additions and 17 deletions

View File

@ -58,6 +58,27 @@ static void free_video_frame(struct video_data *frame)
memset(frame, 0, sizeof(*frame));
}
static void update_sdi_transport_and_sdi_transport_4k(obs_properties_t *props,
NTV2DeviceID device_id,
IOSelection io,
NTV2VideoFormat vf)
{
// Update SDI Transport and SDI 4K Transport selections
obs_property_t *sdi_trx_list =
obs_properties_get(props, kUIPropSDITransport.id);
obs_property_list_clear(sdi_trx_list);
populate_sdi_transport_list(sdi_trx_list, io, device_id);
obs_property_t *sdi_4k_trx_list =
obs_properties_get(props, kUIPropSDITransport4K.id);
obs_property_list_clear(sdi_4k_trx_list);
populate_sdi_4k_transport_list(sdi_4k_trx_list);
bool is_sdi = aja::IsIOSelectionSDI(io);
obs_property_set_visible(sdi_trx_list, is_sdi);
obs_property_set_visible(sdi_4k_trx_list,
is_sdi && NTV2_IS_4K_VIDEO_FORMAT(vf));
}
AJAOutput::AJAOutput(CNTV2Card *card, const std::string &cardID,
const std::string &outputID, UWord deviceIndex,
const NTV2DeviceID deviceID)
@ -835,11 +856,11 @@ bool aja_output_device_changed(void *data, obs_properties_t *props,
IOSelection io_select = static_cast<IOSelection>(
obs_data_get_int(settings, kUIPropOutput.id));
obs_property_list_clear(sdi_trx_list);
populate_sdi_transport_list(sdi_trx_list, io_select, deviceID);
obs_property_list_clear(sdi_4k_list);
populate_sdi_4k_transport_list(sdi_4k_list);
update_sdi_transport_and_sdi_transport_4k(
props, cardEntry->GetDeviceID(), io_select,
static_cast<NTV2VideoFormat>(obs_data_get_int(
settings, kUIPropVideoFormatSelect.id)));
return true;
}
@ -898,13 +919,10 @@ bool aja_output_dest_changed(obs_properties_t *props, obs_property_t *list,
}
}
obs_property_t *sdi_trx_list =
obs_properties_get(props, kUIPropSDITransport.id);
obs_property_list_clear(sdi_trx_list);
populate_sdi_transport_list(sdi_trx_list, io_select,
cardEntry->GetDeviceID());
obs_property_set_visible(sdi_trx_list,
aja::IsIOSelectionSDI(io_select));
update_sdi_transport_and_sdi_transport_4k(
props, cardEntry->GetDeviceID(), io_select,
static_cast<NTV2VideoFormat>(obs_data_get_int(
settings, kUIPropVideoFormatSelect.id)));
return true;
}

View File

@ -676,8 +676,6 @@ bool aja_source_device_changed(void *data, obs_properties_t *props,
IOSelection io_select = static_cast<IOSelection>(
obs_data_get_int(settings, kUIPropInput.id));
obs_property_list_clear(sdi_trx_list);
obs_property_list_add_int(sdi_trx_list, obs_module_text("Auto"),
kAutoDetect);
populate_sdi_transport_list(sdi_trx_list, io_select, deviceID, true);
obs_property_list_clear(sdi_4k_list);
@ -694,6 +692,8 @@ bool aja_source_device_changed(void *data, obs_properties_t *props,
obs_property_set_visible(io_select_list, have_cards);
obs_property_set_visible(vid_fmt_list, have_cards);
obs_property_set_visible(pix_fmt_list, have_cards);
obs_property_set_visible(
sdi_trx_list, have_cards && aja::IsIOSelectionSDI(io_select));
obs_property_set_visible(
sdi_4k_list, have_cards && NTV2_IS_4K_VIDEO_FORMAT(curr_vf));
@ -725,11 +725,12 @@ bool aja_io_selection_changed(void *data, obs_properties_t *props,
return false;
}
obs_property_t *io_select_list =
obs_properties_get(props, kUIPropInput.id);
filter_io_selection_input_list(cardID, ajaSource->GetName(),
io_select_list);
obs_properties_get(props, kUIPropInput.id));
obs_property_set_visible(
obs_properties_get(props, kUIPropSDITransport.id),
aja::IsIOSelectionSDI(static_cast<IOSelection>(
obs_data_get_int(settings, kUIPropInput.id))));
return true;
}