Skip to content

Commit 7c60170

Browse files
committed
Modified video cleanup to better handle killing of gst-launch, in audio script added handle to check file size to be minimum 1000 bytes before initiating playback or else to skip it
Signed-off-by: Nitin Nakka <nitinn@qti.qualcomm.com>
1 parent 779d38f commit 7c60170

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

  • Runner/suites/Multimedia/GSTreamer
    • Audio/Audio_Record_Playback
    • Video/Video_Encode_Decode

Runner/suites/Multimedia/GSTreamer/Audio/Audio_Record_Playback/run.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ for param in AUDIO_DURATION AUDIO_GST_DEBUG GST_DEBUG_LEVEL; do
130130
done
131131

132132
cleanup() {
133-
pkill -x gst-launch-1.0 >/dev/null 2>&1 || true
133+
# Best-effort: try to kill only children first; fall back to name-based kill
134+
if ! pkill -P "$$" -x gst-launch-1.0 >/dev/null 2>&1; then
135+
pkill -x gst-launch-1.0 >/dev/null 2>&1 || true
136+
fi
134137
}
135138
trap cleanup INT TERM EXIT
136139

@@ -358,6 +361,14 @@ run_playback_test() {
358361
return 1
359362
fi
360363

364+
# Check if file has minimum content (same threshold as recording: 1000 bytes)
365+
file_size="$(gstreamer_file_size_bytes "$input_file")"
366+
if [ "$file_size" -le 1000 ]; then
367+
log_warn "$testname: SKIP - recorded file too small: $file_size bytes (recording likely failed)"
368+
skip_count=$((skip_count + 1))
369+
return 1
370+
fi
371+
361372
test_log="$OUTDIR/${testname}.log"
362373
: >"$test_log"
363374

@@ -503,6 +514,14 @@ run_playback_pulsesrc_test() {
503514
return 1
504515
fi
505516

517+
# Check if file has minimum content (same threshold as recording: 1000 bytes)
518+
file_size="$(gstreamer_file_size_bytes "$input_file")"
519+
if [ "$file_size" -le 1000 ]; then
520+
log_warn "$testname: SKIP - recorded file too small: $file_size bytes (pulsesrc recording likely failed)"
521+
skip_count=$((skip_count + 1))
522+
return 1
523+
fi
524+
506525
test_log="$OUTDIR/${testname}.log"
507526
: >"$test_log"
508527

Runner/suites/Multimedia/GSTreamer/Video/Video_Encode_Decode/run.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ for param in VIDEO_DURATION RUNTIMESEC VIDEO_FRAMERATE VIDEO_GST_DEBUG GST_DEBUG
111111
done
112112

113113
cleanup() {
114-
pkill -x gst-launch-1.0 >/dev/null 2>&1 || true
114+
# Best-effort: try to kill only children first; fall back to name-based kill
115+
if ! pkill -P "$$" -x gst-launch-1.0 >/dev/null 2>&1; then
116+
pkill -x gst-launch-1.0 >/dev/null 2>&1 || true
117+
fi
115118
}
116119
trap cleanup INT TERM EXIT
117120

0 commit comments

Comments
 (0)