Hardware Platform : GPU
DeepStream Version : 6.2
Language: C++
for (unsigned int i = 0; i < num_sources; i++)
{
//----------get each rtsp urls and create sources ----------
Json::Value &obj = setting[i];
std::string RTSPUrl = obj["RTSPUrl"].asString();
//---------- Create sources ---------
GstPad *sinkpad, *srcpad;
gchar pad_name[16] = {};
GstElement *source_bin = NULL;
source_bin = create_source_bin(i, g_strdup(RTSPUrl.c_str()));
if (!source_bin)
{
g_printerr("Failed to create source bin. Exiting.\n");
return -1;
}
gst_bin_add(GST_BIN(pipeline), source_bin);
g_snprintf(pad_name, 15, "sink_%u", i);
sinkpad = gst_element_get_request_pad(streammux, pad_name);
if (!sinkpad)
{
g_printerr("Streammux request sink pad failed. Exiting.\n");
return -1;
}
srcpad = gst_element_get_static_pad(source_bin, "src");
if (!srcpad)
{
g_printerr("Failed to get src pad of source bin. Exiting.\n");
return -1;
}
if (gst_pad_link(srcpad, sinkpad) != GST_PAD_LINK_OK)
{
g_printerr("Failed to link source bin to stream muxer. Exiting.\n");
return -1;
}
//
//
// here i want to add additional different data from setting[i] for different sources,
// that can be accessible from sgie_src_pad_buffer_probe. Purpose is to handle different action for different sources.
//
//
//
gst_object_unref(srcpad);
gst_object_unref(sinkpad);
}
while looping for creating multiple sources, add addtional info to sources that can be accessible from sgie_src_pad_buffer_probe.