Dynamic adding source PLAY/PAUSE not working in DS

I followed dynamic adding new source during the run time. I am facing one issue. Below are the steps I followed:

  1. First create config.txt and it has RTSP source, primary-gie,secondary-gie and file sink.
  2. I ran the Deepstream and it works fine with file sink data
  3. I put the source (appCtx[0]->pipeline.multi_src_bin.sub_bins[0].bin) in PAUSED mode. FILE sink stopped to generate data
  4. By using dynamic adding source code I added new source during the run time
  5. New source (appCtx[0]->pipeline.multi_src_bin.sub_bins[1].bin) set as either PLAYING or PAUSED state
  6. RTSP source always going to PLAYING state.
  7. Expected result should be PAUSED

Any help will be appreciated.

I followed below source code for adding source during the run time:
gboolean
add_sources (gchar* new_camera_addr,guint source_id)
{
NvDsPipeline *pipeline = &appCtx[0]->pipeline;
GstStateChangeReturn state_return;
NvDsConfig *config=&appCtx[0]->config;
guint i;

parse_dir_source(&appCtx[0]->config,new_camera_addr,source_id);
if(!create_source_bin (&appCtx[0]->config.multi_source_config[source_id], &appCtx[0]->pipeline.multi_src_bin.sub_bins[source_id],source_id)){
g_print(“Failed to Create the New source_bin”);
return FALSE;
}
gst_bin_add (GST_BIN (appCtx[0]->pipeline.multi_src_bin.bin),appCtx[0]->pipeline.multi_src_bin.sub_bins[source_id].bin);
if (!link_element_to_streammux_sink_pad (appCtx[0]->pipeline.multi_src_bin.streammux,
appCtx[0]->pipeline.multi_src_bin.sub_bins[source_id].bin,source_id)) {
g_print(“Cannot Link With Streammux”);
}
appCtx[0]->pipeline.multi_src_bin.num_bins++;

state_return =
gst_element_set_state (appCtx[0]->pipeline.multi_src_bin.sub_bins[source_id].bin, GST_STATE_PLAYING);
switch (state_return) {
case GST_STATE_CHANGE_SUCCESS:
g_print (“STATE CHANGE SUCCESS\n\n”);
return TRUE;
break;
case GST_STATE_CHANGE_FAILURE:
g_print (“STATE CHANGE FAILURE\n\n”);
return FALSE;
break;
case GST_STATE_CHANGE_ASYNC:
g_print (“STATE CHANGE ASYNC\n\n”);
state_return =
gst_element_get_state (appCtx[0]->pipeline.multi_src_bin.sub_bins[source_id].bin, NULL, NULL,
GST_CLOCK_TIME_NONE);
return TRUE;
break;
case GST_STATE_CHANGE_NO_PREROLL:
g_print (“STATE CHANGE NO PREROLL\n\n”);
break;
default:
break;
}
return TRUE;
}

Sorry for the late response, is this still an issue to support?

Thanks

Yes Still I have an issue. I got stuck up. Any inputs are appreciated.

There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks

Can you upload your code and tell us how to run the cases to reproduce the problem?