Please help me to understand this function , which section of code is responsible for enabling the tracker for secondary GIE
**
- Function to create common elements(Primary infer, tracker, secondary infer)
- of the pipeline. These components operate on muxed data from all the
- streams. So they are independent of number of streams in the pipeline.
*/
static gboolean
create_common_elements (NvDsConfig * config, NvDsPipeline * pipeline,
GstElement ** sink_elem, GstElement ** src_elem,
bbox_generated_callback bbox_generated_post_analytics_cb)
{
gboolean ret = FALSE;
*sink_elem = *src_elem = NULL;
if (config->primary_gie_config.enable) {
if (config->num_secondary_gie_sub_bins > 0) {
/** if using nvmultiurisrcbin, override batch-size config for sgie */
if (config->use_nvmultiurisrcbin) {
for (guint i = 0; i < config->num_secondary_gie_sub_bins; i++) {
config->secondary_gie_sub_bin_config[i].batch_size =
config->sgie_batch_size;
}
}
if (!create_secondary_gie_bin (config->num_secondary_gie_sub_bins,
config->primary_gie_config.unique_id,
config->secondary_gie_sub_bin_config,
&pipeline->common_elements.secondary_gie_bin)) {
goto done;
}
gst_bin_add (GST_BIN (pipeline->pipeline),
pipeline->common_elements.secondary_gie_bin.bin);
if (!*src_elem) {
*src_elem = pipeline->common_elements.secondary_gie_bin.bin;
}
if (*sink_elem) {
NVGSTDS_LINK_ELEMENT (pipeline->common_elements.secondary_gie_bin.bin,
*sink_elem);
}
*sink_elem = pipeline->common_elements.secondary_gie_bin.bin;
}
}
if (config->primary_gie_config.enable) {
if (config->num_secondary_preprocess_sub_bins > 0) {
if (!create_secondary_preprocess_bin (config->
num_secondary_preprocess_sub_bins,
config->primary_gie_config.unique_id,
config->secondary_preprocess_sub_bin_config,
&pipeline->common_elements.secondary_preprocess_bin)) {
g_print (“creating secondary_preprocess bin failed\n”);
goto done;
}
gst_bin_add (GST_BIN (pipeline->pipeline),
pipeline->common_elements.secondary_preprocess_bin.bin);
if (!*src_elem) {
*src_elem = pipeline->common_elements.secondary_preprocess_bin.bin;
}
if (*sink_elem) {
NVGSTDS_LINK_ELEMENT (pipeline->common_elements.
secondary_preprocess_bin.bin, *sink_elem);
}
*sink_elem = pipeline->common_elements.secondary_preprocess_bin.bin;
}
}
if (config->dsanalytics_config.enable) {
if (!create_dsanalytics_bin (&config->dsanalytics_config,
&pipeline->common_elements.dsanalytics_bin)) {
g_print (“creating dsanalytics bin failed\n”);
goto done;
}
gst_bin_add (GST_BIN (pipeline->pipeline),
pipeline->common_elements.dsanalytics_bin.bin);
if (!*src_elem) {
*src_elem = pipeline->common_elements.dsanalytics_bin.bin;
}
if (*sink_elem) {
NVGSTDS_LINK_ELEMENT (pipeline->common_elements.dsanalytics_bin.bin,
*sink_elem);
}
*sink_elem = pipeline->common_elements.dsanalytics_bin.bin;
}
if (config->tracker_config.enable) {
if (!create_tracking_bin (&config->tracker_config,
&pipeline->common_elements.tracker_bin)) {
g_print (“creating tracker bin failed\n”);
goto done;
}
gst_bin_add (GST_BIN (pipeline->pipeline),
pipeline->common_elements.tracker_bin.bin);
if (!*src_elem) {
*src_elem = pipeline->common_elements.tracker_bin.bin;
}
if (*sink_elem) {
NVGSTDS_LINK_ELEMENT (pipeline->common_elements.tracker_bin.bin,
*sink_elem);
}
*sink_elem = pipeline->common_elements.tracker_bin.bin;
}
if (config->primary_gie_config.enable) {
/** if using nvmultiurisrcbin, override batch-size config for pgie */
if (config->use_nvmultiurisrcbin) {
config->primary_gie_config.batch_size = config->max_batch_size;
}
if (!create_primary_gie_bin (&config->primary_gie_config,
&pipeline->common_elements.primary_gie_bin)) {
goto done;
}
gst_bin_add (GST_BIN (pipeline->pipeline),
pipeline->common_elements.primary_gie_bin.bin);
if (*sink_elem) {
NVGSTDS_LINK_ELEMENT (pipeline->common_elements.primary_gie_bin.bin,
*sink_elem);
}
*sink_elem = pipeline->common_elements.primary_gie_bin.bin;
if (!*src_elem) {
*src_elem = pipeline->common_elements.primary_gie_bin.bin;
}
NVGSTDS_ELEM_ADD_PROBE (pipeline->
common_elements.primary_bbox_buffer_probe_id,
pipeline->common_elements.primary_gie_bin.bin, “src”,
gie_primary_processing_done_buf_prob, GST_PAD_PROBE_TYPE_BUFFER,
pipeline->common_elements.appCtx);
}
if (config->preprocess_config.enable) {
if (!create_preprocess_bin (&config->preprocess_config,
&pipeline->common_elements.preprocess_bin)) {
g_print (“creating preprocess bin failed\n”);
goto done;
}
gst_bin_add (GST_BIN (pipeline->pipeline),
pipeline->common_elements.preprocess_bin.bin);
if (!*src_elem) {
*src_elem = pipeline->common_elements.preprocess_bin.bin;
}
if (*sink_elem) {
NVGSTDS_LINK_ELEMENT (pipeline->common_elements.preprocess_bin.bin,
*sink_elem);
}
*sink_elem = pipeline->common_elements.preprocess_bin.bin;
}
if (*src_elem) {
NVGSTDS_ELEM_ADD_PROBE (pipeline->
common_elements.primary_bbox_buffer_probe_id, *src_elem, “src”,
analytics_done_buf_prob, GST_PAD_PROBE_TYPE_BUFFER,
&pipeline->common_elements);
/* Add common message converter */
if (config->msg_conv_config.enable) {
NvDsSinkMsgConvBrokerConfig *convConfig = &config->msg_conv_config;
pipeline->common_elements.msg_conv =
gst_element_factory_make (NVDS_ELEM_MSG_CONV, "common_msg_conv");
if (!pipeline->common_elements.msg_conv) {
NVGSTDS_ERR_MSG_V ("Failed to create element 'common_msg_conv'");
goto done;
}
g_object_set (G_OBJECT (pipeline->common_elements.msg_conv),
"config", convConfig->config_file_path,
"msg2p-lib",
(convConfig->conv_msg2p_lib ? convConfig->conv_msg2p_lib : "null"),
"payload-type", convConfig->conv_payload_type, "comp-id",
convConfig->conv_comp_id, "debug-payload-dir",
convConfig->debug_payload_dir, "multiple-payloads",
convConfig->multiple_payloads, NULL);
gst_bin_add (GST_BIN (pipeline->pipeline),
pipeline->common_elements.msg_conv);
NVGSTDS_LINK_ELEMENT (*src_elem, pipeline->common_elements.msg_conv);
*src_elem = pipeline->common_elements.msg_conv;
}
pipeline->common_elements.tee =
gst_element_factory_make (NVDS_ELEM_TEE, "common_analytics_tee");
if (!pipeline->common_elements.tee) {
NVGSTDS_ERR_MSG_V ("Failed to create element 'common_analytics_tee'");
goto done;
}
gst_bin_add (GST_BIN (pipeline->pipeline), pipeline->common_elements.tee);
NVGSTDS_LINK_ELEMENT (*src_elem, pipeline->common_elements.tee);
*src_elem = pipeline->common_elements.tee;
}
ret = TRUE;
done:
return ret;
}
I assume this the function you are mentioned. Please can you help me to understand this pipeline to enable tracker for secondary gie