File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -71,11 +71,11 @@ def list_participants(self,room):
71
71
r = self ._request (requests .get ,uri ,headers = self ._headers ())
72
72
return len (r .json ())
73
73
74
- def start_streaming_ins (self ,room ,rtsp_url ):
74
+ def start_streaming_ins (self ,room ,rtsp_url , protocol = "tcp" ):
75
75
options = {
76
76
"connection" : {
77
77
"url" :str (rtsp_url ),
78
- "transportProtocol" : "udp" ,
78
+ "transportProtocol" : protocol ,
79
79
"bufferSize" :212992 ,
80
80
},
81
81
"media" : {
Original file line number Diff line number Diff line change @@ -42,14 +42,15 @@ def _create_room(self, sensor):
42
42
if not r : return (404 , "Sensor Not Found" )
43
43
44
44
location = r [0 ]["_source" ]["location" ]
45
+ protocol = "udp" if 'simsn' in r [0 ]['_source' ].keys () else "tcp"
45
46
name = "{},{} - {}" .format (location ["lat" ],location ["lon" ], sensor )
46
47
room ,stream = watcher .get (name )
47
48
if room and stream :
48
49
return self ._room_details (sensor , name , room , stream )
49
50
50
51
room = self ._owt .create_room (name = name , p_limit = streaming_limit )
51
52
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
53
54
if not stream : return (503 , "Exception when post" )
54
55
55
56
watcher .set (name , room , stream )
You can’t perform that action at this time.
0 commit comments