content store (#1225)

* introduce content store for content analyser

* introduce content store for content analyser part2

* guard content store as well

* minor changes

* minor changes

* minor changes
This commit is contained in:
Henry Ruhs
2026-08-27 11:23:18 +02:00
committed by GitHub
parent b9d2ecd28a
commit 1362afa8b7
11 changed files with 138 additions and 122 deletions
+10 -9
View File
@@ -77,16 +77,17 @@ def test_run_video_encode_loop(video_codec : VideoCodec, payload_type : int) ->
video_queue : Queue[Tuple[Time, Future[BufferPack]]] = Queue(maxsize = 30)
with ThreadPoolExecutor(max_workers = 1) as executor:
video_queue.put((0.1, executor.submit(process_video_frame, [], video_frame)))
with patch('facefusion.apis.stream_video.analyse_stream', return_value = False):
with ThreadPoolExecutor(max_workers = 1) as executor:
video_queue.put((0.1, executor.submit(process_video_frame, [], video_frame)))
with patch('facefusion.apis.stream_video.rtc.send_video') as send_video_mock:
encode_loop_thread = threading.Thread(target = run_video_encode_loop, args = (rtc_peer, video_queue), daemon = True)
encode_loop_thread.start()
empty_future : Future[BufferPack] = Future()
empty_future.set_result(BufferPack(buffer = bytes(), resolution = (0, 0)))
video_queue.put((0.0, empty_future))
encode_loop_thread.join(timeout = 5.0)
with patch('facefusion.apis.stream_video.rtc.send_video') as send_video_mock:
encode_loop_thread = threading.Thread(target = run_video_encode_loop, args = (rtc_peer, video_queue), daemon = True)
encode_loop_thread.start()
empty_future : Future[BufferPack] = Future()
empty_future.set_result(BufferPack(buffer = bytes(), resolution = (0, 0)))
video_queue.put((0.0, empty_future))
encode_loop_thread.join(timeout = 5.0)
assert send_video_mock.called