TDA4AH-Q1: Gstreamer Multiple Appsrc sources with different resolution- Mosaic using tiovxmosaic With GST Wrapper Functions

Part Number: TDA4AH-Q1

Tool/software:

Hi ,

Gstremer and tiovxmosaic is supporting different resolution inputs.

when using gst_wrapper function ,  it has only one input resolution parameter for all channel inputs.

in gst_wrapper.c file,  plane size for all channels are configured as below.

int32_t appGstSrcInit(void* data_ptr[CODEC_MAX_BUFFER_DEPTH][CODEC_MAX_NUM_CHANNELS][CODEC_MAX_NUM_PLANES])
{
    int32_t status = 0;
    GstCaps* caps = NULL;
    app_gst_wrapper_obj_t* p_gst_pipe_obj = &g_app_gst_wrapper_obj;
    uint32_t plane_size = p_gst_pipe_obj->params.in_width * p_gst_pipe_obj->params.in_height;

    /* Setup AppSrc Elements */
    for (uint8_t ch = 0; ch < p_gst_pipe_obj->params.in_num_channels; ch++)
    {
        p_gst_pipe_obj->m_srcElemArr[ch]  = findElementByName(p_gst_pipe_obj->m_pipeline, 
                                                    p_gst_pipe_obj->params.m_AppSrcNameArr[ch]);
        if (p_gst_pipe_obj->m_srcElemArr[ch] == NULL)
        {
            printf("gst_wrapper: findElementByName() FAILED! %s not found\n", p_gst_pipe_obj->params.m_AppSrcNameArr[ch]);
            status = -1;
        }
        else
        {
            p_gst_pipe_obj->isAppSrc = GST_IS_APP_SRC(p_gst_pipe_obj->m_srcElemArr[ch]);
            if (p_gst_pipe_obj->isAppSrc)
            {
                caps = gst_caps_new_simple("video/x-raw",
                                        "width", G_TYPE_INT, p_gst_pipe_obj->params.in_width,
                                        "height", G_TYPE_INT, p_gst_pipe_obj->params.in_height,
                                        "format", G_TYPE_STRING, p_gst_pipe_obj->params.in_format,
                                        NULL);
                if (caps == NULL)
                {
                    printf("gst_wrapper: gst_caps_new_simple() FAILED!\n");
                    status = -1;
                }
                gst_app_src_set_caps (GST_APP_SRC(p_gst_pipe_obj->m_srcElemArr[ch]), caps);
                gst_caps_unref (caps);
            }
            else 
            {
                printf("gst_wrapper: %s not an AppSrc element\n", p_gst_pipe_obj->params.m_AppSrcNameArr[ch]);
                status = -1;
            }
        }
    }

    /* Setup GstBuffers to push to AppSrc Elements using given data_ptrs */
    if (status==0)
    {
        for (uint8_t idx = 0; idx < p_gst_pipe_obj->params.in_buffer_depth && status==0; idx++)
        {
            for (uint8_t ch = 0; ch < p_gst_pipe_obj->params.in_num_channels && status==0; ch++)
            {
                p_gst_pipe_obj->buff[idx][ch] = gst_buffer_new();

                p_gst_pipe_obj->mem[idx][ch][0] = gst_memory_new_wrapped (0, data_ptr[idx][ch][0], plane_size, 0, plane_size, NULL, NULL);
                p_gst_pipe_obj->mem[idx][ch][1] = gst_memory_new_wrapped (0, data_ptr[idx][ch][1], plane_size/2, 0, plane_size/2, NULL, NULL);

                gst_buffer_append_memory (p_gst_pipe_obj->buff[idx][ch], p_gst_pipe_obj->mem[idx][ch][0]);
                gst_buffer_append_memory (p_gst_pipe_obj->buff[idx][ch], p_gst_pipe_obj->mem[idx][ch][1]);

                p_gst_pipe_obj->mem[idx][ch][0] = gst_buffer_get_memory (p_gst_pipe_obj->buff[idx][ch], 0);
                p_gst_pipe_obj->mem[idx][ch][1] = gst_buffer_get_memory (p_gst_pipe_obj->buff[idx][ch], 1);

                gst_memory_map(p_gst_pipe_obj->mem[idx][ch][0],&p_gst_pipe_obj->map_info[idx][ch][0], GST_MAP_WRITE);
                gst_memory_map(p_gst_pipe_obj->mem[idx][ch][1],&p_gst_pipe_obj->map_info[idx][ch][1], GST_MAP_WRITE);
            }
        }
    }

    if (status==0) p_gst_pipe_obj->push_count = 0;

    return status;
}

as the above functions will support for single input resolutions for different channels of appsrc's , Please clarify how to proceed further if input resolutions are different for each channels of appsrc..