Change camera resolution after initializing the CaptureHolder

I am using Argus lib to work with a camera, everything works fine. I use this code snippet to initialize the capture holder with a specific resolution:

Argus::Size2D<uint32_t> STREAM_SIZE(W, H);

My question is how can I change the camera resolution after starting its work?
For example I get 100 frames, then I need to switch to another resolution and continue capturing.
I tried to re-call the setResolution method in the middle of the program (with a valid resolution of course) but it throws a Bus error (core dumped).

I searched the samples but couldn’t find a sample that changes the resolution in the middile of the way. Should I destroy all the camera objects and re-initialize the capture holder again? (although re-initialization takes some time so it’s not the preferred choice).
Thank you,

Please reference to the argus_camera.
You can change the sensor mode from the GUI to check the behavior for it.


Thank you
Can you specify the relative path of the sample in the MMAPI directory?
I found 09_argus_camera_jpeg sample, is this the one you are reffering to?

It’s /usr/src/jetson_multimedia_api/argus/apps/

I tried to understand the code but it seems totally different than other samples that we used to use (particularly 13_argus_multi_camera). My original question was to see if can use the same iEglStreamSettings module to make the setting changes during the work of camera.
If it is not possible to do some change, is there a way that we reset the camera and start the camera from the scratch again (without stopping our main program)? I mean in that case we have the problem of sudo service nvargus-daemon restart which has to be done manually. Is there an equivalent way to do it inside the code?

For mode change you need stop streaming → set sensor mode → start streaming like this flow.