NvBufSurfTransformMultiInputBufCompositeBlend: Use different source crop on same frame

I am testing NvBufSurfTransformMultiInputBufCompositeBlend.
Can composite API handle same input as composite sources?

I want to composite different crops of same source to destination buffer, like following.

// Simple example
std::uint32_t input_w = 1920;
std::uint32_t input_h = 1080;
std::uint32_t crop_w = 960;
std::uint32_t crop_h = 540;
NvBufSurface* input; // Already filled buffer
NvBufSurface* dst; // Already allocated( 2 x crop_w x crop_h ) buffer
NvBufSurfTransformCompositeBlendParamsEx params{};
params.params.input_buf_count = 2;
params.params.composite_blend_flag = NVBUFSURF_TRANSFORM_COMPOSITE;

/*
Crop left top region and right bottom region and composite horizontaly.
*/
std::vector<NvBufSurfTransformRect> src_crops = {
  {0, 0, crop_w, crop_h},
  {crop_h, crop_w, crop_w, crop_h}
};
std::vector<NvBufSurfTransformRect> dst_crops = {
  {0, 0, crop_w, crop_h},
  {0, crop_w, crop_w, crop_h}
};
params.dst_comp_rect = dst_crops.data();
params.src_comp_rect = src_crops.data();
std::vector<NvBufSurface*> comp_srcs = {src, src};
auto status = NvBufSurfTransformMultiInputBufCompositeBlend(comp_srcs, dst, &params);
std::cout << status << std::endl;

When I ran this code, I got NvBufSurfTransformError_Execution_Error (-2).
Is it have to process indiviausl region using Tranform API?

Hi,
You would need to allocate multiple NvBufSurface for calling the function. Please refer to example in the sample:

/usr/src/jetson_multimedia_api/samples/13_argus_multi_camera

Hi,

OK. I will consider duplicating NvBufSurface. Thank you.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.