test,docs: fix section 6 vsink ref; update docs with SDL timing results and RenderPresent root cause
This commit is contained in:
@@ -247,14 +247,20 @@ else:
|
||||
live_frames = 0
|
||||
live_error = None
|
||||
|
||||
LIVE_PIPE = (
|
||||
f"playbin uri=\"{test_url}\" "
|
||||
f"video-sink=\"videoconvert ! video/x-raw,format=BGRA ! appsink name=vsink emit-signals=true max-buffers=2 drop=true\""
|
||||
)
|
||||
|
||||
try:
|
||||
pipe = Gst.parse_launch(LIVE_PIPE)
|
||||
vsink = pipe.get_by_name("vsink")
|
||||
# Build the pipeline element-by-element so we can hold a direct
|
||||
# reference to the appsink (parse_launch embeds it in a bin and
|
||||
# get_by_name returns None when the bin wraps a nested pipeline string).
|
||||
pipe = Gst.ElementFactory.make("playbin", "live_player")
|
||||
vsink = Gst.ElementFactory.make("appsink", "vsink")
|
||||
if pipe is None or vsink is None:
|
||||
raise RuntimeError("playbin or appsink not available")
|
||||
vsink.set_property("emit-signals", True)
|
||||
vsink.set_property("max-buffers", 2)
|
||||
vsink.set_property("drop", True)
|
||||
vsink.set_property("caps", Gst.Caps.from_string("video/x-raw,format=BGRA"))
|
||||
pipe.set_property("video-sink", vsink)
|
||||
pipe.set_property("uri", test_url if "://" in test_url else Gst.filename_to_uri(test_url))
|
||||
|
||||
def _on_live_sample(sink, *_):
|
||||
global live_frames
|
||||
|
||||
Reference in New Issue
Block a user