{"id":1781,"date":"2017-07-19T15:04:50","date_gmt":"2017-07-19T13:04:50","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=1781"},"modified":"2017-07-20T12:33:40","modified_gmt":"2017-07-20T10:33:40","slug":"no-conversion-with-mf_connect_allow_converter","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/1781","title":{"rendered":"No conversion with MF_CONNECT_ALLOW_CONVERTER"},"content":{"rendered":"<p>Microsoft Media Foundation Media Session API topology resolution is way less clear compared to DirectShow. The API takes away a part of component connection process and makes it less transparent to API consumer. Then, while DirectShow Intelligent Connect is use scenario agnostic,\u00c2\u00a0 Media Foundation Media Session apparently targets playback scenarios, and its topology resolution process is tuned respectively.<\/p>\n<blockquote><p><a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/ms700178\"><strong>MF_CONNECT_ALLOW_DECODER<\/strong><\/a><\/p>\n<p class=\"\">Add a decoder transform <em>upstream upstream<\/em> from this node, if needed to complete the connection. The numeric value of this flag includes the <strong>MF_CONNECT_ALLOW_CONVERTER<\/strong> flag. Therefore, setting the <strong>MF_CONNECT_ALLOW_DECODER<\/strong> flag sets the <strong>MF_CONNECT_ALLOW_CONVERTER<\/strong> flag as well.<\/p>\n<p>[&#8230;] <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/ms700199\">If this attribute is not set, the default value is <strong>MF_CONNECT_ALLOW_DECODER<\/strong>.<\/a><\/p><\/blockquote>\n<p>Well, that&#8217;s double upstream and suggests that the thing is impressively reliable. However it is not.<\/p>\n<p>In a non-playback topology, if a direct connection is impossible and required conversion is not typical for playback, MF_CONNECT_ALLOW_CONVERTER flag seems to be not helpful for topology resolution.<\/p>\n<p>Apparently, Microsoft does have suitable code, esp. used in <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/ff819461\">Sink Writer API<\/a>, however it does not seem to be available in any form other than a packet deal with Sink Writer object and its own limitations. Media Session API does not implement this (non-playback, that is) style of topology resolution and node connection. <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/ff485863\">Transcode API<\/a> too has the necessary topology resolution code, but again it comes with its own constraints making it useless unless you want to do something really simple.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Microsoft Media Foundation Media Session API topology resolution is way less clear compared to DirectShow. The API takes away a part of component connection process and makes it less transparent to API consumer. Then, while DirectShow Intelligent Connect is use scenario agnostic,\u00c2\u00a0 Media Foundation Media Session apparently targets playback scenarios, and its topology resolution process&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/1781\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[424,70],"class_list":["post-1781","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-media-foundation","tag-winapi"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1781","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=1781"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1781\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=1781"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=1781"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=1781"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}