Skip to content

Commit 77db409

Browse files
committed
lib(gstreamer): add shared encoded artifact directory helper
Add a reusable helper to resolve a shared encoded artifact directory for GStreamer video encode/decode workflows. The helper allows suites to store encoded outputs in a job-shared location when running under LAVA testcase-specific workspaces, while still falling back to the local suite output directory for manual runs. This is needed so encode and decode stages can exchange generated files reliably across separate testcase directories. Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
1 parent d37dcc2 commit 77db409

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Runner/utils/lib_gstreamer.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,31 @@ GSTLAUNCHFLAGS="${GSTLAUNCHFLAGS:--e -v -m}"
2020
# GST_ALSA_PLAYBACK_DEVICE=hw:0,0
2121
# GST_ALSA_CAPTURE_DEVICE=hw:0,1
2222

23+
# -------------------- Shared encoded-artifact directory --------------------
24+
# gstreamer_shared_encoded_dir <script_dir> <outdir>
25+
# Prints a directory path to use for encoded video artifacts.
26+
# Priority:
27+
# 1. VIDEO_SHARED_ENCODE_DIR if explicitly provided
28+
# 2. A job-shared path derived from the common LAVA prefix before /tests/
29+
# 3. Fallback to <outdir>/encoded for local/manual runs
30+
gstreamer_shared_encoded_dir() {
31+
script_dir="$1"
32+
outdir="$2"
33+
34+
if [ -n "${VIDEO_SHARED_ENCODE_DIR:-}" ]; then
35+
printf '%s\n' "$VIDEO_SHARED_ENCODE_DIR"
36+
return 0
37+
fi
38+
39+
case "$script_dir" in
40+
*/tests/*)
41+
printf '%s/shared/video-encode-decode\n' "${script_dir%%/tests/*}"
42+
;;
43+
*)
44+
printf '%s/encoded\n' "$outdir"
45+
;;
46+
esac
47+
}
2348
# -------------------- Element check --------------------
2449
has_element() {
2550
elem="$1"

0 commit comments

Comments
 (0)