public CastleDynamicProxyFactory(ICallFactory callFactory, IArgumentSpecificationDequeue argSpecificationDequeue)
 {
     _callFactory                         = callFactory ?? throw new ArgumentNullException(nameof(callFactory));
     _argSpecificationDequeue             = argSpecificationDequeue ?? throw new ArgumentNullException(nameof(argSpecificationDequeue));
     _proxyGenerator                      = new ProxyGenerator();
     _allMethodsExceptCallRouterCallsHook = new AllMethodsExceptCallRouterCallsHook();
 }
Ejemplo n.º 2
0
 public CastleDynamicProxyFactory(ICallFactory callFactory, IArgumentSpecificationDequeue argSpecificationDequeue)
 {
     _callFactory                         = callFactory;
     _argSpecificationDequeue             = argSpecificationDequeue;
     _proxyGenerator                      = new ProxyGenerator();
     _allMethodsExceptCallRouterCallsHook = new AllMethodsExceptCallRouterCallsHook();
 }
Ejemplo n.º 3
0
 public DelegateCall(ICallRouter callRouter,
                     Type delegateType,
                     Type returnType,
                     IParameterInfo[] parameterInfos,
                     ICallFactory callFactory,
                     IArgumentSpecificationDequeue argSpecificationDequeue)
 {
     CallRouter               = callRouter;
     _delegateType            = delegateType;
     _returnType              = returnType;
     _parameterInfos          = parameterInfos;
     _callFactory             = callFactory;
     _argSpecificationDequeue = argSpecificationDequeue;
     MethodToInvoke           = GetMethodToInvoke();
 }
Ejemplo n.º 4
0
 protected virtual void Dispose(bool disposing)
 {
     if (!mIsDisposed)
     {
         if (disposing)
         {
             Debug.Log("UnityCallFactory is being destroyed. All created calls will be destroyed as well!");
             //cleanup
             if (mFactory != null)
             {
                 mFactory.Dispose();
                 mFactory = null;
             }
             Debug.Log("Network factory destroyed");
         }
         mIsDisposed = true;
     }
 }
Ejemplo n.º 5
0
        private void Awake()
        {
            //make sure the wrapper was initialized
            TryStaticInitialize();
            if (sStaticInitSuccessful == false)
            {
                Debug.LogError("Initialization of the webrtc plugin failed. StaticInitSuccessful is false. ");
                mFactory = null;
                return;
            }

#if UNITY_WEBGL && !UNITY_EDITOR
            mFactory = new Byn.Media.Browser.BrowserCallFactory();
#else
            try
            {
                Byn.Media.Native.NativeWebRtcCallFactory factory = new Byn.Media.Native.NativeWebRtcCallFactory();
                mFactory = factory;
                if (Application.platform == RuntimePlatform.Android
                    //for testing only
                    //|| Application.platform == RuntimePlatform.OSXEditor
                    //|| Application.platform == RuntimePlatform.WindowsEditor
                    )
                {
                    mVideoFactory = new Native.UnityVideoCapturerFactory();
                    factory.AddVideoCapturerFactory(mVideoFactory);
                }
            }
            catch (Exception e)
            {
                Debug.LogError("Failed to create the call factory. This might be because a platform specific " +
                               " dll is missing or set to inactive in the unity editor.");
                Debug.LogException(e);
            }
#endif
        }
Ejemplo n.º 6
0
 public PropertyHelper(ICallFactory callFactory, IArgumentSpecificationCompatibilityTester argSpecCompatTester)
 {
     _callFactory         = callFactory;
     _argSpecCompatTester = argSpecCompatTester;
 }
Ejemplo n.º 7
0
 public PropertyHelper(ICallFactory callFactory)
 {
     _callFactory = callFactory;
 }
Ejemplo n.º 8
0
 public CastleInvocationMapper(ICallFactory callFactory, IArgumentSpecificationDequeue argSpecificationDequeue)
 {
     _callFactory             = callFactory;
     _argSpecificationDequeue = argSpecificationDequeue;
 }
        private void Awake()
        {
            //make sure the wrapper was initialized
            TryStaticInitialize();
            if (sStaticInitSuccessful == false)
            {
                Debug.LogError("Initialization of the webrtc plugin failed. StaticInitSuccessful is false. ");
                mFactory = null;
                return;
            }


#if UNITY_WEBGL && !UNITY_EDITOR
            mFactory = new Byn.Media.Browser.BrowserCallFactory();
#else
            if (INTERNAL_VERBOSE_LOG)
            {
                Byn.Net.Native.NativeWebRtcNetworkFactory.SetNativeLogLevel(WebRtcCSharp.LoggingSeverity.LS_INFO);
                //this will route the log via SLog class to the Unity log. This can cause crashes
                //and doesn't work on all platforms
                //Byn.Net.Native.NativeWebRtcNetworkFactory.SetNativeLogToSLog(WebRtcCSharp.LoggingSeverity.LS_NONE);
            }
            else
            {
                Byn.Net.Native.NativeWebRtcNetworkFactory.SetNativeLogLevel(WebRtcCSharp.LoggingSeverity.LS_NONE);
            }
            try
            {
                Byn.Media.Native.NativeWebRtcCallFactory factory = new Byn.Media.Native.NativeWebRtcCallFactory();
                mFactory = factory;


                //old video input system relied on callbacks not supported in IL2CPP
                if (OBSOLETE_UNITY_CAMERA)
                {
#if ENABLE_IL2CPP
                    Debug.LogWarning("UnityVideoCapturerFactory isn't supported with IL2CPP");
#else
                    mVideoFactory = new Native.UnityVideoCapturerFactory();
                    factory.AddVideoCapturerFactory(mVideoFactory);
#endif
                }


#if UNITY_IOS
                //workaround for WebRTC / Unity audio bug on ios
                //WebRTC will deactivate the audio session once all calls ended
                //This will keep it active as Unity relies on this session as well
                WebRtcCSharp.IosHelper.InitAudioLayer();
#endif
            }
            catch (Exception e)
            {
                Debug.LogError("Failed to create the call factory. This might be because a platform specific " +
                               " dll is missing or set to inactive in the unity editor.");
                Debug.LogException(e);
            }
#endif

            SetDefaultLogger(true, false);
        }