move datachannel to libraries and follow datachannel conventions (#1090)

* move datachannel to libraries and follow new datachannel_module convention

* move datachannel to libraries and follow new datachannel_module convention
This commit is contained in:
Henry Ruhs
2026-05-09 09:48:40 +02:00
committed by henryruhs
parent a8db033033
commit 97e0df01b1
5 changed files with 36 additions and 35 deletions
+2 -1
View File
@@ -6,11 +6,12 @@ from typing import Optional
from starlette.testclient import TestClient
from facefusion import rtc
from facefusion.libraries import datachannel as datachannel_module
from facefusion.types import SdpOffer
def create_sdp_offer() -> Optional[SdpOffer]:
datachannel_library = rtc.create_static_datachannel_library()
datachannel_library = datachannel_module.create_static_library()
peer_connection = rtc.create_peer_connection(disable_auto_negotiation = True)
datachannel_library.rtcAddTrack(peer_connection, rtc.build_media_description('video', 96, 'VP8/90000', 'recvonly', 0))
+6 -5
View File
@@ -3,6 +3,7 @@ from typing import List
import pytest
from facefusion import rtc
from facefusion.libraries import datachannel as datachannel_module
from facefusion.types import RtcPeer
@@ -20,7 +21,7 @@ def test_build_media_description() -> None:
@pytest.mark.skip
def test_create_peer_connection() -> None:
peer_connection = rtc.create_peer_connection()
datachannel_library = rtc.create_static_datachannel_library()
datachannel_library = datachannel_module.create_static_library()
assert peer_connection > 0
assert datachannel_library.rtcDeletePeerConnection(peer_connection) == 0
@@ -33,7 +34,7 @@ def test_add_audio_track() -> None:
assert rtc.add_audio_track(peer_connection, 'sendonly') > 0
rtc.create_static_datachannel_library().rtcDeletePeerConnection(peer_connection)
datachannel_module.create_static_library().rtcDeletePeerConnection(peer_connection)
# TODO: enable again
@@ -43,13 +44,13 @@ def test_add_video_track() -> None:
assert rtc.add_video_track(peer_connection, 'sendonly') > 0
rtc.create_static_datachannel_library().rtcDeletePeerConnection(peer_connection)
datachannel_module.create_static_library().rtcDeletePeerConnection(peer_connection)
# TODO: enable again
@pytest.mark.skip
def test_negotiate_sdp() -> None:
datachannel_library = rtc.create_static_datachannel_library()
datachannel_library = datachannel_module.create_static_library()
sender_connection = rtc.create_peer_connection()
rtc.add_video_track(sender_connection, 'sendonly')
@@ -74,7 +75,7 @@ def test_negotiate_sdp() -> None:
# TODO: enable again
@pytest.mark.skip
def test_delete_peers() -> None:
datachannel_library = rtc.create_static_datachannel_library()
datachannel_library = datachannel_module.create_static_library()
peer_connection = rtc.create_peer_connection()
rtc_peers : List[RtcPeer] =\
[