Skip to content

Added Multimedia Video and Display GStreamer test scripts#290

Open
nitinn22 wants to merge 6 commits intoqualcomm-linux:mainfrom
nitinn22:feature/gstchange
Open

Added Multimedia Video and Display GStreamer test scripts#290
nitinn22 wants to merge 6 commits intoqualcomm-linux:mainfrom
nitinn22:feature/gstchange

Conversation

@nitinn22
Copy link

The scripts support GStreamer level validation for video and display,

Video: H.264/H.265/VP9 encode/decode with V4L2
Display: Wayland compositor validation

More info in their corresponding readme files.

Signed-off-by: Nitin Nakka <nitinn@qti.qualcomm.com>
Signed-off-by: Nitin Nakka <nitinn@qti.qualcomm.com>
…sing

Signed-off-by: Nitin Nakka <nitinn@qti.qualcomm.com>
Copy link
Contributor

@smuppand smuppand left a comment

Choose a reason for hiding this comment

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

Please move the generic helpers currently defined in Video_Encode_Decode/run.sh into Runner/utils/lib_gstreamer.sh so other GST tests can reuse them:
get_resolution_params() ->gstreamer_resolution_to_wh()
get_encoder_element() / get_decoder_element() -> gstreamer_v4l2_{encoder,decoder}_for_codec()
get_file_extension() -> gstreamer_container_ext_for_codec() (or similar)
Extract pipeline string creation into library builders:
gstreamer_build_v4l2_encode_pipeline()
gstreamer_build_v4l2_decode_pipeline()
Move bitrate selection + file-size helper into lib (gstreamer_bitrate_for_resolution, gstreamer_file_size_bytes) to avoid re-implementations.

Keep .res emission + summary logic in run.sh. library functions should not write results directly.

…r V4L2 video helper functions from Video_Encode_Decode test to shared lib_gstreamer.sh for code reuse across all GStreamer tests

Signed-off-by: Nitin Nakka <nitinn@qti.qualcomm.com>
@smuppand
Copy link
Contributor

@nitinn22 Kindly close the comments where you've already addressed previous review feedback, so I can focus on the remaining ones. Also, please rebase your work on top of the main branch. Also Updated SPDX license identifiers from BSD-3-Clause-Clear to BSD-3-Clause per legal request.

Copy link
Contributor

@smuppand smuppand left a comment

Choose a reason for hiding this comment

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

README inconsistency (Waylandsink): help text says default test is “for 10s” but script default duration resolves to 30s. Update README/help examples.

README mismatch (Video): documentation lists encoded outputs like .h264/.h265, but the pipeline uses mp4mux and outputs .mp4. Update README to match reality.

…video scripts based on review comments

Signed-off-by: Nitin Nakka <nitinn@qti.qualcomm.com>
…l request

Signed-off-by: Nitin Nakka <nitinn@qti.qualcomm.com>
@@ -0,0 +1,389 @@
#!/bin/sh
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause per legal request.
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove per legal request.

exit 0
}

check_dependencies "grep head sed" >/dev/null 2>&1 || {
Copy link
Contributor

Choose a reason for hiding this comment

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

Both can be combined into a single dependency check.


# -------------------- Pre-checks --------------------
check_dependencies "gst-launch-1.0 gst-inspect-1.0" >/dev/null 2>&1 || {
log_warn "Missing gstreamer runtime (gst-launch-1.0/gst-inspect-1.0)"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be log_skip

}

check_dependencies "grep head sed" >/dev/null 2>&1 || {
log_warn "Missing required tools (grep, head, sed)"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be log_skip

# Parse WIDTHxHEIGHT format (e.g., 1920x1080)
if [ -n "$2" ]; then
width="${2%%x*}"
height="${2#*x}"
Copy link
Contributor

Choose a reason for hiding this comment

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

No validation that: WIDTHxHEIGHT format is present
both are numeric and height isn’t unchanged when x missing
This can trigger arithmetic/ caps errors later


for res in $resolutions; do
params=$(gstreamer_resolution_to_wh "$res")
width=$(printf '%s' "$params" | awk '{print $1}')
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid awk and prefer posix clean + faster
set -- $params
width="$1"; height="$2"

res="$1"
case "$res" in
480p)
printf '%s %s\n' "640" "480"
Copy link
Contributor

Choose a reason for hiding this comment

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

Right now, unknown tokens silently become 480p:

That hides config mistakes (e.g., VIDEO_RESOLUTIONS=4K typo) and makes results misleading.

*)
return 1
;;
Then callers should SKIP that test case (or overall SKIP if no valid resolutions).

;;
vp9)
parser=""
container="matroskademux"
Copy link
Contributor

Choose a reason for hiding this comment

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

Then you always go through the container branch, which will generate:

filesrc ! matroskademux ! ! v4l2vp9dec ...
Because parser="", you end up with ! ! (invalid pipeline).

only insert parser when it’s non-empty. Also, VP9 in WebM should be:
filesrc ! matroskademux ! vp9parse ! v4l2vp9dec ... (if vp9parse exists), or
filesrc ! matroskademux ! queue ! v4l2vp9dec ... (often works, but parse is better)

width="$2"
height="$3"
duration="$4"
framerate="$5"
Copy link
Contributor

Choose a reason for hiding this comment

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

uses $((duration * framerate)) without numeric safety
Library should not assume callers validated this. Any env typo will break pipeline construction.

fi

# Check for CRITICAL or FATAL level messages
if grep -q -E "CRITICAL|FATAL" "$logfile" 2>/dev/null; then
Copy link
Contributor

Choose a reason for hiding this comment

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

this can match unreleated messages.
prefer anchored or GST_..._ERROR patterns (already partly covered)

grep -q -E '(^CRITICAL:|^FATAL:|gst.*(CRITICAL|FATAL))'

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.

2 participants