private void Init()
        {
            byte[] bytes  = Encoding.UTF8.GetBytes("--quiet");
            IntPtr intPtr = Marshal.AllocHGlobal(bytes.Length + 1);

            Marshal.Copy(bytes, 0, intPtr, bytes.Length);
            Marshal.WriteByte(intPtr, bytes.Length, 0);
            LibVlcInstance = LoadFunc <libvlc_new>()(1, new IntPtr[1] {
                intPtr
            });
            LibVlcMediaPlayer = LoadFunc <libvlc_media_player_new>()(LibVlcInstance);
        }
        public void SetMediaUri(Uri uri)
        {
            byte[] bytes  = Encoding.UTF8.GetBytes(uri.AbsoluteUri);
            IntPtr intPtr = Marshal.AllocHGlobal(bytes.Length + 1);

            try
            {
                Marshal.Copy(bytes, 0, intPtr, bytes.Length);
                Marshal.WriteByte(intPtr, bytes.Length, 0);
            }
            catch (Exception ex)
            {
                Marshal.FreeHGlobal(intPtr);
                throw ex;
            }

            var mediaPtr = LoadFunc <libvlc_media_new_location>()(LibVlcInstance, intPtr);

            LoadFunc <libvlc_media_player_set_media>()(LibVlcMediaPlayer, mediaPtr);
        }
Exemple #3
0
            public bool Load(LoadFunc func)
            {
                if (!IsValid)
                {
                    return(false);
                }

                BooterLogger.AddTrace(mName + ": Rows = " + mTable.Rows.Count);

                for (int i = 0; i < mTable.Rows.Count; i++)
                {
                    BooterLogger.AddTrace("Row: " + i);

                    func(mFile, mTable.Rows[i]);
                }

                return(true);
            }
 static void InternalLoadAsset(string path, string file, CallBackDelegate <object, object> callBack, GetPathFunc getPathFunc, GetDependBundlesFunc getDependBundlesFunc, LoadFunc loadFunc)
 {
     AssetLoaderManager.Instance.LoadAsset(path, file, callBack, getPathFunc, getDependBundlesFunc, loadFunc);
 }
Exemple #5
0
 public override void LoadParams(string objectName, CallBackDelegate <object, object> callBack, LoadFunc loadObjectFunc = null)
 {
     loadObjectFunc?.Invoke(this, objectName, callBack);
 }
Exemple #6
0
        public void LoadAsset(string path, string fileName, CallBackDelegate <object, object> callBack, GetPathFunc getPathFunc, GetDependBundlesFunc getDependenciesFunc, LoadFunc loadAssetFunc, bool externalScene = false)
        {
            string assetBundleName = path + fileName;
            string assetBundlePath = getPathFunc(assetBundleName);
            Bundle bundle          = this.GetBundle(assetBundlePath, true);

            bundle.mExternalScene = externalScene && mIsMobilePlatform;
            if (mBundleLoadTaskList.ContainsKey(bundle))
            {
                mBundleLoadTaskList[bundle].AddParams(fileName, callBack, loadAssetFunc);
                return;
            }
            if (bundle.mLoadCompleted)
            {
                bundle.LoadParams(fileName, callBack, loadAssetFunc);
                return;
            }
            if (mIsMobilePlatform && callBack != null)
            {
                bundle.mPreloadAssetName = fileName;
            }
            Bundle[] dependBundles = this.GetDependBundles(assetBundleName, getPathFunc, getDependenciesFunc);
            bundle.SetDependBundles(dependBundles);
            this.mLoadedBunders[assetBundlePath] = bundle.mBundle;
            LoadTask loadTask = new LoadTask(bundle, dependBundles);

            loadTask.AddParams(fileName, callBack, loadAssetFunc);
            mBundleLoadTaskList[bundle] = loadTask;
            mTask.Insert(0, loadTask);
            //mTask.Add(  loadTask );
            this.StartLoadTask();
        }
 public void TakeSnapshot(string dst)
 {
     LoadFunc <libvlc_video_take_snapshot>()(LibVlcMediaPlayer, 0u, dst, 0u, 0u);
 }
        public void SetVideoCanvas(Control canvas)
        {
            var hwnd = canvas.Handle;

            LoadFunc <libvlc_media_player_set_hwnd>()(LibVlcMediaPlayer, hwnd);
        }
 public void Stop()
 {
     LoadFunc <libvlc_media_player_stop>()(LibVlcMediaPlayer);
 }
Exemple #10
0
 public void Play()
 {
     LoadFunc <libvlc_media_player_play>()(LibVlcMediaPlayer);
 }
Exemple #11
0
 public void Pause()
 {
     LoadFunc <libvlc_media_player_pause>()(LibVlcMediaPlayer);
 }
Exemple #12
0
 public virtual void LoadParams(string objectName, CallBackDelegate <object, object> callBack, LoadFunc loadObjectFunc = null)
 {
 }
Exemple #13
0
            public bool Load(LoadFunc func)
            {
                if (!IsValid) return false;

                BooterLogger.AddTrace(mName + ": Rows = " + mTable.Rows.Count);

                for (int i=0; i<mTable.Rows.Count; i++)
                {
                    BooterLogger.AddTrace("Row: " + i);

                    func(mFile, mTable.Rows[i]);
                }

                return true;
            }
Exemple #14
0
 private void LoadParams(string objectName, CallBackDelegate <object, object> callBack, LoadFunc loadObjectFunc = null)
 {
     mMainBundle.LoadParams(objectName, callBack, loadObjectFunc);
 }
Exemple #15
0
        public void AddParams(string objectName, CallBackDelegate <object, object> callBack, LoadFunc loadObjectFunc = null)
        {
            Params mParams = new Params();

            mParams.objectName     = objectName;
            mParams.callBack       = callBack;
            mParams.loadObjectFunc = loadObjectFunc;
            this.mParamsList.Enqueue(mParams);
        }