Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 3 additions & 18 deletions Runner/suites/Multimedia/GSTreamer/Camera/Camera_Tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -789,23 +789,13 @@ export GST_DEBUG_FILE="$GST_LOG"
# $1: testname
# $2: pipeline
# $3: output_file (optional, for encode tests)
# $4: restart_cam_server (optional, "yes" to restart cam-server before test - qtiqmmfsrc only)
run_camera_test() {
testname="$1"
pipeline="$2"
output_file="${3:-}"
restart_cam_server="${4:-no}"

log_info "=========================================="; log_info "Running: $testname"; log_info "=========================================="

# Restart cam-server if requested (temporary workaround for qtiqmmfsrc only)
# libcamerasrc doesn't use cam-server, so this is skipped for libcamerasrc tests
if [ "$restart_cam_server" = "yes" ] && [ "$camera_source" = "qtiqmmfsrc" ]; then
log_info "Restarting cam-server..."
systemctl restart cam-server >/dev/null 2>&1 || log_warn "Failed to restart cam-server (may not be critical)"
sleep 1
fi

test_log="$OUTDIR/${testname}.log"
: >"$test_log"

Expand Down Expand Up @@ -865,7 +855,7 @@ run_qtiqmmf_fakesink_test() {
log_info "Format: $format_name"

pipeline=$(camera_build_qtiqmmfsrc_fakesink_pipeline "$cameraId" "$format" 1280 720 "$framerate")
run_camera_test "$testname" "$pipeline" "" "yes"
run_camera_test "$testname" "$pipeline"
}

# qtiqmmfsrc Preview test
Expand All @@ -887,7 +877,7 @@ run_qtiqmmf_preview_test() {
log_info "Format: $format_name"

pipeline=$(camera_build_qtiqmmfsrc_preview_pipeline "$cameraId" "$format" 3840 2160 "$framerate")
run_camera_test "$testname" "$pipeline" "" "yes"
run_camera_test "$testname" "$pipeline"
}

# qtiqmmfsrc Encode test
Expand Down Expand Up @@ -915,7 +905,7 @@ run_qtiqmmf_encode_test() {
log_info "Resolution: $resolution (${width}x${height})"

pipeline=$(camera_build_qtiqmmfsrc_encode_pipeline "$cameraId" "$format" "$width" "$height" "$framerate" "$output_file")
run_camera_test "$testname" "$pipeline" "$output_file" "yes"
run_camera_test "$testname" "$pipeline" "$output_file"
}

# qtiqmmfsrc Snapshot test
Expand Down Expand Up @@ -955,11 +945,6 @@ run_qtiqmmf_snapshot_test() {

log_info "=========================================="; log_info "Running: $testname"; log_info "=========================================="

# Restart cam-server before snapshot test (qtiqmmfsrc only)
log_info "Restarting cam-server..."
systemctl restart cam-server >/dev/null 2>&1 || log_warn "Failed to restart cam-server (may not be critical)"
sleep 1

test_log="$OUTDIR/${testname}.log"
: >"$test_log"

Expand Down
20 changes: 11 additions & 9 deletions Runner/utils/lib_gstreamer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,9 @@ gstreamer_backend_evidence_sampled() {
# -------------------- Single runner: gst-launch with timeout --------------------
# gstreamer_run_gstlaunch_timeout <secs> <pipelineString>
# Returns gst-launch rc.
#
# Sends SIGINT (not SIGTERM) to trigger proper EOS handling via -e flag.
# This ensures pipelines with muxers (mp4mux, etc.) can finalize output files.
gstreamer_run_gstlaunch_timeout() {
secs="$1"
pipe="$2"
Expand All @@ -525,16 +528,13 @@ gstreamer_run_gstlaunch_timeout() {
gstreamer_print_cmd_multiline "$pipe"

if [ "$secs" -gt 0 ] 2>/dev/null; then
if command -v audio_timeout_run >/dev/null 2>&1; then
# shellcheck disable=SC2086
audio_timeout_run "${secs}s" "$GSTBIN" $GSTLAUNCHFLAGS $pipe
return $?
elif command -v timeout >/dev/null 2>&1; then
if command -v timeout >/dev/null 2>&1; then
# shellcheck disable=SC2086
timeout "$secs" "$GSTBIN" $GSTLAUNCHFLAGS $pipe
# Send SIGINT instead of SIGTERM to trigger EOS via -e flag
timeout --signal=INT "$secs" "$GSTBIN" $GSTLAUNCHFLAGS $pipe
return $?
else
log_warn "No timeout command available (audio_timeout_run or timeout), running without timeout"
log_warn "No timeout command available, running without timeout"
fi
fi

Expand Down Expand Up @@ -675,6 +675,7 @@ gstreamer_check_errors() {
if sed \
-e '/gst_video_info_dma_drm_to_caps: assertion .*drm_fourcc != DRM_FORMAT_INVALID/d' \
-e "/gst_structure_remove_field: assertion 'IS_MUTABLE (structure)' failed/d" \
-e '/WARN.*udmabuf-allocator.*Udmabuf allocator not available.*can'\''t open \/dev\/udmabuf/d' \
"$logfile" >"$filtered_log" 2>/dev/null; then
check_log="$filtered_log"
fi
Expand Down Expand Up @@ -770,6 +771,7 @@ gstreamer_validate_log() {
if sed \
-e '/gst_video_info_dma_drm_to_caps: assertion .*drm_fourcc != DRM_FORMAT_INVALID/d' \
-e "/gst_structure_remove_field: assertion 'IS_MUTABLE (structure)' failed/d" \
-e '/WARN.*udmabuf-allocator.*Udmabuf allocator not available.*can'\''t open \/dev\/udmabuf/d' \
"$logfile" >"$filtered_log" 2>/dev/null; then
check_log="$filtered_log"
fi
Expand Down Expand Up @@ -1531,7 +1533,7 @@ camera_build_qtiqmmfsrc_snapshot_pipeline() {
output_location="$5"
max_files="${6:-2}"

printf '%s\n' "qtiqmmfsrc camera=${camera_id} name=camsrc ! capsfilter caps=\"video/x-raw,format=NV12,width=${width},height=${height},framerate=${framerate}/1\" ! jpegenc ! multifilesink location=\"${output_location}\ max-files=${max_files}"
printf '%s\n' "qtiqmmfsrc camera=${camera_id} name=camsrc ! capsfilter caps=\"video/x-raw,format=NV12,width=${width},height=${height},framerate=${framerate}/1\" ! jpegenc ! multifilesink location=\"${output_location}\" max-files=${max_files}"
}

# -------------------- libcamerasrc pipeline builders --------------------
Expand Down Expand Up @@ -1607,7 +1609,7 @@ camera_build_libcamera_snapshot_pipeline() {
output_location="$3"
max_files="${4:-5}"

printf '%s\n' "libcamerasrc name=camsrc src_1::stream-role=still-capture ! video/x-raw,width=${width},height=${height} ! videoconvert ! jpegenc ! multifilesink location=\"${output_location}\ max-files=${max_files}"
printf '%s\n' "libcamerasrc name=camsrc src_1::stream-role=still-capture ! video/x-raw,width=${width},height=${height} ! videoconvert ! jpegenc ! multifilesink location=\"${output_location}\" max-files=${max_files}"
}

# -------------------- Wayland/Weston setup helper --------------------
Expand Down
Loading