error creating a singing CSI source bin

Is there a particular reason why create_source_bin() does not support sources of type NV_DS_SOURCE_CAMERA_CSI and that you must call create_multi_source_bin() instead?

Thanks,
Robert.

Source from create_source_bin()

switch (config->type) {
    case NV_DS_SOURCE_CAMERA_V4L2:
      if (!create_camera_source_bin (config, bin)) {
        return FALSE;
      }
      break;
    case NV_DS_SOURCE_URI:
      if (!create_uridecode_src_bin (config, bin)) {
        return FALSE;
      }
      bin->live_source = config->live_source;
      break;
    case NV_DS_SOURCE_RTSP:
      if (!create_rtsp_src_bin (config, bin)) {
        return FALSE;
      }
      break;
    default:
      NVGSTDS_ERR_MSG_V ("Source type not yet implemented!\n");
      return FALSE;

Source code from create_multi_source_bin()

switch (configs[i].type) {
      case NV_DS_SOURCE_CAMERA_CSI:
      case NV_DS_SOURCE_CAMERA_V4L2:
        if (!create_camera_source_bin (&configs[i], &bin->sub_bins[i])) {
          return FALSE;
        }
        break;
      case NV_DS_SOURCE_URI:
        if (!create_uridecode_src_bin (&configs[i], &bin->sub_bins[i])) {
          return FALSE;
        }
        bin->live_source = configs[i].live_source;
        break;
      case NV_DS_SOURCE_RTSP:
        if (!create_rtsp_src_bin (&configs[i], &bin->sub_bins[i])) {
          return FALSE;
        }
        break;
      default:
        NVGSTDS_ERR_MSG_V ("Source type not yet implemented!\n");
        return FALSE;
    }

Hi,
create_source_bin() is not called in deepstream-app. It simply is a reference function and you may remove it.

sorry if my comments were unclear. Yes, I understand that the deepstream-app doesn’t call create_source_bin() because if it did it would fail…

I’m trying to explain that create_source_bin() (I believe) is missing the

case NV_DS_SOURCE_CAMERA_CSI as show in the code snippets above.

and the client (just as deepstream-app does) must call create_multi_source_bin() for a single source.

In an effort to provide more clarity…

For my case, I’m trying to use DS 4.0 without using the deepstream-app. I’m developing a C++ library with an API to expose to python applications.

Calling create_source_bin() with a NV_DS_SOURCE_CAMERA_CSI results in
“Source type not yet implemented!\n”

I have fixed my installed copy of create_source_bin.c by adding the CASE, but doing so makes this project difficult to share as open source.

Thanks,
Robert.

Hi,
We think it is fine to let create_multi_source_bin() be general to single or multiple source(s). These are all open source and you may customize it for your usecases.