How do I know number of cameras in gst_dsexample plugin?

• DeepStream Version 6.3
Inside gst_dsexample, how do I know number of sources especially in the function

static gboolean
gst_dsexample_start (GstBaseTransform * btrans) 

?

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU)

• DeepStream Version

• JetPack Version (valid for Jetson only)

• TensorRT Version

• NVIDIA GPU Driver Version (valid for GPU only)

• Issue Type( questions, new requirements, bugs)

• 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)

Hardware Platform (Jetson / GPU): RTX 3080

• DeepStream Version: 6.3

• TensorRT Version: 8.5.3.1

Inside gst_dsexample, how do I know number of sources especially in the function

static gboolean
gst_dsexample_start (GstBaseTransform * btrans) 

?

  1. why do you need to know the number of sources in this function?
  2. this function only can get some data reading from the configuration file because it is not playing status and did get upstream data. you can get number of sources in gst_dsexample_transform_ip by parsing inbuf.

Because I need to allocte memory according to number of sources.
Every time, I don’t want my user needs to change in file.
Possible to know number of sources in init function or start function in gst_dsexample plugin?

  1. what the whole media pipeline?
  2. you can use a max number of sources, or use a global variable to save the number of sources, then get this variable in dsexample plugin. and the source plugin can support adding or deleting source dynamically, you need to consider this special case. please refer to this sample.

I’m using deepstream-app and use gst-dsexample plugin as shown in gst-dsexample plugin sample.
Let me look at ur sample.
How to declare global variable, in which header file to share between main and gst-dsexample plugin?

dsexample plugin is opensource. you can add a property to save the number of sources. In application, you can set the actual value to this property.

I don’t like hardcoded value. I like to link to number of sources from main cpp file and according to number of sources, I can update to variable. I don’t want hardcoded variable. My user need to change whenever number of sources is changed.

please refer to my last comment. you can reset the property value if needed.

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