Ejemplo n.º 1
0
 private void HoldLastBlock(IntPtr pBlockHandle, LibVLCAccess.block_t block, int offset)
 {
     if (IntPtr.Zero != pBlockHandle)
     {
         if (offset < block.i_buffer)
         {
             _LastBlockHandle = pBlockHandle;
             _LastBlock = block;
             _LastBlockOffset = offset;
         }
         else
         {
             ReleaseBlock(pBlockHandle, block);
         }
     }
 }
Ejemplo n.º 2
0
        protected IntPtr ReadBlock(out LibVLCAccess.block_t block)
        {
            if (IntPtr.Zero == _AccessVLCObject)
            {
                throw new ObjectDisposedException("AccessVLCObject");
            }

            IntPtr pBlock = InvokeImport.InvokeFunc(_funcReadBlock, _AccessVLCObject);

            if (IntPtr.Zero != pBlock)
            {
                block = (LibVLCAccess.block_t)Marshal.PtrToStructure(pBlock, typeof(LibVLCAccess.block_t));
            }
            else
            {
                block = new LibVLCAccess.block_t();
            }

            return pBlock;
        }
Ejemplo n.º 3
0
        private void LibVLCCoreInit(IPAddress mcifIPAddr)
        {
            IntPtr hmodVLCCore = WINAPIImport.GetModuleHandle("libvlccore.dll");

            if (IntPtr.Zero != hmodVLCCore)
            {
                IntPtr funcaddr = WINAPIImport.GetProcAddress(hmodVLCCore, "input_item_SetMeta");
                //IntPtr funcaddr2 = WINAPIImport.GetProcAddress(hmodVLCCore, "block_Alloc");

                if (IntPtr.Zero != funcaddr)
                {
                    IntPtr funcAccessNew = (IntPtr)(funcaddr.ToInt32() + 0x300);
                    IntPtr funcAccessDelete = (IntPtr)(funcaddr.ToInt32() + 0x240);
                    if (mcifIPAddr.Equals(IPAddress.None))
                    {
                        mcifIPAddr = IPAddress.Any;
                    }
                    _LibAccess = new LibVLCAccess(LibVLCObject, funcAccessNew, funcAccessDelete, mcifIPAddr);
                }
                else
                {
                    throw new Win32Exception(Marshal.GetLastWin32Error());
                }
            }
            else
            {
                throw new Win32Exception(Marshal.GetLastWin32Error());
            }
        }
Ejemplo n.º 4
0
 protected static void ReleaseBlock(IntPtr pBlockHandle, LibVLCAccess.block_t block)
 {
     IntPtr funcBlockRelease = block.pf_release;
     InvokeImport.InvokeFunc(funcBlockRelease, pBlockHandle);
 }
Ejemplo n.º 5
0
        public void LibVLCRelease()
        {
            _LibAccess = null;

            if (IntPtr.Zero != _pLibVLCHandle)
            {
                _instanceVLC.p_libvlc_int = IntPtr.Zero;
                libvlc_release(_pLibVLCHandle);
                _pLibVLCHandle = IntPtr.Zero;
            }

            if (IntPtr.Zero != _hmodCALibVLCHook)
            {
                WINAPIImport.FreeLibrary(_hmodCALibVLCHook);
                _hmodCAPluginZet = IntPtr.Zero;
            }

            if (IntPtr.Zero != _hmodCAPluginZet)
            {
                WINAPIImport.FreeLibrary(_hmodCAPluginZet);
                _hmodCAPluginZet = IntPtr.Zero;
            }
        }