Skip to content

Commit

Permalink
Merge pull request #708 from OpenVisualCloud/master
Browse files Browse the repository at this point in the history
Fix #705
  • Loading branch information
xwu2git authored Nov 3, 2020
2 parents 600ddc8 + 933c922 commit 78cb11b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions sensor/webrtc/owtapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ def list_participants(self,room):
r=self._request(requests.get,uri,headers=self._headers())
return len(r.json())

def start_streaming_ins(self,room,rtsp_url):
def start_streaming_ins(self,room,rtsp_url,protocol="tcp"):
options={
"connection": {
"url":str(rtsp_url),
"transportProtocol": "udp",
"transportProtocol": protocol,
"bufferSize":212992,
},
"media": {
Expand Down
3 changes: 2 additions & 1 deletion sensor/webrtc/sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@ def _create_room(self, sensor):
if not r: return (404, "Sensor Not Found")

location=r[0]["_source"]["location"]
protocol= "udp" if 'simsn' in r[0]['_source'].keys() else "tcp"
name="{},{} - {}".format(location["lat"],location["lon"], sensor)
room,stream=watcher.get(name)
if room and stream:
return self._room_details(sensor, name, room, stream)

room=self._owt.create_room(name=name, p_limit=streaming_limit)
rtsp_url=r[0]["_source"]["url"]
stream=self._owt.start_streaming_ins(room=room,rtsp_url=rtsp_url) if room else None
stream=self._owt.start_streaming_ins(room=room,rtsp_url=rtsp_url,protocol=protocol) if room else None
if not stream: return (503, "Exception when post")

watcher.set(name, room, stream)
Expand Down

0 comments on commit 78cb11b

Please sign in to comment.