Require the default input source/output destination and channel 1 or 5 for quad modes

This commit is contained in:
Sebastian Dröge 2021-12-03 11:40:16 +02:00
parent d1c7e0e7bb
commit de8e5ed9f4
2 changed files with 30 additions and 7 deletions

View file

@ -597,6 +597,20 @@ static gboolean gst_aja_sink_set_caps(GstBaseSink *bsink, GstCaps *caps) {
return FALSE;
}
if (quad_mode) {
if (self->output_destination != GST_AJA_OUTPUT_DESTINATION_AUTO) {
GST_ERROR_OBJECT(self,
"Quad modes require usage of the channel's default "
"output destination");
return FALSE;
}
if (self->channel != ::NTV2_CHANNEL1 && self->channel != ::NTV2_CHANNEL5) {
GST_ERROR_OBJECT(self, "Quad modes require channels 1 or 5");
return FALSE;
}
}
self->quad_mode = quad_mode;
self->video_format = video_format;

View file

@ -473,6 +473,22 @@ static gboolean gst_aja_src_configure(GstAjaSrc *self) {
#undef NEEDS_QUAD_MODE
if (self->quad_mode) {
if (self->input_source != GST_AJA_INPUT_SOURCE_AUTO &&
!(self->input_source >= GST_AJA_INPUT_SOURCE_HDMI1 &&
self->input_source <= GST_AJA_INPUT_SOURCE_HDMI4)) {
GST_ERROR_OBJECT(
self,
"Quad modes require usage of the channel's default input source");
return FALSE;
}
if (self->channel != ::NTV2_CHANNEL1 && self->channel != ::NTV2_CHANNEL5) {
GST_ERROR_OBJECT(self, "Quad modes require channels 1 or 5");
return FALSE;
}
}
bool had_quad_enabled = false, had_quad_quad_enabled = false;
if (self->channel < ::NTV2_CHANNEL5) {
@ -501,13 +517,6 @@ static gboolean gst_aja_src_configure(GstAjaSrc *self) {
}
}
if (self->quad_mode) {
if (self->channel != ::NTV2_CHANNEL1 && self->channel != ::NTV2_CHANNEL5) {
GST_ERROR_OBJECT(self, "Quad modes require channels 1 or 5");
return FALSE;
}
}
if (self->buffer_pool) {
gst_buffer_pool_set_active(self->buffer_pool, FALSE);
gst_clear_object(&self->buffer_pool);