I use the pipeline of the deepstream-test3,I have added a Gstreamer plugin videomixer before the nvstreammux, my code like this to link the videomixer and nvstreammux, source bin and videomier,
for (i = 0; i < num_sources; i++) {
//pads pour mix et source_bin
GstPad *sinkpad, *srcpad;
gchar pad_name[16] = { };
GstElement *source_bin= NULL;
if (g_str_has_suffix (argv[1], ".yml") || g_str_has_suffix (argv[1], ".yaml")) {
g_print("Now playing : %s\n",(char*)(src_list)->data);
source_bin = create_source_bin (i, (char*)(src_list)->data);
} else {
source_bin = create_source_bin (i, argv[i + 1]);
}
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);
sinkpad = gst_element_get_request_pad (mix, pad_name);
if (!sinkpad) {
//g_printerr ("Streammux request sink pad failed. Exiting.\n");
g_printerr ("mix 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");
g_printerr ("Failed to link source bin to mix. Exiting.\n");
return -1;
}
//g_object_set (G_OBJECT (mix), “pad_name::ypos”, 0, NULL);
gst_object_unref (srcpad);
gst_object_unref (sinkpad);
if (yaml_config) {
src_list = src_list->next;
}
}
//pads pour mix et nvstreammux
GstPad *sikpad, *sourcepad;
gchar pad_name_sink[16] = “sik_0”;
gchar pad_name_src[16] = “source”;
sikpad = gst_element_get_request_pad (streammux, pad_name_sink);
if (!sikpad) {
g_printerr (“Streammux request sink pad failed. Exiting.\n”);
return -1;
}
sourcepad = gst_element_get_static_pad (mix, pad_name_src);
if (!sourcepad ) {
g_printerr (“mix request src pad failed. Exiting.\n”);
return -1;
}
if (gst_pad_link (sikpad, sourcepad) != GST_PAD_LINK_OK) {
g_printerr (“Failed to link mix to stream muxer. Exiting.\n”);
return -1;
}
gst_object_unref (sikpad);
gst_object_unref (sourcepad);
they are linked avec pads, but the error appear
Decodebin child added: decodebin0
Running…
Decodebin child added: h264parse0
Decodebin child added: capsfilter0
Decodebin child added: nvv4l2decoder0
WARNING from element capsfilter0: not negotiated
Warning: not negotiated
ERROR from element h264parse0: Internal data stream error.
Error details: gstbaseparse.c(3666): gst_base_parse_loop (): /GstPipeline:dstest3-pipeline/GstBin:source-bin-00/GstURIDecodeBin:uri-decode-bin/GstDecodeBin:decodebin0/GstH264Parse:h264parse0:
streaming stopped, reason not-negotiated (-4)
Returned, stopping playback
Deleting pipeline