Skip to content

Commit 20a3429

Browse files
ravi-rahulshyam-j
authored andcommitted
Add support for VPAC3L IR output as GRAY8
Signed-off-by: Rahul T R <[email protected]>
1 parent f775e01 commit 20a3429

File tree

1 file changed

+68
-15
lines changed

1 file changed

+68
-15
lines changed

ext/tiovx/gsttiovxisp.c

Lines changed: 68 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ static const gboolean default_lines_interleaved = FALSE;
106106

107107
static const int input_param_id = 3;
108108
static const int output2_param_id = 6;
109+
#if defined(SOC_AM62A)
110+
static const int output0_param_id = 4;
111+
#endif
109112
static const int ae_awb_result_param_id = 1;
110113
static const int h3a_stats_param_id = 9;
111114

@@ -500,7 +503,11 @@ gst_tiovx_isp_target_get_type (void)
500503
}
501504

502505
/* Formats definition */
506+
#if defined(SOC_AM62A)
507+
#define TIOVX_ISP_SUPPORTED_FORMATS_SRC "{NV12, GRAY8}"
508+
#else
503509
#define TIOVX_ISP_SUPPORTED_FORMATS_SRC "{NV12}"
510+
#endif
504511
#define TIOVX_ISP_SUPPORTED_FORMATS_SINK "{ bggr, gbrg, grbg, rggb, bggr10, gbrg10, grbg10, rggb10, rggi10, grig10, bggi10, gbig10, girg10, iggr10, gibg10, iggb10, bggr12, gbrg12, grbg12, rggb12, bggr16, gbrg16, grbg16, rggb16 }"
505512
#define TIOVX_ISP_SUPPORTED_WIDTH "[1 , 8192]"
506513
#define TIOVX_ISP_SUPPORTED_HEIGHT "[1 , 8192]"
@@ -1055,10 +1062,22 @@ gst_tiovx_isp_init_module (GstTIOVXMiso * miso,
10551062
goto out;
10561063
}
10571064
#if defined(SOC_AM62A)
1058-
self->viss_obj.params.bypass_pcid = 0;
1059-
1060-
self->viss_obj.params.enable_ir_op = TIVX_VPAC_VISS_IR_DISABLE;
1061-
self->viss_obj.params.enable_bayer_op = TIVX_VPAC_VISS_BAYER_ENABLE;
1065+
if (NULL == g_strrstr (format_str, "i"))
1066+
self->viss_obj.params.bypass_pcid = 1;
1067+
else
1068+
self->viss_obj.params.bypass_pcid = 0;
1069+
1070+
if (out_info.finfo->format == GST_VIDEO_FORMAT_NV12) {
1071+
self->viss_obj.params.enable_ir_op = TIVX_VPAC_VISS_IR_DISABLE;
1072+
self->viss_obj.params.enable_bayer_op = TIVX_VPAC_VISS_BAYER_ENABLE;
1073+
} else if (out_info.finfo->format == GST_VIDEO_FORMAT_GRAY8) {
1074+
self->viss_obj.params.enable_ir_op = TIVX_VPAC_VISS_IR_ENABLE;
1075+
self->viss_obj.params.enable_bayer_op = TIVX_VPAC_VISS_BAYER_DISABLE;
1076+
} else {
1077+
GST_ERROR_OBJECT (self, "Unsupported Src format %s",
1078+
gst_video_format_to_string (out_info.finfo->format));
1079+
goto out;
1080+
}
10621081

