|
|
@ -15,6 +15,7 @@ warnings.filterwarnings("ignore", category=DeprecationWarning) |
|
|
|
import aiortc |
|
|
|
import aiortc |
|
|
|
from aiortc.mediastreams import VideoStreamTrack, AudioStreamTrack |
|
|
|
from aiortc.mediastreams import VideoStreamTrack, AudioStreamTrack |
|
|
|
from aiortc.contrib.media import MediaBlackhole |
|
|
|
from aiortc.contrib.media import MediaBlackhole |
|
|
|
|
|
|
|
from aiortc.exceptions import InvalidStateError |
|
|
|
from aiohttp import web |
|
|
|
from aiohttp import web |
|
|
|
import capnp |
|
|
|
import capnp |
|
|
|
from teleoprtc import WebRTCAnswerBuilder |
|
|
|
from teleoprtc import WebRTCAnswerBuilder |
|
|
@ -97,6 +98,9 @@ class CerealProxyRunner: |
|
|
|
while True: |
|
|
|
while True: |
|
|
|
try: |
|
|
|
try: |
|
|
|
self.proxy.update() |
|
|
|
self.proxy.update() |
|
|
|
|
|
|
|
except InvalidStateError: |
|
|
|
|
|
|
|
self.logger.warning("Cereal outgoing proxy invalid state (connection closed)") |
|
|
|
|
|
|
|
break |
|
|
|
except Exception as ex: |
|
|
|
except Exception as ex: |
|
|
|
self.logger.error("Cereal outgoing proxy failure: %s", ex) |
|
|
|
self.logger.error("Cereal outgoing proxy failure: %s", ex) |
|
|
|
await asyncio.sleep(0.01) |
|
|
|
await asyncio.sleep(0.01) |
|
|
|