Files
facefusion/facefusion/rtc_store.py
T
Henry Ruhs c00ea92f35 Migrate to WHIP (#1120)
* migrate to whip part1

* migrate to whip part2

* migrate to whip part3

* migrate to whip part4

* migrate to whip/whep with bidirectional

* migrate to whip/whep with bidirectional

* use next library

* add _next to lid datachannel files

* cleanup and add todos

* use internal helper rtcGetPayloadTypesForCodec

* fix lint

* refactor decode()

* move logic to codecs

* move logic to codecs

* break encoders and decoders into multiple files

* break encoders and decoders into multiple files

* cleanup more

* drop action for stream endpoints, keep type for self documentation

* restore the v4 store

* fix: align frame_width and frame_height to even in both collect() and read_resolution() in both decoders.

---------

Co-authored-by: harisreedhar <h4harisreedhar.s.s@gmail.com>
2026-05-18 16:16:06 +02:00

30 lines
557 B
Python

from typing import List
from facefusion import rtc
from facefusion.types import RtcPeer, RtcStore, SessionId
RTC_STORE : RtcStore = {}
def init_peers(session_id : SessionId) -> None:
RTC_STORE[session_id] = []
def get_peers(session_id : SessionId) -> List[RtcPeer]:
return RTC_STORE.get(session_id)
def delete_peers(session_id : SessionId) -> None:
if session_id in RTC_STORE:
rtc_peers = get_peers(session_id)
if rtc_peers:
rtc.delete_peers(rtc_peers)
del RTC_STORE[session_id]
return None
def clear() -> None:
RTC_STORE.clear()