10631082
if (self->viss_obj.params.enable_ir_op) {
10641083
self->viss_obj.output_select[0] = TIOVX_VISS_MODULE_OUTPUT_EN;
@@ -1072,6 +1091,12 @@ gst_tiovx_isp_init_module (GstTIOVXMiso * miso,
10721091
gst_format_to_vx_format (out_info.finfo->format);
10731092
self->viss_obj.output0.width = GST_VIDEO_INFO_WIDTH (&out_info);
10741093
self->viss_obj.output0.height = GST_VIDEO_INFO_HEIGHT (&out_info);
1094+
1095+
GST_INFO_OBJECT (self,
1096+
"Output parameters:\n"
1097+
"\tWidth: %d\n"
1098+
"\tHeight: %d\n",
1099+
self->viss_obj.output0.width, self->viss_obj.output0.height);
10751100
}
10761101

10771102
if (self->viss_obj.params.enable_bayer_op)
@@ -1092,13 +1117,13 @@ gst_tiovx_isp_init_module (GstTIOVXMiso * miso,
10921117
gst_format_to_vx_format (out_info.finfo->format);
10931118
self->viss_obj.output2.width = GST_VIDEO_INFO_WIDTH (&out_info);
10941119
self->viss_obj.output2.height = GST_VIDEO_INFO_HEIGHT (&out_info);
1095-
}
10961120

1097-
GST_INFO_OBJECT (self,
1098-
"Output parameters:\n"
1099-
"\tWidth: %d\n"
1100-
"\tHeight: %d\n",
1101-
self->viss_obj.output2.width, self->viss_obj.output2.height);
1121+
GST_INFO_OBJECT (self,
1122+
"Output parameters:\n"
1123+
"\tWidth: %d\n"
1124+
"\tHeight: %d\n",
1125+
self->viss_obj.output2.width, self->viss_obj.output2.height);
1126+
}
11021127

11031128
self->viss_obj.h3a_stats_bufq_depth = 1;
11041129

@@ -1278,11 +1303,23 @@ gst_tiovx_isp_get_node_info (GstTIOVXMiso * agg,
12781303
}
12791304
}
12801305

1281-
/* Set output parameters, currently only output2 is supported */
1282-
gst_tiovx_miso_pad_set_params (GST_TIOVX_MISO_PAD (src_pad),
1283-
self->viss_obj.output2.arr[0],
1284-
(vx_reference *) & self->viss_obj.output2.image_handle[0],
1285-
graph_parameter_index, output2_param_id);
1306+
#if defined(SOC_AM62A)
1307+
if (self->viss_obj.params.enable_ir_op) {
1308+
gst_tiovx_miso_pad_set_params (GST_TIOVX_MISO_PAD (src_pad),
1309+
self->viss_obj.output0.arr[0],
1310+
(vx_reference *) & self->viss_obj.output0.image_handle[0],
1311+
graph_parameter_index, output0_param_id);
1312+
}
1313+
1314+
if (self->viss_obj.params.enable_bayer_op)
1315+
#endif
1316+
/* Set output parameters, currently only output2 is supported */
1317+
{
1318+
gst_tiovx_miso_pad_set_params (GST_TIOVX_MISO_PAD (src_pad),
1319+
self->viss_obj.output2.arr[0],
1320+
(vx_reference *) & self->viss_obj.output2.image_handle[0],
1321+
graph_parameter_index, output2_param_id);
1322+
}
12861323
graph_parameter_index++;
12871324

12881325
/* ae_awb results & h3a stats aren't input or outputs, these are added as queueable_objects */
@@ -1350,6 +1387,10 @@ gst_tiovx_isp_fixate_caps (GstTIOVXMiso * self,
13501387
const gchar *format_str = NULL;
13511388
GstCaps *output_caps = NULL, *candidate_output_caps = NULL;
13521389
GstStructure *candidate_output_structure = NULL;
1390+
#if defined(SOC_AM62A)
1391+
GValue output_formats = G_VALUE_INIT;
1392+
GValue format = G_VALUE_INIT;
1393+
#endif
13531394

13541395
g_return_val_if_fail (self, NULL);
13551396
g_return_val_if_fail (sink_caps_list, NULL);
@@ -1420,6 +1461,18 @@ gst_tiovx_isp_fixate_caps (GstTIOVXMiso * self,
14201461
gst_caps_set_features_simple (candidate_output_caps,
14211462
gst_tiovx_get_batched_memory_feature ());
14221463
}
1464+
#if defined(SOC_AM62A)
1465+
if (NULL == g_strrstr (format_str, "i")) {
1466+
g_value_init (&output_formats, GST_TYPE_LIST);
1467+
g_value_init (&format, G_TYPE_STRING);
1468+
g_value_set_string (&format, "NV12");
1469+
gst_value_list_append_value (&output_formats, &format);
1470+
gst_structure_set_value (candidate_output_structure, "format",
1471+
&output_formats);
1472+
g_value_unset (&format);
1473+
g_value_unset (&output_formats);
1474+
}
1475+
#endif
14231476

14241477
output_caps = gst_caps_intersect (candidate_output_caps, src_caps);
14251478
output_caps = gst_caps_fixate (output_caps);

0 commit comments

Comments
 (0)