Integrate CSI MIPI pipeline in to C/C++

I know you need these two shell commands to set up the csi mipi pipeline

$ sudo media-ctl -d /dev/media0 -l '"msm_csiphy0":1->"msm_csid0":0[1],"msm_csid0":1->"msm_ispif0":0[1],"msm_ispif0":1->"msm_vfe0_rdi0":0[1]'
$ sudo media-ctl -d /dev/media0 -V '"ov5645 4-003b":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_csiphy0":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_csid0":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_ispif0":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_vfe0_rdi0":0[fmt:UYVY8_2X8/1920x1080 field:none]'

Is it possible to set this up in C/C++ without calling shell commands via system()?

Well, you can certainly re-implement what media-ctl is doing, and submit the ioctls yourself:

But system() call seems the easiest way here.

You are right, I expected an extensive media-ctl api…