comparison libervia/backend/plugins/plugin_xep_0339.py @ 4270:0d7bb4df2343

Reformatted code base using black.
author Goffi <goffi@goffi.org>
date Wed, 19 Jun 2024 18:44:57 +0200
parents 4b842c1fb686
children
comparison
equal deleted inserted replaced
4269:64a85ce8be70 4270:0d7bb4df2343
96 application_data.setdefault("ssrc-group", {})[semantics] = ssrc_ids 96 application_data.setdefault("ssrc-group", {})[semantics] = ssrc_ids
97 elif attribute == "msid": 97 elif attribute == "msid":
98 assert application_data is not None 98 assert application_data is not None
99 application_data["msid"] = " ".join(parts) 99 application_data["msid"] = " ".join(parts)
100 100
101
102 def _generate_sdp_content_trigger( 101 def _generate_sdp_content_trigger(
103 self, 102 self,
104 session: dict, 103 session: dict,
105 local: bool, 104 local: bool,
106 idx: int, 105 idx: int,
107 content_data: dict, 106 content_data: dict,
108 sdp_lines: List[str], 107 sdp_lines: List[str],
109 application_data: dict, 108 application_data: dict,
110 app_data_key: str, 109 app_data_key: str,
111 media_data: dict, 110 media_data: dict,
112 media: str 111 media: str,
113 ) -> None: 112 ) -> None:
114 """Generate "msid" and "ssrc" attributes""" 113 """Generate "msid" and "ssrc" attributes"""
115 if "msid" in media_data: 114 if "msid" in media_data:
116 sdp_lines.append(f"a=msid:{media_data['msid']}") 115 sdp_lines.append(f"a=msid:{media_data['msid']}")
117 116
153 for ssrc_group_elt in desc_elt.elements(NS_JINGLE_RTP_SSMA, "ssrc-group"): 152 for ssrc_group_elt in desc_elt.elements(NS_JINGLE_RTP_SSMA, "ssrc-group"):
154 try: 153 try:
155 semantics = ssrc_group_elt["semantics"] 154 semantics = ssrc_group_elt["semantics"]
156 semantic_ids = media_data.setdefault("ssrc-group", {})[semantics] = [] 155 semantic_ids = media_data.setdefault("ssrc-group", {})[semantics] = []
157 for source_elt in ssrc_group_elt.elements(NS_JINGLE_RTP_SSMA, "source"): 156 for source_elt in ssrc_group_elt.elements(NS_JINGLE_RTP_SSMA, "source"):
158 semantic_ids.append( 157 semantic_ids.append(int(source_elt["ssrc"]))
159 int(source_elt["ssrc"])
160 )
161 except (KeyError, ValueError) as e: 158 except (KeyError, ValueError) as e:
162 log.warning( 159 log.warning(
163 f"Error while parsing <ssrc-group>: {e}\n{ssrc_group_elt.toXml()}" 160 f"Error while parsing <ssrc-group>: {e}\n{ssrc_group_elt.toXml()}"
164 ) 161 )
165 162