Skip to content

Add Gstreamer check framework as unit tests for gvawatermark#726

Open
walidbarakat wants to merge 4 commits intomainfrom
add_UTs_for_gvawatermark
Open

Add Gstreamer check framework as unit tests for gvawatermark#726
walidbarakat wants to merge 4 commits intomainfrom
add_UTs_for_gvawatermark

Conversation

@walidbarakat
Copy link
Copy Markdown
Contributor

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:

  • I agree to use the MIT license for my code changes.
  • I have not introduced any 3rd party components incompatible with MIT.
  • I have not included any company confidential information, trade secret, password or security token.
  • I have performed a self-review of my code.

@walidbarakat walidbarakat force-pushed the add_UTs_for_gvawatermark branch from 1b1a1e0 to 00f57e6 Compare March 30, 2026 11:35
Copilot AI review requested due to automatic review settings April 8, 2026 11:52
@walidbarakat walidbarakat force-pushed the add_UTs_for_gvawatermark branch from 00f57e6 to ee501f7 Compare April 8, 2026 11:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 gvawatermarkimpl caps 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 gvawatermarkimpl and the gvawatermark bin, 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.

…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>
@walidbarakat walidbarakat force-pushed the add_UTs_for_gvawatermark branch from ee501f7 to 292b8cd Compare April 9, 2026 07:37
@walidbarakat walidbarakat enabled auto-merge (squash) April 9, 2026 08:23
Copilot AI review requested due to automatic review settings April 9, 2026 14:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +38 to +46
* 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));
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
* 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;

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants