Hi TI Experts
Platform: Ver0.7.03
A csitx demo for 1920x720@25fps with format UYVY, I send data by the function app_csitx_create_graph_1920_0720_25P( in the below code block).
But the rx side report the decode error.
I have two questions:
1. Is the function below correct? I use the similar function for 1920x1080@25fps with format UYVY, and it can transferred successful.
2. Could you please tell me the method to dump the frames to verify whether the frames correct?
static vx_status app_csitx_create_graph_1920_0720_25P(AppCsitxObj *obj) { vx_status status = VX_SUCCESS; uint32_t frmIdx = 0; uint32_t loopCnt = 0; vx_image tx_frame_array_item = NULL; VX_PRINT(VX_ZONE_INFO, "Creating graph \n"); /* Create graph */ obj->graph = vxCreateGraph(obj->context); if(status == VX_SUCCESS) { VX_PRINT(VX_ZONE_INFO, "Creating graph done\n"); status = vxGetStatus((vx_reference) obj->graph); } obj->rect.start_x = IMAGE_POSI_START_X; obj->rect.start_y = IMAGE_POSI_START_Y; obj->rect.end_x = IMAGE_POSI_1920_720_END_X; obj->rect.end_y = IMAGE_POSI_1920_720_END_Y; /* set init value of all parameters */ obj->csitx_image = vxCreateImage(obj->context, obj->rect.end_x, obj->rect.end_y, CSITX_FORMAT); if (obj->csitx_image == NULL) { VX_PRINT(VX_ZONE_ERROR, "%s[%d]csitx_image cretae failed\n", __FUNCTION__, __LINE__); } /* create the parameter list */ /* allocate Input and Output refs*/ obj->csitx_frame_obj = vxCreateObjectArray(obj->context, (vx_reference)obj->csitx_image, NUM_CHANNELS); if (obj->csitx_frame_obj == NULL) { VX_PRINT(VX_ZONE_ERROR, "%s[%d] csitx_frame_obj create failed\n", __FUNCTION__, __LINE__); } /* this is currently supported for UYVY formats only */ /* initialization of frames for each channel with unique pattern it is (channel no. + x) */ VX_PRINT(VX_ZONE_INFO,"Initializing Transmit Buffers...\n"); for (frmIdx = 0U ; frmIdx < NUM_CHANNELS ; frmIdx++) { tx_frame_array_item = (vx_image)vxGetObjectArrayItem(obj->csitx_frame_obj , frmIdx); if (tx_frame_array_item == NULL) { VX_PRINT(VX_ZONE_ERROR,"%s[%d]vx_frame_array_item create failed\n", __FUNCTION__, __LINE__); } else { VX_PRINT(VX_ZONE_INFO, "vxGetObjectArrayItem success\n"); } app_csitx_load_vximage_from_yuvfile(tx_frame_array_item, IMAGE_1920x720_UYVY); status = vxReleaseImage(&tx_frame_array_item); if(status != VX_SUCCESS) { VX_PRINT(VX_ZONE_ERROR, "%s[%d] tx_frame_array_item Release failed\n", __FUNCTION__, __LINE__); } } VX_PRINT(VX_ZONE_INFO, "Initializing Transmit Buffers Done.\n"); /* CSITX Config initialization */ tivx_csitx_params_init(&obj->csitx_config); obj->csitx_config.numInst = 1U; obj->csitx_config.numCh = NUM_CHANNELS; obj->csitx_config.instId[0U] = CSITX_INST_ID; obj->csitx_config.instCfg[0U].rxCompEnable = (uint32_t)vx_true_e; obj->csitx_config.instCfg[0U].rxv1p3MapEnable = (uint32_t)vx_true_e; obj->csitx_config.instCfg[0U].laneBandSpeed = TIVX_CSITX_LANE_BAND_SPEED_120_TO_160_MBPS; obj->csitx_config.instCfg[0U].numDataLanes = 4U; for (loopCnt = 0U; loopCnt < obj->csitx_config.instCfg[0U].numDataLanes ; loopCnt++) { obj->csitx_config.instCfg[0U].lanePolarityCtrl[loopCnt] = 0u; } for (loopCnt = 0U; loopCnt < NUM_CHANNELS; loopCnt++) { obj->csitx_config.chVcNum[loopCnt] = loopCnt; obj->csitx_config.chInstMap[loopCnt] = CSITX_INST_ID; } VX_PRINT(VX_ZONE_INFO, "start to call vxCreateUserDataObject\n"); obj->csitx_config_obj = vxCreateUserDataObject(obj->context, "tivx_csitx_params_t", sizeof(tivx_csitx_params_t), &obj->csitx_config); if (obj->csitx_config_obj == NULL) { VX_PRINT(VX_ZONE_ERROR, "%s[%d] csitx_config create failed\n", __FUNCTION__, __LINE__); } VX_PRINT(VX_ZONE_INFO, "Start to call tivxCsitxNode\n"); obj->csitx_node = tivxCsitxNode(obj->graph, obj->csitx_config_obj, obj->csitx_frame_obj); if (obj->csitx_node == NULL) { VX_PRINT(VX_ZONE_ERROR, "%s[%d] csitx_node create failed\n", __FUNCTION__, __LINE__); } VX_PRINT(VX_ZONE_INFO, "Start to call vxSetNodeTarget\n"); status = vxSetNodeTarget(obj->csitx_node, VX_TARGET_STRING, TIVX_TARGET_CSITX); if (status != VX_SUCCESS) { VX_PRINT(VX_ZONE_ERROR, "%s[%d] TIVX_TARGET_CSITX set failed\n", __FUNCTION__, __LINE__); } /* input @ node index 0, becomes csitx_graph parameter 1 */ VX_PRINT(VX_ZONE_INFO, "Start to call add_graph_parameter_by_node_index\n"); add_graph_parameter_by_node_index(obj->graph, obj->csitx_node, 1); VX_PRINT(VX_ZONE_INFO, "Start to run vxVerifyGraph\n"); status = vxVerifyGraph(obj->graph); if (status != VX_SUCCESS) { VX_PRINT(VX_ZONE_ERROR, "%s[%d] csitx_graph verified failed\n", __FUNCTION__, __LINE__); } VX_PRINT(VX_ZONE_INFO, "app_create_graph exiting\n"); return status; }
best wishes
Chengwu.Tang