Enable direct mode for filter processors

Enable direct mode on FrameFilter, IdentityFilter, and NullFilter so
they can bypass the async queue and process frames synchronously for
lower latency. Also pass **kwargs through to parent in FrameFilter.
This commit is contained in:
Aleix Conchillo Flaqué
2026-03-24 13:21:40 -07:00
parent 2441c4f801
commit 84f1e49712
3 changed files with 5 additions and 4 deletions

View File

@@ -20,15 +20,16 @@ class FrameFilter(FrameProcessor):
automatically allowed to pass through to maintain pipeline integrity.
"""
def __init__(self, types: Tuple[Type[Frame], ...]):
def __init__(self, types: Tuple[Type[Frame], ...], **kwargs):
"""Initialize the frame filter.
Args:
types: Tuple of frame types that should be allowed to pass through
the filter. All other frame types (except SystemFrame and
EndFrame) will be blocked.
**kwargs: Additional arguments passed to the parent FrameProcessor.
"""
super().__init__()
super().__init__(enable_direct_mode=True, **kwargs)
self._types = types
#

View File

@@ -28,7 +28,7 @@ class IdentityFilter(FrameProcessor):
Args:
**kwargs: Additional arguments passed to the parent FrameProcessor.
"""
super().__init__(**kwargs)
super().__init__(enable_direct_mode=True, **kwargs)
#
# Frame processor

View File

@@ -29,7 +29,7 @@ class NullFilter(FrameProcessor):
Args:
**kwargs: Additional arguments passed to parent FrameProcessor.
"""
super().__init__(**kwargs)
super().__init__(enable_direct_mode=True, **kwargs)
#
# Frame processor