Skip to content

Commit 8efddcd

Browse files
committed
docs: document drain_video_frames and align defaults across layers
ConnectionManager and PeerConnectionManager had drain_video_frames defaulting to False, overriding the True default in SubscriberPeerConnection. Aligned all three layers and added a docstring explaining the drain lifecycle.
1 parent 9ea7275 commit 8efddcd

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

getstream/video/rtc/connection_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def __init__(
5858
create: bool = True,
5959
subscription_config: Optional[SubscriptionConfig] = None,
6060
max_join_retries: int = 3,
61-
drain_video_frames: bool = False,
61+
drain_video_frames: bool = True,
6262
**kwargs: Any,
6363
):
6464
super().__init__()

getstream/video/rtc/pc.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,15 @@ def __init__(
133133
configuration: aiortc.RTCConfiguration,
134134
drain_video_frames: bool = True,
135135
) -> None:
136+
"""
137+
Args:
138+
drain_video_frames: When True, attaches a MediaBlackhole to each
139+
incoming video track so unconsumed frames are drained
140+
automatically. This prevents unbounded queue growth in
141+
RTCRtpReceiver when no subscriber is consuming the track.
142+
The drain is stopped once a real subscriber is added via
143+
add_track_subscriber.
144+
"""
136145
logger.info(
137146
f"creating subscriber peer connection with configuration: {configuration}"
138147
)

getstream/video/rtc/peer_connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
class PeerConnectionManager:
2929
"""Manages WebRTC peer connections for publishing and subscribing."""
3030

31-
def __init__(self, connection_manager, drain_video_frames: bool = False):
31+
def __init__(self, connection_manager, drain_video_frames: bool = True):
3232
self.connection_manager = connection_manager
3333
self._drain_video_frames = drain_video_frames
3434
self.publisher_pc: Optional[PublisherPeerConnection] = None

0 commit comments

Comments
 (0)