How to change the resource in deepstram_app_main.c

Please provide complete information as applicable to your setup.

**• Hardware Platform (Jetson / GPU)GPU
**• DeepStream Version6.1
• JetPack Version (valid for Jetson only)
**• TensorRT Version8.4
**• NVIDIA GPU Driver Version (valid for GPU only)3090
**• Issue Type( questions, new requirements, bugs)questions
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

Dear professor:

I meet a problem that I hope to change the resource when the deepstream-app. I know the reference code"runtime_source_add_delete ", and I run the demo success. So my problem is:
(1) There are many codes about our project in the deepstream_app.c and gst_dsexample, so if I just use “runtime_source_add_delete”, many function can not be used directly, such as drawing lines in the frame, sink as the rtsp. So I hope to embed the “runtime_source_add_delete” method into deep_stream_main.c. So it is difficult to me.

(2) Is there an easy way to change the source when deepstream-app running? such as I change the rtsp IP in somewhere?

(3) If there is no way to do, how could I embed the “deepstream_test_rt_src_add_del”
? I found the key function is “g_timeout_add_seconds(…)”, is that right? if I just copy the “add_source” function and the related code into deepstream_app_main.c is ok>
I need a direction.
Thank you very much.

Hi, @yangyi . You are right. The key fucntion is

add_sources & delete_sources

You can refer the add_sources func, the key logic is just create a new srcbin and add it to pipeline.

  source_bin = create_uridecode_bin (source_id, uri);
  gst_bin_add (GST_BIN (pipeline), source_bin);

Also you should set the pipeline state correctly and do some other config code.
https://github.com/NVIDIA-AI-IOT/deepstream_reference_apps/blob/master/runtime_source_add_delete/deepstream_test_rt_src_add_del.c

1 Like

@yuweiw Thank you very much

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.