feat(video): recover camera previews and reduce encoding and playout cost

Improve camera recovery, shared preview lifecycle and receiver playout diagnostics. Preserve qualified X4 runtime changes and restore async admission in loopback media tests.
This commit is contained in:
DCCONSTRUCTIONS
2026-10-29 09:10:01 +03:00
parent e06ff9a214
commit fa8bde584f
94 changed files with 8892 additions and 375 deletions
+14 -2
View File
@@ -7,6 +7,18 @@ from aiortc import RTCConfiguration, RTCPeerConnection, RTCSessionDescription
from k1link.viewer.node_media import MEDIA_PROTOCOL, NodeMediaPeers, admit_sdp
@pytest.fixture(autouse=True)
def synthetic_link_budget(monkeypatch):
from missioncore_plugin_sdk.media_budget import MediaBudget
monkeypatch.setattr(MediaBudget, "exchange", lambda self, active=True: {
"schema": "missioncore.media-budget/v1", "allocation_bps": 4_000_000, "ttl_ms": 3000})
from missioncore_plugin_sdk.link_budget import BudgetClient
async def permit(self, size):
return True
monkeypatch.setattr(BudgetClient, "_permit", permit)
SDP_HEADER = "v=0\r\nm=application 9 UDP/DTLS/SCTP webrtc-datachannel\r\n"
@@ -19,7 +31,7 @@ def test_media_rejects_non_private_or_relay_candidates(address, kind):
def test_media_accepts_paired_lan_and_tailnet_candidates():
for address in ("192.168.1.2", "100.80.6.113", "peer.local"):
for address in ("192.168.1.2", "100.64.0.10", "peer.local"):
admit_sdp(SDP_HEADER + f"a=candidate:1 1 udp 1 {address} 12345 typ host\r\n")
@@ -72,7 +84,7 @@ def test_native_webrtc_roundtrip_and_missing_camera_preserve_rrd(monkeypatch):
pass
class Hub:
def subscribe(self, view_id, after):
def subscribe(self, view_id, after, **kwargs):
return Subscription()
class Camera: