Esempio n. 1
0
 private void OnConnectionFailed(object sender, EventArgs e)
 {
     PluginUtils.ExecuteOnUnityThread(() =>
     {
         Shutdown();
         this.CurrentState = ServerState.Failed;
     });
 }
            internal static void OnDataReceived_Callback(uint msgHandle, IntPtr senderPtr, ushort messageType, int length, IntPtr buffer)
            {
                var thisObj = PluginUtils.GetSenderObject <Connection>(senderPtr);

                PluginUtils.ExecuteOnUnityThread(() => {
                    thisObj.OnDataReceived(msgHandle, messageType, length, buffer);
                });
            }
            internal static void OnStateChanged_Callback(IntPtr senderPtr, PlayerPlugin.PLAYBACK_STATE args)
            {
                var thisObj = PluginUtils.GetSenderObject <RealtimeVideoPlayer>(senderPtr);

                PluginUtils.ExecuteOnUnityThread(() => {
                    thisObj.OnStateChanged(args);
                });
            }
            internal static void OnDisconnected_Callback(uint handle, IntPtr senderPtr, long result)
            {
                var thisObj = PluginUtils.GetSenderObject <Connection>(senderPtr);

                PluginUtils.ExecuteOnUnityThread(() => {
                    thisObj.OnDisconnected(handle, result, string.Empty);
                });
            }
            internal static void OnCreated_Callback(IntPtr senderPtr, long result, uint width, uint height)
            {
                var thisObj = PluginUtils.GetSenderObject <RealtimeVideoPlayer>(senderPtr);

                PluginUtils.ExecuteOnUnityThread(() => {
                    Debug.Log("Player_PluginCallbackWrapper::OnCreated_Callback " + width + " x " + height);

                    thisObj.OnCreated(result, width, height);
                });
            }