Example #1
0
        public void Start(IConnectionProvider standardConnectionProvider, ScreenStream screen)
        {
            connectionProvider = standardConnectionProvider;
            screenStreamer     = screen;

            webCamStreamer = new WebCamStreamer();
        }
Example #2
0
        public void Start(IConnectionProvider standardConnectionProvider, ScreenStream screen)
        {
#if XRREMOTING_USE_NEW_INPUT_SYSTEM
            InputSystem.onEvent += InputSystem_onEvent;
#endif

            dataSender               = new DataSender();
            pointsDataSender         = new DataSender();
            separateThreadDataSender = new DataSender();

            screenStreamer = screen;

            connectionProvider = standardConnectionProvider;

            arCamera.targetTexture = new RenderTexture(arCamera.pixelWidth, arCamera.pixelHeight, 16, RenderTextureFormat.ARGB32);

            Screen.sleepTimeout = SleepTimeout.NeverSleep;

            depthPoints = new List <Vector3>();

            webCamStreamer        = new WebCamStreamer();
            streamingDataReceiver = new DataReceiver(screenStreamer, webCamStreamer);
            defferedCallsReceived = new DataReceiver(screenStreamer, webCamStreamer);

            streamingDataReceiver.handleScreenStream = () =>
            {
                pendingTexAssign = true;
            };

            globalReceived.OnARRemoteSettingsReceived += OnArRemoteSettingsReceived;

            connectionProviderDefferredCalls            = new DirectConnectionProvider();
            connectionProviderDefferredCalls.hasNoDelay = true;
            connectionProviderDefferredCalls.SetRemotePort(7203);

            connectionProviderAR = new DirectConnectionProvider();
            ((DirectConnectionProvider)connectionProviderAR).hasNoDelay = true;
            connectionProviderAR.SetRemotePort(7202);

            connectionProviderAR.OnConnected      += ConnectionProviderAR_OnConnected;
            connectionProviderAR.OnDisconnected   += ConnectionProviderar_OnDisconnected;
            connectionProviderAR.OnDataReceived   += ConnectionProviderar_OnDataReceived;
            connectionProviderAR.OnStreamReceived += ConnectionProviderar_OnStreamReceived;

            connectionProviderDefferredCalls.OnStreamReceived += ConnectionProviderSeparateThread_OnStreamReceived;

            connectionProviderAR.Initialize();
            connectionProviderAR.StartListening();

            connectionProviderDefferredCalls.Initialize();
            connectionProviderDefferredCalls.StartListening();
        }
Example #3
0
 public DataReceiver(ScreenStream screen, WebCamStreamer webCamStreamer)
 {
     this.screen         = screen;
     this.webCamStreamer = webCamStreamer;
 }