How does DirectShow decide between two codecs with the same merit value?
Given two codecs with the same merit value, how does DirectShow decide which one to use through 开发者_运维知识库the 'intelligent connect' mechanism?
It throws a dice.
Seriously the behavior is undefined, both decoders have chances to be taken first. In case of rejection, filter graph would try the other one.
The intelligent connect msdn page sheds some light on this.
Starting from Windows 7, a new system is used, and the merit system is only used as a fallback when no filter is found after searching for one using the new approach.
Starting in Windows 7, DirectShow has a list of preferred filters for certain media subtypes. If there is a preferred filter for the media type that is being rendered, the Filter Graph Manager tries that filter next. An application can modify the list of preferred filters by using the IAMPluginControl interface. Changes to the list affect the application's current process, and are discarded after the process ends.
In case the merit system is used, the msdn page only mentions the following:
Then it tries them in order of merit, from highest to lowest. (It uses additional criteria to choose between filters with equal merit.)
精彩评论