mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 10:45:21 +03:00
Refactor audio capture and processing threads to use more descriptive thread names
This commit is contained in:
parent
386e388f75
commit
3bd46db1ae
@ -10,10 +10,9 @@ import threading
|
||||
import numpy as np
|
||||
from setproctitle import setproctitle
|
||||
|
||||
from frigate.config import CameraConfig, AudioModelConfig
|
||||
from frigate.config import AudioModelConfig, CameraConfig
|
||||
from frigate.object_detection import RemoteObjectDetector
|
||||
from frigate.util import listen, SharedMemoryFrameManager
|
||||
|
||||
from frigate.util import SharedMemoryFrameManager, listen
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@ -31,8 +30,8 @@ def capture_audio(
|
||||
signal.signal(signal.SIGTERM, receiveSignal)
|
||||
signal.signal(signal.SIGINT, receiveSignal)
|
||||
|
||||
threading.current_thread().name = f"capture:{name}"
|
||||
setproctitle(f"frigate.capture:{name}")
|
||||
threading.current_thread().name = f"capture_audio:{name}"
|
||||
setproctitle(f"frigate.capture_audio:{name}")
|
||||
listen()
|
||||
|
||||
chunk_size = int(round(model_config.duration * model_config.sample_rate * 2))
|
||||
@ -84,8 +83,8 @@ def process_audio(
|
||||
signal.signal(signal.SIGTERM, receiveSignal)
|
||||
signal.signal(signal.SIGINT, receiveSignal)
|
||||
|
||||
threading.current_thread().name = f"process:{name}"
|
||||
setproctitle(f"frigate.process:{name}")
|
||||
threading.current_thread().name = f"process_audio:{name}"
|
||||
setproctitle(f"frigate.process_audio:{name}")
|
||||
listen()
|
||||
|
||||
shape = (int(round(model_config.duration * model_config.sample_rate)),)
|
||||
|
||||
@ -2,13 +2,13 @@
|
||||
|
||||
import logging
|
||||
import multiprocessing as mp
|
||||
import numpy as np
|
||||
import signal
|
||||
import subprocess as sp
|
||||
import threading
|
||||
from types import FrameType
|
||||
from typing import Optional
|
||||
|
||||
import numpy as np
|
||||
from setproctitle import setproctitle
|
||||
|
||||
from frigate.config import CameraConfig, FrigateConfig
|
||||
|
||||
Loading…
Reference in New Issue
Block a user