private void TestProcess() { const int iSize = 44100; int hr; int iCurSize; IntPtr ip; AMMediaType pmt = new AMMediaType(); DMOOutputDataBuffer [] pOutBuf = new DMOOutputDataBuffer[1]; hr = m_imo.GetInputType(0, 0, pmt); hr = m_imo.SetInputType(0, pmt, DMOSetType.None); hr = m_imo.GetOutputType(0, 0, pmt); hr = m_imo.SetOutputType(0, pmt, DMOSetType.None); hr = m_imo.AllocateStreamingResources(); DMOError.ThrowExceptionForHR(hr); DoBuff d = new DoBuff(iSize); d.SetLength(iSize); d.GetBufferAndLength(out ip, out iCurSize); hr = m_imoip.Process(iSize, ip, 0, DMOInplaceProcess.Normal); DMOError.ThrowExceptionForHR(hr); }
private void TestProcess() { int hr; int i; DMOOutputDataBuffer [] pOutBuf = new DMOOutputDataBuffer[1]; hr = m_imo.AllocateStreamingResources(); DMOError.ThrowExceptionForHR(hr); DoBuff d = new DoBuff(44100); d.SetLength(44100); hr = m_imo.ProcessInput(0, d, DMOInputDataBuffer.None, 0, 100); DMOError.ThrowExceptionForHR(hr); DoBuff d2 = new DoBuff(44100); pOutBuf[0].pBuffer = d2; hr = m_imo.ProcessOutput(DMOProcessOutput.None, 1, pOutBuf, out i); DMOError.ThrowExceptionForHR(hr); }
/// <summary> /// Gives the DMO a chance to allocate any resources needed for streaming /// </summary> public void AllocateStreamingResources() { Marshal.ThrowExceptionForHR(mediaObject.AllocateStreamingResources()); }