Skip to content

Commit 590f2cf

Browse files
committed
refactor: rename video_buffered to drain_video_frames, default False
1 parent dfe3ee5 commit 590f2cf

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

getstream/video/rtc/connection_manager.py

Lines changed: 2 additions & 2 deletions
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-
video_buffered: bool = True,
61+
drain_video_frames: bool = False,
6262
**kwargs: Any,
6363
):
6464
super().__init__()
@@ -92,7 +92,7 @@ def __init__(
9292
self, subscription_config
9393
)
9494
self._peer_manager: PeerConnectionManager = PeerConnectionManager(
95-
self, video_buffered=video_buffered
95+
self, drain_video_frames=drain_video_frames
9696
)
9797

9898
self.recording_manager = self._recording_manager

getstream/video/rtc/pc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,14 @@ def __init__(
131131
self,
132132
connection,
133133
configuration: aiortc.RTCConfiguration,
134-
video_buffered: bool = True,
134+
drain_video_frames: bool = False,
135135
) -> None:
136136
logger.info(
137137
f"creating subscriber peer connection with configuration: {configuration}"
138138
)
139139
super().__init__(configuration)
140140
self.connection = connection
141-
self._video_buffered = video_buffered
141+
self._drain_video_frames = drain_video_frames
142142

143143
self.track_map = {} # track_id -> (MediaRelay, original_track)
144144
self.video_frame_trackers = {} # track_id -> VideoFrameTracker
@@ -184,7 +184,7 @@ def _emit_pcm(pcm: PcmData):
184184

185185
# Drain unconsumed video frames to prevent unbounded queue growth
186186
# in RTCRtpReceiver (aiortc issue #554)
187-
if track.kind == "video" and not self._video_buffered:
187+
if track.kind == "video" and self._drain_video_frames:
188188
blackhole = MediaBlackhole()
189189
blackhole.addTrack(proxy)
190190
asyncio.create_task(blackhole.start())

getstream/video/rtc/peer_connection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
class PeerConnectionManager:
2929
"""Manages WebRTC peer connections for publishing and subscribing."""
3030

31-
def __init__(self, connection_manager, video_buffered: bool = True):
31+
def __init__(self, connection_manager, drain_video_frames: bool = False):
3232
self.connection_manager = connection_manager
33-
self._video_buffered = video_buffered
33+
self._drain_video_frames = drain_video_frames
3434
self.publisher_pc: Optional[PublisherPeerConnection] = None
3535
self.subscriber_pc: Optional[SubscriberPeerConnection] = None
3636
self.publisher_negotiation_lock = asyncio.Lock()
@@ -48,7 +48,7 @@ async def setup_subscriber(self):
4848
self.subscriber_pc = SubscriberPeerConnection(
4949
connection=self.connection_manager,
5050
configuration=self._build_rtc_configuration(),
51-
video_buffered=self._video_buffered,
51+
drain_video_frames=self._drain_video_frames,
5252
)
5353

5454
# Trace create event

0 commit comments

Comments
 (0)