99
1010logger = logging .getLogger (__name__ )
1111
12- def get_recorder_path ():
12+ def get_capture_binary_path ():
1313 """
14- Attempts to find the path to the recorder binary.
14+ Attempts to find the path to the capture binary.
1515 If the optional 'videodb-capture-bin' package is not installed,
1616 it raises a RuntimeError with instructions.
1717 """
@@ -21,13 +21,13 @@ def get_recorder_path():
2121 except ImportError :
2222 error_msg = (
2323 "Capture runtime not found.\n "
24- "To use recording features, please install the capture dependencies:\n "
24+ "To use capture features, please install the capture dependencies:\n "
2525 "pip install 'videodb[capture]'"
2626 )
2727 logger .error (error_msg )
2828 raise RuntimeError (error_msg )
2929 except Exception as e :
30- logger .error (f"Failed to resolve recorder path: { e } " )
30+ logger .error (f"Failed to resolve capture binary path: { e } " )
3131 raise
3232
3333
@@ -167,14 +167,14 @@ def __init__(
167167 self ._session_id : Optional [str ] = None
168168 self ._proc = None
169169 self ._futures : Dict [str , asyncio .Future ] = {}
170- self ._binary_path = get_recorder_path ()
170+ self ._binary_path = get_capture_binary_path ()
171171 self ._event_queue = asyncio .Queue ()
172172
173173 def __repr__ (self ) -> str :
174174 return f"CaptureClient(base_url={ self .base_url } )"
175175
176176 async def _ensure_process (self ):
177- """Ensure the recorder binary is running."""
177+ """Ensure the capture binary is running."""
178178 if self ._proc is not None and self ._proc .returncode is None :
179179 return
180180
@@ -194,7 +194,7 @@ async def _ensure_process(self):
194194 async def _send_command (
195195 self , command : str , params : Optional [Dict [str , Any ]] = None
196196 ) -> Dict [str , Any ]:
197- """Send a command to the recorder binary and await response.
197+ """Send a command to the capture binary and await response.
198198
199199 :param str command: Command name.
200200 :param dict params: Command parameters.
@@ -210,7 +210,7 @@ async def _send_command(
210210 "params" : params or {},
211211 }
212212
213- # Framing : videodb_recorder|<JSON>\n
213+ # IPC protocol framing : videodb_recorder|<JSON>\n
214214 message = f"videodb_recorder|{ json .dumps (payload )} \n "
215215 self ._proc .stdin .write (message .encode ("utf-8" ))
216216 await self ._proc .stdin .drain ()
@@ -254,18 +254,18 @@ async def _read_stdout_loop(self):
254254 await self ._event_queue .put (data )
255255
256256 except Exception as e :
257- logger .error (f"Failed to parse recorder message: { e } " )
257+ logger .error (f"Failed to parse capture message: { e } " )
258258
259259 async def _read_stderr_loop (self ):
260260 """Loop to read stderr and log messages."""
261261 while True :
262262 line = await self ._proc .stderr .readline ()
263263 if not line :
264264 break
265- logger .debug (f"[Recorder Binary]: { line .decode ('utf-8' , errors = 'replace' ).strip ()} " )
265+ logger .debug (f"[Capture Binary]: { line .decode ('utf-8' , errors = 'replace' ).strip ()} " )
266266
267267 async def shutdown (self ):
268- """Cleanly terminate the recorder binary process."""
268+ """Cleanly terminate the capture binary process."""
269269 if self ._proc :
270270 try :
271271 # Try graceful shutdown command first
@@ -392,7 +392,7 @@ async def stop_session(self) -> None:
392392 await self ._send_command ("stopRecording" , {"sessionId" : self ._session_id })
393393
394394 async def events (self ):
395- """Async generator that yields events from the recorder ."""
395+ """Async generator that yields events from the capture binary ."""
396396 while True :
397397 try :
398398 # Use a timeout so we can check if the process is still alive
0 commit comments