Custom DirectShow Source Filter - Dynamic Resolution Change

青春壹個敷衍的年華 提交于 2019-12-06 02:32:27

You can have output pin derived from CDynamicOutputPin and perform the following when you need to send notification downstream (to the renderer) about the format change:

hr = StartUsingOutputPin();
if (SUCCEEDED(hr))
{
    hr = ChangeMediaType(&m_mt);
    StopUsingOutputPin();
}

There is an implementation of CDynamicSourceStream and matching CDynamicSource in DirectShow samples from Windows SDK that you may find helpful.

From MSDN Dynamic Format Changes:

  1. QueryAccept (Downstream) is used when If an output pin proposes a format change to its downstream peer, but only if the new format does not require a larger buffer.

  2. ReceiveConnection is used when an output pin proposes a format change to its downstream peer, and the new format requires a larger buffer.

Did you have a chance to try any of these two?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!