Nvsipl_camera configuration for srcRect, desRect, output format

Dear @SivaRamaKrishnaNV,
I’ve been working on the application which gets image data and then send it to ROS topic.
I found nvsipl_camera example is suitable for acquiring real-time image data an delivery it to my host application. Forum tickets 305570 and 305568 are related with the application.
Here is brief requirement.

  • Host application

    1. Set parameters
      -. Sensor : ar0820 onsemi
      -. Source Rect (x0, x1, y0, y1) by array → multiple interested areas
      ex. [ 4, 3844, 4, 2164], [1668, 2180, 970, 1258]
      -. Destination Rect(width, height) by array → paired with Source Rect
      ex. [ 960, 540], [ 512, 288]
      -. Port : a0 ~ d3 per Sensor
      ex. two ar0820 cameras connected on a0, a1 each.
      -. Frame_rate : 30 (Hz)
      -. Display Rect for the 1st camera : x0, y0, width, height
      -. Output format : YUV422 or RGBA
    2. Call (modified) nvsipl_camera app with passing defined parameters above
    3. Callback function from nvsipl_camera app with updated NvSciBufObj from OnFrameAvailable func
      -.
  • nvsipl_camera application

    1. main.cpp modified for having class and arguments from Host application

      int main(int argc, char *argv)

      replaced by

      int ApplSipl::Init(CCmdLineParser& params, std::function<void(const int id, NvSciBufObj* buffer)> callback_fnptr)

      -. Please refer to the attached file which shared in 305580 ticket
      No image on monitor during running nvsipl_camera based application - #4 by wooseok.won
      -. Given parameters need to be applied into the pipleline
      → Multiple Source Rect
      → Multiple Destination Rect
      → Output format
      -. NvSciBufObj pointer in the user callback function should have


      → Image data by given format
      → Host application shall be able to copy all the necessary data from the NvSciBufObj