int IAsyncReader.RequestAllocator(IMemAllocator pPreferred, AllocatorProperties pProps, out IMemAllocator ppActual)
 {
     if (pPreferred != null)
     {
         ppActual = pPreferred;
         if (pProps != null)
         {
             pPreferred.GetProperties(pProps);
         }
         return(S_OK);
     }
     ppActual = null;
     return(E_FAIL);
 }
示例#2
0
        private void TestProp()
        {
            int hr;
            AllocatorProperties pProps  = new AllocatorProperties();
            AllocatorProperties pProps2 = new AllocatorProperties();
            AllocatorProperties pActual = new AllocatorProperties();

            hr = m_ma.GetProperties(pProps);
            DsError.ThrowExceptionForHR(hr);

            pProps.cbAlign  = 1;
            pProps.cbBuffer = 1024;
            pProps.cbPrefix = 0;
            pProps.cBuffers = 24;

            hr = m_ma.SetProperties(pProps, pActual);
            DsError.ThrowExceptionForHR(hr);

            hr = m_ma.GetProperties(pProps2);
            DsError.ThrowExceptionForHR(hr);

            Debug.Assert(pProps.cbBuffer == pProps2.cbBuffer, "Check Size");
            Debug.Assert(pProps.cbBuffer == pActual.cbBuffer, "Check Size");
        }
示例#3
0
文件: GraphForm.cs 项目: x2v0/gep
 private void ShowAllocatorProperties(object sender, EventArgs e)
 {
     if (connectingPin != null)
     {
         IMemInputPin imip = connectingPin.IPin as IMemInputPin;
         if (imip != null)
         {
             IMemAllocator ma = null;
             imip.GetAllocator(out ma);
             if (ma != null)
             {
                 AllocatorProperties pr = new AllocatorProperties();
                 ma.GetProperties(pr);
                 Program.mainform.propform.SetObject(new FieldsToPropertiesProxyTypeDescriptor(pr));
             }
         }
     }
     connectingPin = null;
 }
 int IAsyncReader.RequestAllocator(IMemAllocator pPreferred, AllocatorProperties pProps, out IMemAllocator ppActual)
 {
     if (pPreferred != null)
     {
         ppActual = pPreferred;
         if (pProps != null)
             pPreferred.GetProperties(pProps);
         return S_OK;
     }
     ppActual = null;
     return E_FAIL;
 }