restructure and test, pure python and rust transport both _work_

This commit is contained in:
2026-04-10 16:25:54 -03:00
parent 9d3ff2c6ba
commit e906b0a963
11 changed files with 1146 additions and 67 deletions

View File

@@ -168,10 +168,11 @@ class StreamManager:
return self.recorder.alive() if self.recorder else True # Rust owns it
def start_scene_detector(self, on_new_frames=None):
if self.recorder:
self.recorder.set_on_new_scene_frames(on_new_frames)
else:
self.processor.set_on_new_frames(on_new_frames)
# GUI callback always goes to the processor — it fires on_new_frames
# after writing the JPEG to disk, regardless of how it got the frame.
self.processor.set_on_new_frames(on_new_frames)
if not self.recorder:
# Rust transport: processor connects to scene.sock and runs its own ffmpeg.
self.processor.start_scene_detector(threshold=SCENE_THRESHOLD)
def capture_now(self, on_new_frames=None):

View File

@@ -496,10 +496,13 @@ class SessionProcessor:
log.info("Audio chunk: %s (%.1fs → %.1fs, global %.1fs)",
wav_path.name, processed_time, process_to, global_start)
if self._on_new_audio:
self._on_new_audio(
wav_path, global_start, chunk_duration,
segment_path=source, local_start=processed_time,
)
try:
self._on_new_audio(
wav_path, global_start, chunk_duration,
segment_path=source, local_start=processed_time,
)
except Exception as e:
log.error("Audio callback failed: %s", e)
chunk_num += 1
processed_time = process_to