Add Gstreamer check framework as unit tests for gvawatermark#726
Add Gstreamer check framework as unit tests for gvawatermark#726walidbarakat wants to merge 4 commits intomainfrom
Conversation
f8c5c46 to
1b1a1e0
Compare
tests/unit_tests/check/elements/watermark/test_watermark/test_watermark_caps.cpp
Outdated
Show resolved
Hide resolved
1b1a1e0 to
00f57e6
Compare
tests/unit_tests/check/elements/watermark/test_watermark/test_watermark_caps.cpp
Show resolved
Hide resolved
tests/unit_tests/check/elements/watermark/test_watermark/test_watermark_caps.cpp
Show resolved
Hide resolved
tests/unit_tests/check/elements/watermark/test_watermark/test_watermark_caps.cpp
Show resolved
Hide resolved
00f57e6 to
ee501f7
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a new GStreamer Check–based unit test suite for gvawatermarkimpl and the gvawatermark bin, covering property defaults/set-get, basic state transitions, caps negotiation, buffer passthrough behavior, display-config parsing/acceptance, and several display-config behavioral/error-path cases.
Changes:
- Add new
gvawatermarkimplcaps negotiation + passthrough + error-path tests. - Add new display-config parsing/acceptance + behavioral tests (ROI filtering, thickness impact, show-labels behavior).
- Add new property/default/state tests for
gvawatermarkimpland thegvawatermarkbin, plus CMake wiring to build/run the new tests.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
tests/unit_tests/check/elements/watermark/test_watermark/test_watermark_config.cpp |
New display-config acceptance/behavior/error tests for gvawatermarkimpl. |
tests/unit_tests/check/elements/watermark/test_watermark/test_watermark_caps.cpp |
New caps negotiation, passthrough identity, resolution variants, and error-path tests. |
tests/unit_tests/check/elements/watermark/test_watermark/CMakeLists.txt |
Builds/runs the new watermark config + caps test executables. |
tests/unit_tests/check/elements/watermark/test_properties/test_watermark_properties.cpp |
New instantiation/defaults/set-get/state tests for impl + bin wrapper. |
tests/unit_tests/check/elements/watermark/test_properties/CMakeLists.txt |
Builds/runs the new watermark properties test executable. |
tests/unit_tests/check/elements/watermark/CMakeLists.txt |
Adds subdirectories for watermark tests. |
tests/unit_tests/check/elements/CMakeLists.txt |
Registers the new watermark/ tests in the elements test tree. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/unit_tests/check/elements/watermark/test_watermark/test_watermark_config.cpp
Show resolved
Hide resolved
tests/unit_tests/check/elements/watermark/test_watermark/test_watermark_config.cpp
Show resolved
Hide resolved
tests/unit_tests/check/elements/watermark/test_watermark/test_watermark_caps.cpp
Show resolved
Hide resolved
tests/unit_tests/check/elements/watermark/test_watermark/test_watermark_caps.cpp
Show resolved
Hide resolved
tests/unit_tests/check/elements/watermark/test_properties/test_watermark_properties.cpp
Show resolved
Hide resolved
tests/unit_tests/check/elements/watermark/test_watermark/test_watermark_caps.cpp
Show resolved
Hide resolved
…l tests Add GStreamer Check tests for displ-cfg acceptance (all 10 config keys), behavioral verification (show-labels toggles text rendering, thickness scales pixel count, show-roi/hide-roi filter ROIs), edge cases (show-roi+hide-roi conflict where show-roi wins, invalid config value triggers pipeline error, multiple ROIs produce more pixels), and a design-revealing test (show-labels=false silently disables show-roi parsing due to nesting in parse_displ_config). Not tested: font-scale/font-type/draw-txt-bg/text-x/text-y pixel-level behavioral verification, tensor-driven rendering (landmarks, masks, keypoints, OBB), displ-avgfps integration, VA/GPU render path. Signed-off-by: Walid <walid.aly@intel.com>
Add GStreamer Check tests using data-driven loop tests for caps negotiation (BGR, NV12, BGRA, RGBA, BGRx, I420), buffer passthrough identity (no metadata = no pixel change), resolution variants (64x48, 1920x1080), and error paths (GPU+system-memory incompatibility, unsupported device name "FPGA"). Not tested: VAAPI/DMA/D3D11 memory caps (require VA hardware), rejected pixel formats, caps renegotiation mid-stream. Signed-off-by: Walid <walid.aly@intel.com>
Add GStreamer Check tests for gvawatermarkimpl and gvawatermark (bin) covering element instantiation, default property values (device, obb, displ-avgfps, displ-cfg), set/get round-trips, NULL<->READY state transitions, and bin-to-impl property forwarding. Not tested: READY->PAUSED->PLAYING transitions (require negotiated caps), dynamic property changes during PLAYING state, property change notifications. Signed-off-by: Walid <walid.aly@intel.com>
ee501f7 to
292b8cd
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * The caps_string must be a string literal or static storage (GstStaticPadTemplate | ||
| * stores the pointer, not a copy). | ||
| */ | ||
| static GstStaticPadTemplate make_src_template(const char *caps_str) { | ||
| GstStaticPadTemplate t = GST_STATIC_PAD_TEMPLATE("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS(caps_str)); | ||
| return t; | ||
| } | ||
| static GstStaticPadTemplate make_sink_template(const char *caps_str) { | ||
| GstStaticPadTemplate t = GST_STATIC_PAD_TEMPLATE("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS(caps_str)); |
There was a problem hiding this comment.
make_src_template/make_sink_template build a GstStaticPadTemplate using GST_STATIC_CAPS(caps_str) where caps_str is a const char* variable. GST_STATIC_CAPS is intended for string literals/char arrays (it relies on compile-time sizing); passing a pointer can produce an incorrect caps string length and lead to truncated/invalid caps during pad setup. Consider defining one GstStaticPadTemplate per format at file scope, or constructing the GstStaticCaps fields manually with strlen(caps_str) so the stored length is correct.
| * The caps_string must be a string literal or static storage (GstStaticPadTemplate | |
| * stores the pointer, not a copy). | |
| */ | |
| static GstStaticPadTemplate make_src_template(const char *caps_str) { | |
| GstStaticPadTemplate t = GST_STATIC_PAD_TEMPLATE("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS(caps_str)); | |
| return t; | |
| } | |
| static GstStaticPadTemplate make_sink_template(const char *caps_str) { | |
| GstStaticPadTemplate t = GST_STATIC_PAD_TEMPLATE("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS(caps_str)); | |
| * Avoid GST_STATIC_CAPS(caps_str) here because caps_str is a function parameter, | |
| * not a direct literal/array expression for static macro initialization. | |
| */ | |
| static GstStaticPadTemplate make_src_template(const char *caps_str) { | |
| GstStaticPadTemplate t = {}; | |
| t.name_template = "src"; | |
| t.direction = GST_PAD_SRC; | |
| t.presence = GST_PAD_ALWAYS; | |
| t.static_caps.string = caps_str; | |
| t.static_caps.caps = NULL; | |
| return t; | |
| } | |
| static GstStaticPadTemplate make_sink_template(const char *caps_str) { | |
| GstStaticPadTemplate t = {}; | |
| t.name_template = "sink"; | |
| t.direction = GST_PAD_SINK; | |
| t.presence = GST_PAD_ALWAYS; | |
| t.static_caps.string = caps_str; | |
| t.static_caps.caps = NULL; |
Description
add gvawatermark property and lifecycle unit tests
Add 20 GStreamer Check tests for gvawatermarkimpl and gvawatermark (bin)
covering element instantiation, default property values (device, obb,
displ-avgfps, displ-cfg), set/get round-trips, NULL<->READY state
transitions, and bin-to-impl property forwarding.
Not tested: READY->PAUSED->PLAYING transitions (require negotiated caps),
dynamic property changes during PLAYING state, property change notifications.
add gvawatermark caps negotiation and error path tests
Add ~12 GStreamer Check tests using data-driven loop tests for caps
negotiation (BGR, NV12, BGRA, RGBA, BGRx, I420), buffer passthrough
identity (no metadata = no pixel change), resolution variants (64x48,
1920x1080), and error paths (GPU+system-memory incompatibility,
unsupported device name "FPGA").
Not tested: VAAPI/DMA/D3D11 memory caps (require VA hardware), rejected
pixel formats, caps renegotiation mid-stream.
add gvawatermark display config parsing and behavioral tests
Add ~20 GStreamer Check tests for displ-cfg acceptance (all 10 config
keys), behavioral verification (show-labels toggles text rendering,
thickness scales pixel count, show-roi/hide-roi filter ROIs), edge
cases (show-roi+hide-roi conflict where show-roi wins, invalid config
value triggers pipeline error, multiple ROIs produce more pixels), and
a design-revealing test (show-labels=false silently disables show-roi
parsing due to nesting in parse_displ_config).
Not tested: font-scale/font-type/draw-txt-bg/text-x/text-y pixel-level
behavioral verification, tensor-driven rendering (landmarks, masks,
keypoints, OBB), displ-avgfps integration, VA/GPU render path.
Checklist: