From b4aa54fdae6a6d95bd72813a0e124f3be0dbb601 Mon Sep 17 00:00:00 2001 From: Fabien Danieau Date: Wed, 16 Oct 2024 15:41:50 +0200 Subject: [PATCH 1/2] enhancement #51: emit session closed --- src/gst_signalling/gst_abstract_role.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gst_signalling/gst_abstract_role.py b/src/gst_signalling/gst_abstract_role.py index 6e6603c..9627de2 100644 --- a/src/gst_signalling/gst_abstract_role.py +++ b/src/gst_signalling/gst_abstract_role.py @@ -134,8 +134,7 @@ async def close_session(self, session_id: str) -> None: session = self.sessions.pop(session_id) self._pipeline.remove(session.pc) session.pc.set_state(Gst.State.NULL) - # self.emit("close_session", session) - # await session.pc.close() + self.emit("close_session", session) async def send_sdp(self, session_id: str, sdp: Dict[str, Dict[str, str]]) -> None: await self.signalling.send_peer_message(session_id, "sdp", sdp) From b934f3e0ae91dc0d2cb0ceeb180f36aa91fd8b0d Mon Sep 17 00:00:00 2001 From: Fabien Danieau Date: Wed, 16 Oct 2024 15:42:32 +0200 Subject: [PATCH 2/2] enhancement #51: change some log level --- src/gst_signalling/gst_signalling.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gst_signalling/gst_signalling.py b/src/gst_signalling/gst_signalling.py index 45d637f..601b514 100644 --- a/src/gst_signalling/gst_signalling.py +++ b/src/gst_signalling/gst_signalling.py @@ -83,7 +83,7 @@ async def close(self) -> None: self.logger.info("Closing connection.") await self.ws.close() - self.logger.info("Closed.") + self.logger.debug("Closed.") # Messages (server --> peer) async def _handler(self) -> None: @@ -95,7 +95,7 @@ async def _handler(self) -> None: async for data in self.ws: assert isinstance(data, str) - self.logger.info(f"Received message: {data}") + self.logger.debug(f"Received message: {data}") message: Dict[str, Any] = json.loads(data) await self._handle_messages(message) except asyncio.CancelledError: