This repository was archived by the owner on May 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,11 +71,11 @@ def list_participants(self,room):
7171 r = self ._request (requests .get ,uri ,headers = self ._headers ())
7272 return len (r .json ())
7373
74- def start_streaming_ins (self ,room ,rtsp_url ):
74+ def start_streaming_ins (self ,room ,rtsp_url , protocol = "tcp" ):
7575 options = {
7676 "connection" : {
7777 "url" :str (rtsp_url ),
78- "transportProtocol" : "udp" ,
78+ "transportProtocol" : protocol ,
7979 "bufferSize" :212992 ,
8080 },
8181 "media" : {
Original file line number Diff line number Diff line change @@ -42,14 +42,15 @@ def _create_room(self, sensor):
4242 if not r : return (404 , "Sensor Not Found" )
4343
4444 location = r [0 ]["_source" ]["location" ]
45+ protocol = "udp" if 'simsn' in r [0 ]['_source' ].keys () else "tcp"
4546 name = "{},{} - {}" .format (location ["lat" ],location ["lon" ], sensor )
4647 room ,stream = watcher .get (name )
4748 if room and stream :
4849 return self ._room_details (sensor , name , room , stream )
4950
5051 room = self ._owt .create_room (name = name , p_limit = streaming_limit )
5152 rtsp_url = r [0 ]["_source" ]["url" ]
52- stream = self ._owt .start_streaming_ins (room = room ,rtsp_url = rtsp_url ) if room else None
53+ stream = self ._owt .start_streaming_ins (room = room ,rtsp_url = rtsp_url , protocol = protocol ) if room else None
5354 if not stream : return (503 , "Exception when post" )
5455
5556 watcher .set (name , room , stream )
You can’t perform that action at this time.
0 commit comments