Flushes the frame buffer and yields gated frames
Source code in video_sampler/samplers/base_sampler.py
32
33
34
35
36
37
38
39
40
41
42
43
44
45 | def flush_buffer(self) -> Iterable[list[FrameObject]]:
"""Flushes the frame buffer and yields gated frames"""
for res in self.frame_buffer.final_flush():
if res:
self.stats["produced"] += 1
gated_obj: GatedObject = self.gate(*res)
self.stats["gated"] += gated_obj.N
if gated_obj.frames:
yield gated_obj.frames
gated_obj: GatedObject = self.gate.flush()
self.stats["gated"] += gated_obj.N
if gated_obj.frames:
yield gated_obj.frames
yield PROCESSING_DONE_ITERABLE
|