예제 #1
0
    public static void Unref()
    {
        if (IsActive)
        {
            mray_gstreamer_shutdown();
        }

        if (!IsActive)
        {
            if (_nativeLibraryPtr != IntPtr.Zero)
            {
                //	NativeDLL.UnloadModule(DllName);
                Debug.Log(NativeDLL.FreeLibrary(_nativeLibraryPtr)?
                          "mrayGStreamer Library successfuly Unloaded":
                          "Failed to unload mrayGStreamer Library");
            }
        }
    }
예제 #2
0
 public static void Ref()
 {
     if (_nativeLibraryPtr == IntPtr.Zero)
     {
         _nativeLibraryPtr = NativeDLL.LoadLibrary(DllName);
         if (_nativeLibraryPtr == IntPtr.Zero)
         {
             Debug.LogError("Failed to load mrayGStreamer Library:" + DllName);
         }
     }
     if (!IsActive)
     {
         MyDelegate callback   = new MyDelegate(CallBackFunction);
         IntPtr     intptr_del = Marshal.GetFunctionPointerForDelegate(callback);
         mray_SetDebugFunction(intptr_del);
     }
     mray_gstreamer_initialize();
 }