mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 15:27:07 +00:00
9c08bfcaca
Sub-actions were really hard to use and conceptually weird. The implementation was ugly and made the code complex for nothing. Instead this commit introduces a `foreach` action type which allows repeating actions passed in an `actions` array the number of time specified by any `GstIntRange` value defined in the structure or its `repeat` field. This commit also makes sure that all action got through gst_validate_action_set_done upon finalization. + Cleanup surrounding code + Add tests Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/207>
31 lines
960 B
Text
31 lines
960 B
Text
meta,
|
|
handles-states=true,
|
|
args = {
|
|
"videotestsrc name=src pattern=ball animation-mode=frames num-buffers=30 ! video/x-raw,framerate=10/1 ! $(videosink) name=sink sync=true",
|
|
}
|
|
|
|
pause;
|
|
|
|
foreach, repeat="max(1, 2)",
|
|
actions = {
|
|
"seek, start=\"$(position)+0.1\", flags=\"accurate+flush\"",
|
|
"check-position, expected-position=\"expr((1+$(repeat))*0.1)\"",
|
|
}
|
|
|
|
priv_check-action-type-calls, type=seek, n=2
|
|
priv_check-action-type-calls, type=check-position, n=2
|
|
|
|
foreach,
|
|
repeat=2,
|
|
pattern=[0, 10, 5],
|
|
actions = {
|
|
"set-properties, src::horizontal-speed=\"$(pattern)\"",
|
|
"check-properties, src::horizontal-speed=\"$(pattern)\"",
|
|
}
|
|
|
|
check-properties, src::horizontal-speed=5
|
|
priv_check-action-type-calls, type=set-properties, n=4
|
|
priv_check-action-type-calls, type=check-properties, n=5
|
|
priv_check-action-type-calls, type=seek, n=2
|
|
priv_check-action-type-calls, type=check-position, n=2
|
|
stop
|