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:
@@ -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
|
||||
|
||||
#
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user