Implement FlexConnect and add tests (VPAC VISS+MSC) GStreamer plugin#378
Implement FlexConnect and add tests (VPAC VISS+MSC) GStreamer plugin#378
Conversation
|
@PrathamTI For SITSW-8156, are you planning to add tests for this new plugin via [0]? [0] - https://github.com/TexasInstruments/edgeai-gst-plugins/tree/main/tests/check |
|
In commit message,
|
0b2278a to
7478a40
Compare
Yes, planning on adding tests after the bug is resolved |
@PrathamTI Bisecting the color artifacts issue in imaging and resolving the crop params control command bug might take some time. However, I noticed that the tests under edgeai-gst-plugins/tests/check use Adding unit tests for If you don't have the implementation ready yet, you can check out gsttiovxisp.c to get started. We should also evaluate how many positive and negative tests from |
Good Idea |
7478a40 to
a47b754
Compare
ext/tiovx/gsttiovxfc.c
Outdated
| @@ -0,0 +1,2716 @@ | |||
| /* | |||
| * Copyright (c) [2025] Texas Instruments Incorporated | |||
ext/tiovx/gsttiovxfc.c
Outdated
| { | ||
| GstTIOVXFC *self = NULL; | ||
| vx_status status = VX_FAILURE; | ||
| gboolean ret = FALSE; |
There was a problem hiding this comment.
do you really need ret, can you use status ?
| gst_tivox_fc_compute_src_dimension (GstTIOVXSimo * simo, | ||
| const GValue * dimension, GValue * out_value, guint roi_len) | ||
| { | ||
| static const gint scale = 4; |
There was a problem hiding this comment.
what is 4, better to use #define or add comment
| } | ||
|
|
||
| out_max = dim_max; | ||
| out_min = 1.0 * dim_min / scale + 0.5; |
There was a problem hiding this comment.
again here, 0.5, 1.0 ?
add some comments
| gst_tivox_fc_compute_sink_dimension (GstTIOVXSimo * simo, | ||
| const GValue * dimension, GValue * out_value, guint roi_len) | ||
| { | ||
| static const gint scale = 4; |
ext/tiovx/gsttiovxfc.c
Outdated
| } | ||
| else | ||
| { | ||
|
|
ext/tiovx/gsttiovxfc.c
Outdated
| GST_ERROR_OBJECT (self, "Unable to call analog gain ioctl: %d", | ||
| ret_val); | ||
| } | ||
| close_fd: |
ext/tiovx/gsttiovxfc.c
Outdated
| GST_DEBUG_OBJECT (self, "Configuring IR/Bayer operation based on output format"); | ||
|
|
||
| /* Detect if input is Bayer format for GRAY8 output decision */ | ||
| is_bayer_input = FALSE; |
There was a problem hiding this comment.
it is already initialize as FALSE, why again ?
ext/tiovx/gsttiovxfc.c
Outdated
|
|
||
| /* Configure MSC outputs - route IR output to MSC output 0 */ | ||
| GST_DEBUG_OBJECT (self, "Configuring MSC outputs for IR"); | ||
| for (int i = 6; i <= 10; i++) { |
ext/tiovx/gsttiovxfc.c
Outdated
| GST_DEBUG_OBJECT (self, "Module init succeeded"); | ||
| ret = TRUE; | ||
|
|
||
| out: |
ext/tiovx/gsttiovxfc.h
Outdated
| * | ||
| * DISCLAIMER. | ||
| * | ||
| * THIS SOFTWARE IS PROVItivx_vpac_fc_viss_msc_params_tDED BY TI AND TI’S LICENSORS "AS IS" AND ANY EXPRESS |
There was a problem hiding this comment.
tivx_vpac_fc_viss_msc_params_t is i guess mistakenly pasted here. Correct the same
|
Update the copyright year from [2022-2026] is the year range i suppose for the file ext/tiovx/gsttiovx.c as there are few updates. |
| } | ||
|
|
||
| GST_DEBUG_OBJECT(self, "Setting up VISS-MSC input mapping"); | ||
| flexconnect->fc_params.msc_in_thread_viss_out_map[0] = TIVX_VPAC_FC_VISS_OUT2; |
There was a problem hiding this comment.
any reason behind not using TIVX_VPAC_FC_VISS_OUT0/1 ?
There was a problem hiding this comment.
As defined in [0], for VPAC3 or VPAC3L devices msc_in_thread_viss_out_map should be mapped to TIVX_VPAC_FC_VISS_OUT2.
There was a problem hiding this comment.
In https://bitbucket.itg.ti.com/projects/PROCESSOR-SDK-VISION/repos/edgeai-tiovx-modules/pull-requests/69/diff#src%2Ftiovx_fc_module.c?t=88, you have mapped msc_in_thread_viss_out_map to TIVX_VPAC_FC_VISS_OUT0 and 1 and rest to invalid. Is it a delta or is there any reason behind this ?
There was a problem hiding this comment.
For TIOVX module params initialisation, Imaging kernel has enabled TIVX_VPAC_FC_VISS_OUT0 and TIVX_VPAC_FC_VISS_OUT1 [0] so followed the same in tiovx_fc_module.c and the gstreamer implementation was based on [1] test case so the mapping of TIVX_VPAC_FC_VISS_OUT2 and TIVX_VPAC_FC_VISS_OUT3 was required.
0952ec7 to
a647124
Compare
ext/tiovx/gsttiovxfc.h
Outdated
| @@ -0,0 +1,88 @@ | |||
| /* | |||
| * Copyright (c) [2025] Texas Instruments Incorporated | |||
v-singh1
left a comment
There was a problem hiding this comment.
change copyright year in ext/tiovx/gsttiovxfc.h
Implement FlexConnect hardware-accelerated ISP
pipeline combining VISS and MSC in a single
GStreamer element for TI AM62A and compatible
platforms.
This implementation is based on the official TI
FlexConnect kernel node enabled in TI Processor
SDK RTOS[0].
Current Implementation:
1. Single output stream support
- FlexConnect can take raw Bayer camera input
and produce one processed output stream
(e.g., 1920x1080 NV12 or GRAY8)
2. Two output formats supported
- NV12: Standard color format (YUV 4:2:0) for display/encode
- GRAY8: 8-bit grayscale for computer vision applications
3. Mutliple camera support
- Flexconnect is supported on multiple camera (e.g IMX219,
IMX390, etc)
Test Suite:
Comprehensive test suite added for FlexConnect plugin validation:
1. test_target
- Validates target property with supported values (VPAC_FC)
2. test_foreach_format
- Tests all supported Bayer input formats (bggr, gbrg, grbg, rggb)
- Validates format conversion to NV12 output
3. test_resolutions_with_downscale_fail
- Validates FC correctly rejects downscaling attempts
- Tests hardware limitation (output must be >= input dimensions)
4. test_resolutions_with_upscale_fail
- Validates FC correctly rejects odd output dimensions
- Tests NV12 format constraint (requires even width/height)
5. test_input_format_fail
- Tests invalid Bayer input format rejection
- Validates caps negotiation failure during state change
6. test_output_format_fail
- Tests invalid output format rejection for all valid input formats
- Validates proper format validation behavior
TODO:
1. Multiple output stream support
2. Add support for TIVX_VPAC_FC_MSC_CMD_SET_CROP_PARAMS
control command.
[0] https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/latest/exports/docs/tiovx/docs/user_guide/hwa__vpac__fc_8h_source.html
Signed-off-by: Pratham Deshmukh <p-deshmukh@ti.com>
a647124 to
779d466
Compare
Implement FlexConnect hardware-accelerated ISP pipeline combining VISS and MSC in a single
GStreamer element for TI AM62A and compatible platforms.
This implementation is based on the official TI FlexConnect kernel node enabled in TI Processor
SDK RTOS[0].
Current Implementation:
Single output stream support - FlexConnect can take raw Bayer camera input and produce one processed output stream (e.g., 1920x1080 NV12 or GRAY8)
Two output formats supported - NV12: Standard color format (YUV 4:2:0) for display/encode - GRAY8: 8-bit grayscale for computer vision applications
Mutliple camera suppor - Flexconnect is supported on multiple camera (e.g IMX219, IMX390, etc)
Test Suite:
Comprehensive test suite added for FlexConnect plugin validation:
- Validates target property with supported values (VPAC_FC)
- Tests all supported Bayer input formats (bggr, gbrg, grbg, rggb)
- Validates format conversion to NV12 output
- Validates FC correctly rejects downscaling attempts
- Tests hardware limitation (output must be >= input dimensions)
- Validates FC correctly rejects odd output dimensions
- Tests NV12 format constraint (requires even width/height)
- Tests invalid Bayer input format rejection
- Validates caps negotiation failure during state change
- Tests invalid output format rejection for all valid input formats
- Validates proper format validation behavior
TODO:
[0] https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/latest/exports/docs/tiovx/docs/user_guide/hwa__vpac__fc_8h_source.html