Difference between source_id, stream_id and pad_index in nvstreammux?

• DeepStream Version: nvcr.io/nvidia/deepstream:5.1-21.02-devel

In _NvDsFrameMeta, there are separate fields for pad_index and source_id: _NvDsFrameMeta — Deepstream Deepstream Version: 5.1 documentation

What is the difference between these two? For example, in function tiler_src_pad_buffer_probe in /opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/deepstream-test3/deepstream_test3_app.c, isn’t frame_meta->pad_index==frame_meta->source_id always true?

Moreover, the custom message functions API has a function for getting the index of the stream that sent an EOS event to the stream muxer. The index is called stream_id: Custom Message Functions API — Deepstream Deepstream Version: 5.1 documentation

Does the stream index always correspond to pad_index or source_id mentioned above, or is the stream index a third numbering scheme used for distinguishing input streams?

frame_meta->pad_index==frame_meta->source_id always true?

yes.
and stream_id equals to them.