title: Efficiently connecting an asynchronous IMFSourceReader to a synchronous IMFTransform
body: <p>Given an asynchronous IMFSourceReader connected to a synchronous only IMFTransform.</p>
  <p>Then for the IMFSourceReaderCallback::OnReadSample() callback is it a good idea not to call IMFTransform::ProcessInput directly within OnReadSample, but instead push the produced sample onto another queue for another thread to call the transforms ProcessInput on?</p>
  <p>Or would I just be replicating identical work source readers typically do internally?  Or put another way does work within OnReadSample run the risk of blocking any further decoding work within the source reader that could have otherwise happened more asynchronously?</p>
  <p>So I am suggesting something like:</p>
  <pre><code>WorkQueue transformInputs;
  ...
  
  //  Called back async
  HRESULT OnReadSampleCallback(... IMFSample* sample)
  {
      // Push sample and return immediately
      Push(transformInputs, sample); 
  }
  
  //  Different worker thread awoken for transformInputs queue samples
  void OnTransformInputWork()
  {
      //  Transform object is not async capable
      transform-&gt;TransformInput(0, Pop(transformInputs), 0);
      ...
  }
  </code></pre>
  <p>This is touched on, but not elaborated on here 'Implementing the Callback Interface':
  <a href="https://docs.microsoft.com/en-us/windows/win32/medfound/using-the-source-reader-in-asynchronous-mode" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/windows/win32/medfound/using-the-source-reader-in-asynchronous-mode</a></p>
  <p>Or is it completely dependent on whatever the source reader sets up internally and not easily determined?</p>