Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
giosrc: Add support for growing source files
Add a way for applications to specify that the underlying file is growing which implies that the source won't EOS when reaching the end of the file but instead start monitoring it and start reading it again whenever a change is detected. Also add a validate test to check the behavior Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/937>
- Loading branch information
1 parent
a4ba868
commit f1f966d
Showing
9 changed files
with
369 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Whitespace-only changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Pipeline with 2 branches, the first one write random data into a file in $(growing_file_location). | ||
# That branch is synchronized on the test clock that we drive in the scenario. | ||
# The second branch reads it with giosrc and does some tests like waiting for the | ||
# `done-waiting-signal` signals on the source etc... | ||
# | ||
# The whole dataflow is checked and we ensure that the exact same buffer content | ||
# is read from the giosrc. | ||
set-globals, growing_file_location="$(logsdir)/$(test_name)-growing.rand" | ||
meta, | ||
seek=false, | ||
handles-states=false, | ||
args = { | ||
"fakesrc num-buffers=30 datarate=30 filltype=pattern-span sizetype=fixed filltype=random format=time ! filesink sync=true location=$(growing_file_location) name=filesink buffer-mode=unbuffered \ | ||
giosrc name=giosrc is-growing=true location=file://$(growing_file_location) ! fakesink name=growing-file-sink async=false" \ | ||
}, | ||
configs = { | ||
"$(validateflow), pad=filesink:sink, record-buffers=true, ignored-fields=\"stream-start={stream-id,group-id,stream}\", buffers-checksum=as-id", | ||
"$(validateflow), pad=growing-file-sink:sink, record-buffers=true, ignored-fields=\"stream-start={stream-id,group-id,stream}\", buffers-checksum=as-id", | ||
} | ||
|
||
|
||
crank-clock, repeat=5 | ||
wait, signal-name=waiting-data, target-element-name=giosrc | ||
|
||
checkpoint | ||
|
||
crank-clock, repeat=5 | ||
wait, signal-name=waiting-data, target-element-name=giosrc | ||
|
||
wait, signal-name=done-waiting-data, target-element-name=giosrc, non-blocking=true | ||
crank-clock, repeat=21 | ||
|
||
checkpoint | ||
|
||
wait, signal-name=waiting-data, target-element-name=giosrc | ||
|
||
checkpoint | ||
|
||
# Make sure EOS is outputted now. | ||
set-properties, giosrc::is_growing=false | ||
|
||
stop, on-message=eos |
Oops, something went wrong.