key_required for h264

This commit is contained in:
Maxim Devaev 2022-11-01 19:34:30 +03:00
parent 7177f83bc5
commit ad95e820cc
2 changed files with 5 additions and 2 deletions

View File

@ -78,7 +78,7 @@ depends=(
"janus-gateway-pikvm>=0.11.2-7" "janus-gateway-pikvm>=0.11.2-7"
certbot certbot
platform-io-access platform-io-access
"ustreamer>=5.8" "ustreamer>=5.26"
# Systemd UDEV bug # Systemd UDEV bug
"systemd>=248.3-2" "systemd>=248.3-2"

View File

@ -176,10 +176,13 @@ class MemsinkStreamerClient(BaseStreamerClient):
raise StreamerPermError("Missing ustreamer library") raise StreamerPermError("Missing ustreamer library")
try: try:
with ustreamer.Memsink(**self.__kwargs) as sink: with ustreamer.Memsink(**self.__kwargs) as sink:
key_required = (self.__fmt == StreamFormats.H264)
while True: while True:
frame = await aiotools.run_async(sink.wait_frame) frame = await aiotools.run_async(sink.wait_frame, key_required)
if frame is not None: if frame is not None:
self.__check_format(frame["format"]) self.__check_format(frame["format"])
if frame["key"]:
key_required = False
yield frame yield frame
except StreamerPermError: except StreamerPermError:
raise raise