Ivo/webrtc#192
Conversation
|
This PR will probably break the video in the Python program, because of signaling. However, I think it works well with the Android controller. Will have to get the python video working next. |
|
So does this break the python interface, or can it still be used with RTSP server? |
It can still be used with RSTP, but at the moment, we cannot switch to RTSP at runtime. Even after we add a configuration, we need to create a different surface at the robot side, |
|
I have to say, it is difficult to find examples of Python programs displaying WebRTC video in |
…reated programmatically. It is independent from the Fragment, which means video should be sent in other fragments as well.
|
@dhruv2295 Let's work on this together. I added the ability to create the surface for sending video from the Bot app. programmatically. This makes it easy to switch between RTSP and WebRTC without recompiling. Also, this enables video from all fragments, because this surface is outside of the fragments. We need to add configuration and make sure we do not create problems in fragments other than FreeRoam. |
I guess, we could also do WebRTC video feed via browser and only send/receive commands through python. |
Yes, I can revisit showing the video in a browser, but if we can configure the app to send either RTSP or WebRTC, the python script can still use RTSP. |
…ically based on info from the Bit app.
…s not supported yet.
…e have connected to the controller. Otherwise this view will cause instability if cannto send video to the controller.
|
This latest change should address the instability issue. This only happens if the controller is not connected to the bot app, but we have created the surface. Now we create the surface after successful connection.
|
|
The instability issue was caused by |
…Ivo/webrtc # Conflicts: # android/app/src/main/java/org/openbot/env/PhoneController.java
|
I merged @dhruv2295 settings for RTSP/WebRTC (with minor changes due to conflicts). |
|
Added "mirror" button on controller. The controller starts in "mirrored" state. The state is kept on the server (bot app) so it can be added configuration. |
* Added Video/Audio streaming via WebRTC. * The surface in the bot app to send video to the controller is created programmatically and is independent of the fragment. * Controller creates its video view type (RTSP or WebRTC) dynamically based on settings in the bot app. * Added a message to the keyboard-pygame.py to warn that WebRTC video is not supported yet. * Added video mirror and audio mute/unmute. * Bugfixes.
The Bot app initiates a WebRTC call to the controller, by sending an WebRTC
offer, providing its A/V capabilities. It then waits for ananswerwith controller's capabilities. Note that the media is streamed only one way from the Robot to the controller.WebRTC does not specify signaling protocol. Usually, a separate signaling server is used
witch mediates between the two WebRTC peers, and communication between the peers and the signalling server is carried over WebSocket. However, we already have a communication channel between the peers (NetworkServiceConnection) so we are using it instead. No separate signaling server is required.
It is possible in the future to factor out signaling into a separate class and provide various signalling types, such as to separate signalling server.
ControllerToBotEventBus.subscribe(). We now have multiple subscribers to this event bus, and some of them are only interested in particular message types. It is more efficient to add this filter to thesubscribe()method than filtering the messages as they are received, because filtered events are not even emitted.