<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fooling Around</title>
	<atom:link href="http://alax.info/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://alax.info/blog</link>
	<description>Software Production Line</description>
	<lastBuildDate>Tue, 03 Aug 2010 09:48:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Sticky: Blog Navigation</title>
		<link>http://alax.info/blog/200</link>
		<comments>http://alax.info/blog/200#comments</comments>
		<pubDate>Sun, 06 Apr 2008 08:00:01 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[FAQ]]></category>
		<category><![CDATA[sticky]]></category>

		<guid isPermaLink="false">http://alax.info/blog/200</guid>
		<description><![CDATA[
If you are searching for software or an utility:

Software: check NTFS Links, DHCP Server pages
WordPress Plugins: check Google Talk Sidebar Widget pages
Utilities: check Utilities category and check subcategories on the sidebar


If you are you interested in C++ development, ATL and WTL:

If you are interested in C++ DirectShow/Media Foundation development, check DirectShow and DMO tags;
Important: if [...]]]></description>
			<content:encoded><![CDATA[<div class="announcement_post"><ol>
<li>If you are searching for software or an utility:
<ul>
<li>Software: check <a href="http://alax.info/blog/ntfslinks/">NTFS Links</a>, <a title="Alax.Info DHCP Server" href="http://alax.info/blog/dhcp-server">DHCP Server</a> pages</li>
<li>WordPress Plugins: check <a href="http://alax.info/blog/tag/wp-googletalk">Google Talk Sidebar Widget</a> pages</li>
<li>Utilities: check <a href="http://alax.info/blog/category/utilities/">Utilities</a> category and check subcategories on the sidebar</li>
</ul>
</li>
<li>If you are you interested in C++ development, ATL and WTL:
<ul>
<li>If you are interested in C++ <a href="http://en.wikipedia.org/wiki/DirectShow">DirectShow</a>/Media Foundation development, check <a href="http://alax.info/blog/tag/directshow">DirectShow</a> and <a href="http://alax.info/blog/tag/dmo">DMO</a> tags;<br />
<em><strong>Important: </strong>if you have a DirectShow question which is not directly related to posted material, please rather post it in <a href="http://social.msdn.microsoft.com/forums/en-US/windowsdirectshowdevelopment">DirectShow Development MSDN Forum</a>, especially instead of asking me in the website chat</em></li>
<li>Check <a href="http://alax.info/blog/category/technology/">Technology</a> category, <a href="http://alax.info/blog/category/technology/atl/">ATL</a> and <a href="http://alax.info/blog/category/technology/wtl/">WTL</a> subcategories, you might also be interested in <a href="http://alax.info/blog/category/source/">Source Code</a>; additionally source code is available via <a href="http://trac2.assembla.com/roatl-utilities/browser/trunk/">Assembla&#8217;s Trac</a></li>
</ul>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/200/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe Flash Media Live Encoder 3.1</title>
		<link>http://alax.info/blog/1138</link>
		<comments>http://alax.info/blog/1138#comments</comments>
		<pubDate>Sat, 24 Jul 2010 08:02:59 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[crap]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[dshow]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[FMLE]]></category>
		<category><![CDATA[garbage]]></category>
		<category><![CDATA[media]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1138</guid>
		<description><![CDATA[It is the first time ever &#8211; because probably I am not as experienced as Geraint &#8211; I witness availability of IMediaSample interface without availability of IMediaSample2. One might be curious what kind of software could provide such a weirdo in 2010? It is latest and greatest Adobe Flash Media Live Encoder 3.1.
Additionally to this, [...]]]></description>
			<content:encoded><![CDATA[<p>It is the first time ever &#8211; because probably I am not as experienced as <a href="http://www.gdcl.co.uk/">Geraint</a> &#8211; I witness availability of <a href="http://msdn.microsoft.com/en-us/library/dd407001%28VS.85%29.aspx">IMediaSample</a> interface without availability of <a href="http://msdn.microsoft.com/en-us/library/dd407002%28VS.85%29.aspx">IMediaSample2</a>. One might be curious what kind of software could provide such a weirdo in 2010? It is latest and greatest <a href="http://www.adobe.com/products/flashmediaserver/flashmediaencoder/">Adobe Flash Media Live Encoder 3.1</a>.</p>
<p>Additionally to this, they decided to provide garbage in <a href="http://msdn.microsoft.com/en-us/library/dd373477%28VS.85%29.aspx">AM_MEDIA_TYPE</a>::formattype field of <a href="http://msdn.microsoft.com/en-us/library/dd319788%28VS.85%29.aspx">IAMStreamConfig::SetFormat</a>. They perhaps learned that standard <a href="http://msdn.microsoft.com/en-us/library/dd317587%28VS.85%29.aspx">Audio Capture Filter</a> will ignore it anyway, so why bother then?</p>
<p>Having fixed that, <a href="http://alax.info/blog/859">Tone Source Filter</a> based virtual audio device is now compatible with <a href="http://www.adobe.com/products/flashmediaserver/flashmediaencoder/">Adobe Flash Media Live Encoder 3.1</a> and it is possible to send audio to remote Flash Media Server, e.g. such as <a href="http://www.ustream.tv/">Ustream.tv</a> service (over <a href="http://en.wikipedia.org/wiki/Real_Time_Messaging_Protocol">RTMP protocol</a>, as implemented by FMLE).</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2010/07/24-Image002.png"><img class="alignnone size-medium wp-image-1143" title="24-Image002" src="http://alax.info/blog/wp-content/uploads/2010/07/24-Image002-320x240.png" alt="24-Image002" width="320" height="240" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1138/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Attributed ATL: Accessing BLOB with ISequentialStream</title>
		<link>http://alax.info/blog/1136</link>
		<comments>http://alax.info/blog/1136#comments</comments>
		<pubDate>Sat, 10 Jul 2010 10:23:22 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[ATL]]></category>
		<category><![CDATA[Seriously]]></category>
		<category><![CDATA[blob]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1136</guid>
		<description><![CDATA[Before attributed ATL was deprecated, it was a convenient way to access databases using attributed classes on top of OLEDB Consumer Templates. Does not it look nice?

[
    db_command("SELECT ServerData FROM Server WHERE Server = ?")
]
class CGetServerData
{
public:
    [ db_param(1) ] LONG m_nServer;
    [ db_column(1, length = "m_nDataLength") [...]]]></description>
			<content:encoded><![CDATA[<p>Before <a href="http://social.msdn.microsoft.com/Forums/en/vclanguage/thread/a74bcacf-e1e3-44c7-994d-3ebb8fe37973">attributed ATL was deprecated</a>, it was a convenient way to access databases using attributed classes on top of <a href="http://msdn.microsoft.com/en-us/library/fk4h509a.aspx">OLEDB Consumer Templates</a>. Does not it look nice?</p>
<pre>
<pre style="color: #000000; background: none repeat scroll 0% 0% #ffffff;"><span style="color: #808030;">[</span>
    db_command<span style="color: #808030;">(</span><span style="color: #800000;">"</span><span style="color: #0000e6;">SELECT ServerData FROM Server WHERE Server = ?</span><span style="color: #800000;">"</span><span style="color: #808030;">)</span>
<span style="color: #808030;">]</span>
<span style="color: #800000; font-weight: bold;">class</span> CGetServerData
<span style="color: #800080;">{</span>
<span style="color: #800000; font-weight: bold;">public</span><span style="color: #e34adc;">:</span>
    <span style="color: #808030;">[</span> db_param<span style="color: #808030;">(</span><span style="color: #008c00;">1</span><span style="color: #808030;">)</span> <span style="color: #808030;">]</span> <span style="color: #603000;">LONG</span> m_nServer<span style="color: #800080;">;</span>
    <span style="color: #808030;">[</span> db_column<span style="color: #808030;">(</span><span style="color: #008c00;">1</span><span style="color: #808030;">,</span> length <span style="color: #808030;">=</span> <span style="color: #800000;">"</span><span style="color: #0000e6;">m_nDataLength</span><span style="color: #800000;">"</span><span style="color: #808030;">)</span> <span style="color: #808030;">]</span> ISequentialStream<span style="color: #808030;">*</span> m_pDataStream<span style="color: #800080;">;</span> DBLENGTH m_nDataLength<span style="color: #800080;">;</span>
<span style="color: #800080;">}</span><span style="color: #800080;">;</span></pre>
</pre>
<p>It worked great with Visual Studio .NET 2003 and it failed to work with later releases. There are <a href="http://www.google.com/search?q=db_column+ISequentialStream">questions on internet about the problem</a>, but there few answers if any. As I recently had to convert a project from 2003 version of the compiler to Visual Studio 2008, the problem was finally to be resolved.</p>
<p><span id="more-1136"></span>The first problem, and an easier one was that you have to put attribute values in quotes. &#8216;Db_column(1, &#8230;&#8217; has to be &#8220;db_column(&#8221;1&#8243;, &#8230;&#8217; and besides going through code and making changes, it appeared that if earlier implementation managed to distinguish between ordinal column numbers and field names by checking provided argument to be a number or a string, with Visual Studio 2008 one has to provide strings at any time. If the string is a valid integer, the attribute processor will treat it as an ordinal number.</p>
<p>So if you want your code to be both compiled with 2003 and 2008 versions of Visual Studio, you have a puzzle now: you have to use quotes, but version 2003 will no longer treat the argument as ordinal number. Note that version 2003 will keep compiling the code and the problem will only come up on runtime. As eventually in the project of interest support for version 2003 will be dropped, I was not interested in this problem anymore.</p>
<p>The main problem is related to use of ISequentialStream pointer variable as a data field. Again, it worked great with Visual Studio .NET 2003, it no longer did with Visual Studio .NET 2005. First of all, you cannot use this data type anymore, as templates don&#8217;t provide an automatic mapper to OLE DB Type.  Instead of ISequentialStream you have to use IUnknown and QueryInterface the provided pointer before use.</p>
<p>This solves compilation problem, but still the code does not work on runtime. An attempt to bind to the column using such accessor results in DB_E_ERRORSOCCURRED (0&#215;80040E21) &#8220;Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.&#8221; A more thorough look gave DBBINDSTATUS_BADBINDINFO (3) for binding to the column of interest.</p>
<p>The cause of the problem is missing DBOBJECT object pointer in the corresponding DBBINDING::pObject field. Why? A general rule for troubleshooting this kind of problem is to enable expanding attributed source code to check what exactly is generated.</p>
<p>The problem is that unlike previous versions of Visual Studio, ATL attributed code provider is no longer generates correct OLEDB template map code for BLOB fields. And this results in incorrectly generated DBBINDING structure, inability to bind to column and as a final result in DB_E_ERRORSOCCURRED error code which does not give a sufficient clue on the root of the problem.</p>
<p>While the map needs a BLOB_* macro for the BLOB column (e.g. BLOB_ENTRY or <a href="http://msdn.microsoft.com/en-us/library/w3k8764c.aspx">BLOB_ENTRY_LENGTH</a>), the generated code uses _COLUMN_ENTRY_CODE instead. This causes missing (null) DBBINDING::pObject field in the binding structure:</p>
<pre>
<pre style="color: #000000; background: none repeat scroll 0% 0% #ffffff;">BEGIN_ACCESSOR_MAP<span style="color: #808030;">(</span>_CGetServerDataAccessor<span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
    BEGIN_ACCESSOR<span style="color: #808030;">(</span><span style="color: #008c00;">0</span><span style="color: #808030;">,</span> <span style="color: #800000; font-weight: bold;">true</span><span style="color: #808030;">)</span>
        <span style="color: #696969;">//_COLUMN_ENTRY_CODE(1, DBTYPE_IUNKNOWN, _SIZE_TYPE(m_pDataUnknown), 0, 0, offsetbuf(m_pDataUnknown), offsetbuf(m_nDataLength), 0)</span>
        BLOB_ENTRY_LENGTH<span style="color: #808030;">(</span><span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #800000; font-weight: bold;">__uuidof</span><span style="color: #808030;">(</span>ISequentialStream<span style="color: #808030;">)</span><span style="color: #808030;">,</span> STGM_READ<span style="color: #808030;">,</span> m_pDataUnknown<span style="color: #808030;">,</span> m_nDataLength<span style="color: #808030;">)</span>
    END_ACCESSOR<span style="color: #808030;">(</span><span style="color: #808030;">)</span>
END_ACCESSOR_MAP<span style="color: #808030;">(</span><span style="color: #808030;">)</span></pre>
</pre>
<p>So it appears that to fix the problem, an attributed class needs to be replaced with a non-attributed update. To ease the conversion one can expand attributed source and use it as a base for the non-attributed class.</p>
<p>And example of such correction/replacement is provided below for a reference.</p>
<pre>
<pre style="color: #000000; background: none repeat scroll 0% 0% #ffffff;"><span style="color: #004a43;">#</span><span style="color: #004a43;">if</span><span style="color: #004a43;"> TRUE</span>
<span style="color: #800000; font-weight: bold;">class</span> _CGetServerDataAccessor
<span style="color: #800080;">{</span>
<span style="color: #800000; font-weight: bold;">public</span><span style="color: #e34adc;">:</span>

DEFINE_COMMAND_EX<span style="color: #808030;">(</span>_CGetServerDataAccessor<span style="color: #808030;">,</span> <span style="color: #800000;">L"</span><span style="color: #0000e6;">SELECT Data FROM Server WHERE Server = ?</span><span style="color: #800000;">"</span><span style="color: #808030;">)</span>

BEGIN_PARAM_MAP<span style="color: #808030;">(</span>_CGetServerDataAccessor<span style="color: #808030;">)</span>
    SET_PARAM_TYPE<span style="color: #808030;">(</span>DBPARAMIO_INPUT<span style="color: #808030;">)</span>
    <span style="color: #696969;">//_COLUMN_ENTRY_CODE(1, _OLEDB_TYPE(m_nServer), _SIZE_TYPE(m_nServer), 0, 0, offsetbuf(m_nServer), 0, 0)</span>
    COLUMN_ENTRY<span style="color: #808030;">(</span><span style="color: #008c00;">1</span><span style="color: #808030;">,</span> m_nServer<span style="color: #808030;">)</span>
END_PARAM_MAP<span style="color: #808030;">(</span><span style="color: #808030;">)</span>

BEGIN_ACCESSOR_MAP<span style="color: #808030;">(</span>_CGetServerDataAccessor<span style="color: #808030;">,</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span>
    BEGIN_ACCESSOR<span style="color: #808030;">(</span><span style="color: #008c00;">0</span><span style="color: #808030;">,</span> <span style="color: #800000; font-weight: bold;">true</span><span style="color: #808030;">)</span>
        <span style="color: #696969;">//_COLUMN_ENTRY_CODE(1, DBTYPE_IUNKNOWN, _SIZE_TYPE(m_pDataUnknown), 0, 0, offsetbuf(m_pDataUnknown), offsetbuf(m_nDataLength), 0)</span>
        BLOB_ENTRY_LENGTH<span style="color: #808030;">(</span><span style="color: #008c00;">1</span><span style="color: #808030;">,</span> <span style="color: #800000; font-weight: bold;">__uuidof</span><span style="color: #808030;">(</span>ISequentialStream<span style="color: #808030;">)</span><span style="color: #808030;">,</span> STGM_READ<span style="color: #808030;">,</span> m_pDataUnknown<span style="color: #808030;">,</span> m_nDataLength<span style="color: #808030;">)</span>
    END_ACCESSOR<span style="color: #808030;">(</span><span style="color: #808030;">)</span>
END_ACCESSOR_MAP<span style="color: #808030;">(</span><span style="color: #808030;">)</span>

<span style="color: #800000; font-weight: bold;">public</span><span style="color: #e34adc;">:</span>
    <span style="color: #603000;">LONG</span> m_nServer<span style="color: #800080;">;</span>
    IUnknown<span style="color: #808030;">*</span> m_pDataUnknown<span style="color: #800080;">;</span>
    DBLENGTH m_nDataLength<span style="color: #800080;">;</span>
<span style="color: #800080;">}</span><span style="color: #800080;">;</span>

<span style="color: #800000; font-weight: bold;">class</span> CGetServerData <span style="color: #800080;">:</span>
    <span style="color: #800000; font-weight: bold;">public</span> CCommand<span style="color: #800080;">&lt;</span>CAccessor<span style="color: #800080;">&lt;</span>_CGetServerDataAccessor<span style="color: #800080;">&gt;</span> <span style="color: #800080;">&gt;</span>
<span style="color: #800080;">{</span>
<span style="color: #800000; font-weight: bold;">public</span><span style="color: #e34adc;">:</span>
<span style="color: #696969;">// CGetServerData</span>
    HRESULT OpenRowset<span style="color: #808030;">(</span><span style="color: #800000; font-weight: bold;">const</span> CSession<span style="color: #808030;">&amp;</span> Session<span style="color: #808030;">,</span> <span style="color: #603000;">LPCWSTR</span> pszCommand <span style="color: #808030;">=</span> <span style="color: #7d0045;">NULL</span><span style="color: #808030;">)</span> <span style="color: #800000; font-weight: bold;">throw</span><span style="color: #808030;">(</span><span style="color: #808030;">)</span>
    <span style="color: #800080;">{</span>
        <span style="color: #800000; font-weight: bold;">if</span><span style="color: #808030;">(</span><span style="color: #808030;">!</span>pszCommand<span style="color: #808030;">)</span>
            _V<span style="color: #808030;">(</span>_CGetServerDataAccessor<span style="color: #800080;">::</span>GetDefaultCommand<span style="color: #808030;">(</span><span style="color: #808030;">&amp;</span>pszCommand<span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
        <span style="color: #800000; font-weight: bold;">return</span> Open<span style="color: #808030;">(</span>Session<span style="color: #808030;">,</span> pszCommand<span style="color: #808030;">,</span> <span style="color: #7d0045;">NULL</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
    <span style="color: #800080;">}</span>
<span style="color: #800080;">}</span><span style="color: #800080;">;</span>
<span style="color: #004a43;">#</span><span style="color: #004a43;">else</span>
<span style="color: #808030;">[</span>
    db_command<span style="color: #808030;">(</span><span style="color: #800000;">"</span><span style="color: #0000e6;">SELECT Data FROM Server WHERE Server = ?</span><span style="color: #800000;">"</span><span style="color: #808030;">)</span>
<span style="color: #808030;">]</span>
<span style="color: #800000; font-weight: bold;">class</span> CGetServerData
<span style="color: #800080;">{</span>
<span style="color: #800000; font-weight: bold;">public</span><span style="color: #e34adc;">:</span>
    <span style="color: #808030;">[</span> db_param<span style="color: #808030;">(</span><span style="color: #800000;">"</span><span style="color: #0000e6;">1</span><span style="color: #800000;">"</span><span style="color: #808030;">)</span> <span style="color: #808030;">]</span> <span style="color: #603000;">LONG</span> m_nServer<span style="color: #800080;">;</span>
    <span style="color: #808030;">[</span> db_column<span style="color: #808030;">(</span><span style="color: #800000;">"</span><span style="color: #0000e6;">1</span><span style="color: #800000;">"</span><span style="color: #808030;">,</span> length <span style="color: #808030;">=</span> <span style="color: #800000;">"</span><span style="color: #0000e6;">m_nDataLength</span><span style="color: #800000;">"</span><span style="color: #808030;">)</span> <span style="color: #808030;">]</span> IUnknown<span style="color: #808030;">*</span> m_pDataUnknown<span style="color: #800080;">;</span> DBLENGTH m_nDataLength<span style="color: #800080;">;</span>
<span style="color: #800080;">}</span><span style="color: #800080;">;</span>
<span style="color: #004a43;">#</span><span style="color: #004a43;">endif</span></pre>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1136/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MediaTools: Two samples to capture M-JPEG video into JPEG files and to play JPEG files back</title>
		<link>http://alax.info/blog/1127</link>
		<comments>http://alax.info/blog/1127#comments</comments>
		<pubDate>Thu, 13 May 2010 06:15:48 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[ATL]]></category>
		<category><![CDATA[Media Tools]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[ip camera]]></category>
		<category><![CDATA[JPEG]]></category>
		<category><![CDATA[M-JPEG]]></category>
		<category><![CDATA[sample]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1127</guid>
		<description><![CDATA[I added two new simple samples for the MediaTools DirectShow filters to demonstrate how to capture M-JPEG video feed, esp. from an IP camera, and write the video frames into sequence of JPEG files. The other sample takes a directory on the input and plays the images back as video. If you are working on [...]]]></description>
			<content:encoded><![CDATA[<p>I added two new simple samples for the MediaTools DirectShow filters to demonstrate how to capture M-JPEG video feed, esp. from an IP camera, and write the video frames into sequence of JPEG files. The other sample takes a directory on the input and plays the images back as video. If you are working on certain transformation filter, it is an easy way to make a reference feed and use it for debugging purposes.</p>
<p>The filters behind that empower the sample are described in <a href="http://alax.info/blog/741">another post</a>.</p>
<p><strong>RenderHttpMjpegVideoIntoFiles01</strong> sample takes an URL on the input to generate <a href="http://www.w3schools.com/media/media_mimeref.asp">image/jpeg JPEG</a> or <a href="http://en.wikipedia.org/wiki/Motion_JPEG">multipart/x-mixed-replace M-JPEG</a> stream. For example, it might be <a href="http://demo1.stardotcams.com/nph-mjpeg.cgi">http://demo1.stardotcams.com/nph-mjpeg.cgi</a> feed from a demo <a href="http://www.stardot.com/">StarDot Technologies</a> IP camera.</p>
<p>The application will create a new directory to write files into, and will save each new video frame received into new JPEG file.</p>
<pre>Z:\MediaTools\Samples\RenderHttpMjpegVideoIntoFiles01\Release&gt;RenderHttpMjpegVideoIntoFiles01.exe http://demo1.stardotcams.com/nph-mjpeg.cgi
URL: http://demo1.stardotcams.com/nph-mjpeg.cgi
Writing to directory: Z:\MediaTools\Samples\RenderHttpMjpegVideoIntoFiles01\Release\2010-05-12 22-07-37
Event: nCode EC_CLOCK_CHANGED 0xD, nParameter1 0x00000000, nParameter2 0x00000000
Event: nCode EC_PAUSED 0xE, nResult 0x00000000, nParameter2 0x00000000
[...]
^C</pre>
<p>The application will generate the files and convert media sample time stamps into file time.</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2010/05/13-Image001.png"><img class="alignnone size-medium wp-image-1128" title="RenderHttpMjpegVideoIntoFiles01 Sample Output" src="http://alax.info/blog/wp-content/uploads/2010/05/13-Image001-320x175.png" alt="RenderHttpMjpegVideoIntoFiles01 Sample Output" width="320" height="175" /></a></p>
<p>The DirectShow graph that implements the operation is the following:</p>
<p><img class="alignnone size-full wp-image-1129" title="RenderHttpMjpegVideoIntoFiles01 Filter Graph" src="http://alax.info/blog/wp-content/uploads/2010/05/13-Image002.png" alt="RenderHttpMjpegVideoIntoFiles01 Filter Graph" width="661" height="346" /></p>
<p>The other sample <strong>RenderJpegFiles01</strong> takes a directory path to look for JPEG files, e.g. generated by previous sample, and pushes them into DirectShow graph as a video feed. File times will be converted [back] to media sample times.</p>
<p><span id="more-1127"></span></p>
<pre>Z:\MediaTools\Samples\RenderJpegFiles01\Release&gt;RenderJpegFiles01 "Z:\MediaTools\Samples\RenderHttpMjpegVideoIntoFiles01\Release\2010-05-12 22-07-37"
Directory: Z:\MediaTools\Samples\RenderHttpMjpegVideoIntoFiles01\Release\2010-05-12 22-07-37
Event: nCode EC_CLOCK_CHANGED 0xD, nParameter1 0x00000000, nParameter2 0x00000000
Event: nCode EC_PAUSED 0xE, nResult 0x00000000, nParameter2 0x00000000
Event: nCode EC_VMR_RECONNECTION_FAILED 0x55, nResult 0x80004005, nParameter2 0x00000000
Event: nCode EC_VMR_RENDERDEVICE_SET 0x53, RendererDeviceType 0x2, nParameter2 0x00000000
Event: nCode EC_VIDEO_SIZE_CHANGED 0xA, Extent 384x240, nParameter2 0x00000000
Event: nCode EC_COMPLETE 0x1, nResult 0x00000000, nParameter2 0x00000000
Event: nCode EC_ERRORABORT 0x3, nResult 0x80004005, nParameter2 0x00000000
Detected resolution change, new resolution is 1024x768, recreating filter graph...
Event: nCode EC_VMR_RECONNECTION_FAILED 0x55, nResult 0x80004005, nParameter2 0x00000000
Event: nCode EC_VMR_RENDERDEVICE_SET 0x53, RendererDeviceType 0x2, nParameter2 0x00000000
Event: nCode EC_VIDEO_SIZE_CHANGED 0xA, Extent 384x240, nParameter2 0x00000000
Event: nCode EC_CLOCK_CHANGED 0xD, nParameter1 0x00000000, nParameter2 0x00000000
Event: nCode EC_PAUSED 0xE, nResult 0x00000000, nParameter2 0x00000000</pre>
<p><a href="http://alax.info/blog/wp-content/uploads/2010/05/13-Image003.png"><img class="alignnone size-medium wp-image-1130" title="RenderJpegFiles01 DirectShow Graph and Output" src="http://alax.info/blog/wp-content/uploads/2010/05/13-Image003-312x320.png" alt="RenderJpegFiles01 DirectShow Graph and Output" width="312" height="320" /></a></p>
<p>Download links:</p>
<ul>
<li>RenderHttpMjpegVideoIntoFiles01: <a href="http://www.assembla.com/code/roatl-utilities/subversion/nodes/trunk/MediaTools/Samples/RenderHttpMjpegVideoIntoFiles01">source code</a>, <a href="http://www.assembla.com/code/roatl-utilities/subversion/nodes/trunk/MediaTools/Samples/RenderHttpMjpegVideoIntoFiles01/Release/RenderHttpMjpegVideoIntoFiles01.exe?format=raw">binary</a></li>
<li>RenderJpegFiles01: <a href="http://www.assembla.com/code/roatl-utilities/subversion/nodes/trunk/MediaTools/Samples/RenderJpegFiles01">source code</a>, <a href="http://www.assembla.com/code/roatl-utilities/subversion/nodes/trunk/MediaTools/Samples/RenderJpegFiles01/Release/RenderJpegFiles01.exe?format=raw">binary</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1127/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ProcessSnapshot: Create process minidump for port-mortem debugging</title>
		<link>http://alax.info/blog/1119</link>
		<comments>http://alax.info/blog/1119#comments</comments>
		<pubDate>Wed, 24 Mar 2010 22:17:42 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[.DMP]]></category>
		<category><![CDATA[ATL]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[minidump]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[snapshot]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[utility]]></category>
		<category><![CDATA[WTL]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1119</guid>
		<description><![CDATA[ProcessSnapshot is a utility to take a snapshot of process call stacks, and the snapshot taken is written into a human friendly text file.

Additionally to this, the utility has been given a capability to create process minidump files, on user request. The minidump files can be used with debugger to analyze the context of the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://alax.info/blog/665">ProcessSnapshot</a> is a utility to take a snapshot of process call stacks, and the snapshot taken is written into a human friendly text file.</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2010/03/24-Image001.png"><img class="alignnone size-medium wp-image-1120" title="ProcessSnapshot is taking process minidump files" src="http://alax.info/blog/wp-content/uploads/2010/03/24-Image001-320x189.png" alt="ProcessSnapshot is taking process minidump files" width="320" height="189" /></a></p>
<p>Additionally to this, the utility has been given a capability to create process <a href="http://msdn.microsoft.com/en-us/library/ms680369%28VS.85%29.aspx">minidump files</a>, on user request. The minidump files can be used with debugger to analyze the context of the process using feature rich debug environment, esp. Microsoft Visual Studio. To create a minidump for a process, check a corresponding box and press &#8220;Take a Dump&#8221; button. A file named &#8220;&lt;process-image-name&gt; &#8211; &lt;date&gt; &lt;time&gt;.dmp&#8221; will be created in the directory of the utility executable.</p>
<p>See also:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/ms680369%28VS.85%29.aspx">Minidump Files (MSDN)</a></li>
<li><a href="http://support.microsoft.com/kb/315263">How to read the small memory dump files that Windows creates for debugging</a></li>
<li><a href="http://www.codeproject.com/KB/debug/postmortemdebug_standalone1.aspx">Post-Mortem Debugging Your Application with Minidumps and Visual Studio .NET</a></li>
<li><a href="http://www.pchell.com/support/minidumps.shtml">How to View Windows Minidump Files</a></li>
</ul>
<p>A binary [<a href="http://www.assembla.com/code/roatl-utilities/subversion/nodes/trunk/ProcessSnapshot/Win32/Release/ProcessSnapshot.exe?format=raw">Win32</a>, <a href="http://www.assembla.com/code/roatl-utilities/subversion/nodes/trunk/ProcessSnapshot/x64/Release/ProcessSnapshot.exe?format=raw">x64</a>] and partial Visual C++ .NET 2008 source code <a href="http://trac2.assembla.com/roatl-utilities/browser/trunk/ProcessSnapshot/Release/ProcessSnapshot.exe">are  available from SVN</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1119/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Windows Visual PC files and locations</title>
		<link>http://alax.info/blog/1115</link>
		<comments>http://alax.info/blog/1115#comments</comments>
		<pubDate>Sun, 14 Mar 2010 10:20:02 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[.vhd]]></category>
		<category><![CDATA[.vmc]]></category>
		<category><![CDATA[.vmcx]]></category>
		<category><![CDATA[.vud]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[virtual pc]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1115</guid>
		<description><![CDATA[Microsoft Windows Visual PC implements virtual machines and the application holds the entire machine state and virtual hard disk information in files. In a few large files in fact, so a question to move and/or backup the files is a question of periodic interest.
So what are the files it is using? First of all, the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.microsoft.com/Windows/Virtual-PC/default.aspx">Microsoft Windows Visual PC</a> implements virtual machines and the application holds the entire machine state and virtual hard disk information in files. In a few large files in fact, so a question to move and/or backup the files is a question of periodic interest.</p>
<p>So what are the files it is using? First of all, the primary file a user clicks on to start virtual machine is a <strong>.VMCX</strong> file and it is located in <strong>&#8220;C:\Users\$(UserName)\Virtual Machines&#8221;</strong> directory. It is a shortcut to internal files and is holding very basic information about the machine, its state and location of other files.</p>
<pre>
<pre style="color: #000000; background: none repeat scroll 0% 0% #ffffff;"><span style="color: #004a43;">&lt;?</span><span style="color: #004a43;">xml</span> <span style="color: #004a43;">version</span><span style="color: #808030;">=</span><span style="color: #008c00;">"1.0"</span> <span style="color: #004a43;">encoding</span><span style="color: #808030;">=</span><span style="color: #0000e6;">"UTF-16"</span><span style="color: #004a43;">?&gt;</span>
<span style="color: #696969;">&lt;!--</span><span style="color: #696969;"> Microsoft Virtual Machine Description and Registration Settings </span><span style="color: #696969;">--&gt;</span>
<span style="color: #a65700;">&lt;</span><span style="color: #5f5035;">vm_description</span><span style="color: #a65700;">&gt;</span>
    <span style="color: #a65700;">&lt;</span><span style="color: #5f5035;">ram_size</span> <span style="color: #274796;">type</span><span style="color: #808030;">=</span><span style="color: #0000e6;">"</span><span style="color: #0000e6;">string</span><span style="color: #0000e6;">"</span><span style="color: #a65700;">&gt;</span>512 MB<span style="color: #a65700;">&lt;/</span><span style="color: #5f5035;">ram_size</span><span style="color: #a65700;">&gt;</span>
    <span style="color: #a65700;">&lt;</span><span style="color: #5f5035;">vmstate</span> <span style="color: #274796;">type</span><span style="color: #808030;">=</span><span style="color: #0000e6;">"</span><span style="color: #0000e6;">string</span><span style="color: #0000e6;">"</span><span style="color: #a65700;">&gt;</span>Hibernated<span style="color: #a65700;">&lt;/</span><span style="color: #5f5035;">vmstate</span><span style="color: #a65700;">&gt;</span>
    <span style="color: #a65700;">&lt;</span><span style="color: #5f5035;">primary_disk1</span> <span style="color: #274796;">type</span><span style="color: #808030;">=</span><span style="color: #0000e6;">"</span><span style="color: #0000e6;">string</span><span style="color: #0000e6;">"</span><span style="color: #a65700;">&gt;</span>C:\Users\Roman\AppData\Local\Microsoft\Windows Virtual PC\Virtual Machines\Windows XP Mode.vhd<span style="color: #a65700;">&lt;/</span><span style="color: #5f5035;">primary_disk1</span><span style="color: #a65700;">&gt;</span>
    <span style="color: #a65700;">&lt;</span><span style="color: #5f5035;">secondary_disk1</span> <span style="color: #274796;">type</span><span style="color: #808030;">=</span><span style="color: #0000e6;">"</span><span style="color: #0000e6;">string</span><span style="color: #0000e6;">"</span> <span style="color: #a65700;">/&gt;</span>
    <span style="color: #a65700;">&lt;</span><span style="color: #5f5035;">notes</span> <span style="color: #274796;">type</span><span style="color: #808030;">=</span><span style="color: #0000e6;">"</span><span style="color: #0000e6;">string</span><span style="color: #0000e6;">"</span><span style="color: #a65700;">&gt;</span>Windows XP Professional in "XP Mode"
Username XPMUser, Password XPM User<span style="color: #a65700;">&lt;/</span><span style="color: #5f5035;">notes</span><span style="color: #a65700;">&gt;</span>
    <span style="color: #a65700;">&lt;</span><span style="color: #5f5035;">vmc_path</span> <span style="color: #274796;">type</span><span style="color: #808030;">=</span><span style="color: #0000e6;">"</span><span style="color: #0000e6;">string</span><span style="color: #0000e6;">"</span><span style="color: #a65700;">&gt;</span>C:\Users\Roman\AppData\Local\Microsoft\Windows Virtual PC\Virtual Machines\Windows XP Mode.vmc<span style="color: #a65700;">&lt;/</span><span style="color: #5f5035;">vmc_path</span><span style="color: #a65700;">&gt;</span>
<span style="color: #a65700;">&lt;/</span><span style="color: #5f5035;">vm_description</span><span style="color: #a65700;">&gt;</span></pre>
</pre>
<p>This directory has a special hidden <strong>desktop.ini</strong> file in it, which instruct the shell to treat the directory and the files in a special way, as Virtual PC files. This is also how Windows is providing user a link &#8220;Create virtual machine&#8221;.</p>
<p>The <strong>.VMCX</strong> file is editable (its format is based on XML) and it holds references to <strong>.VHD</strong> virtual disk files and <strong>.VMC</strong> virtual machine configuration files. However, <strong>.VMCX</strong> file is nothing but a shortcut only, and Windows Virtual PC will re-created those files once underlying <strong>.VMC</strong> file is double-clicked to be started, so there is no need to edit <strong>.VMCX</strong> files.</p>
<p><strong>.VMC</strong> file is a virtual machine configuration file and it holds the settings a user provides for the virtual machine through settings dialog. The file is also using XML formatting, and is editable. While the file is small itself, its location is used as a base location for <strong>.VSV</strong> file, where software stores runtime state of virtual machine. The <strong>.VSV</strong> file size is stipulated by amount of RAM granted to the virtual machine, so the file may be pretty large itself and it might be desired to be moved to another location also. To achieve this, the small <strong>.VMC</strong> file needs to be moved to location of interest. A <strong>.VMC</strong> file can be double-clicked itself to start the virtual machine.</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2010/03/14-Image001.png"><img class="alignnone size-medium wp-image-1116" title="Windows Virtual PC Settings Dialog" src="http://alax.info/blog/wp-content/uploads/2010/03/14-Image001-320x214.png" alt="Windows Virtual PC Settings Dialog" width="320" height="214" /><br />
</a></p>
<p><strong>.VHD </strong>are the large files as they store data from virtual hard disks, so moving them may make  sense. Additionally to the files themselves, if &#8220;Create Undo Disks&#8221; option is enabled, software will manage additional <strong>.VUD</strong> file with the name of format &#8220;VirtualPCUndo_$(VirtualMachineName)_$(Token).vud&#8221; file with changes that has not yet been applied. If moved, the <strong>.VUD</strong> files have to be thought of as a part of <strong>.VHD </strong>files.</p>
<p>By default a <strong>.VMC</strong> file holds both absolute and relative path refrences to <strong>.VHD</strong> and <strong>.VUD</strong> files, with relative reference as a priority. So if <strong>.VMC</strong> and <strong>.VHD</strong> (optionally with <strong>.VUD</strong>) files are moved together, no special path update/edit required. Software will be able to locate moved disk file automatically as soon as virtual machine is started. Still it is possible to edit the files manually and have files located in different directories. Also if disk file location is modified via GUI, software offers/attempts to strip undo disk <strong>.VUD</strong> file and cancel unapplied changes. If configuration file is edited manually, it is possible to keep undo disks without canceling the changes.</p>
<p>When moving files to a different location, make sure to check directory security so that Windows Virtual PC has sufficient privileges accessing files in the new location, or otherwise it would show ambiguous error messages &#8220;Could not register the virtual machine&#8221;.</p>
<p>See Also: <a href="http://download.microsoft.com/download/7/D/6/7D686A6A-B0F7-42E5-BB3B-4972A8C42C9F/Windows Virtual PC Tips.pdf">Windows Virtual PC Tips on microsoft.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1115/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DirectShow Spy: IAMFilterData interface</title>
		<link>http://alax.info/blog/1111</link>
		<comments>http://alax.info/blog/1111#comments</comments>
		<pubDate>Mon, 08 Feb 2010 18:47:28 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[mapper]]></category>
		<category><![CDATA[spy]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1111</guid>
		<description><![CDATA[This quick update for DirectShow Filter Graph Spy adds tracing for (deprecated) IAMFilterData interface, and also fixes problem with Media Player Classic &#8211; Home Cinema, when the player crashes in External Filters windows.
Partial Visual C++ .NET 2008 source code is available  from SVN, release binary included (Win32,  x64);  installation instructions are in [...]]]></description>
			<content:encoded><![CDATA[<p>This quick update for <a href="http://alax.info/blog/777">DirectShow Filter Graph Spy</a> adds tracing for (deprecated) <a rel="nofollow" href="http://msdn.microsoft.com/en-us/library/dd389369%28VS.85%29.aspx">IAMFilterData</a> interface, and also fixes problem with <a href="http://www.xvidvideo.ru/media-player-classic-home-cinema-x86-x64/">Media Player Classic &#8211; Home Cinema</a>, when the player <a href="http://alax.info/blog/1100/comment-page-1#comment-5738">crashes in External Filters windows</a>.</p>
<p>Partial Visual C++ .NET 2008 source code is <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy">available  from SVN</a>, release binary included (<a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy/Release%20Trace/Win32/DirectShowSpy.dll?format=raw">Win32</a>,  <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy/Release%20Trace/x64/DirectShowSpy.dll?format=raw">x64</a>);  installation instructions are in <a href="http://alax.info/blog/777">another post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1111/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>DirectShow Spy: Filter Mapper Spy</title>
		<link>http://alax.info/blog/1100</link>
		<comments>http://alax.info/blog/1100#comments</comments>
		<pubDate>Thu, 24 Dec 2009 13:07:50 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[mapper]]></category>
		<category><![CDATA[spy]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1100</guid>
		<description><![CDATA[DirectShow Filter Graph Spy was updated to add new functionality: spying over another DirectShow object &#8211; Filter Mapper. Filter Mapper object is used for filter registration purposes and also internally by DirectShow&#8217;s Intelligent Connect. IFilterMapper2 interface traces provide detailed description on steps DirectShow takes in order to connect  and/or render filter pins. For example when [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://alax.info/777">DirectShow Filter Graph Spy</a> was updated to add new functionality: spying over another DirectShow object &#8211; <a href="http://msdn.microsoft.com/en-us/library/dd375788%28VS.85%29.aspx">Filter Mapper</a>. Filter Mapper object is used for filter registration purposes and also internally by DirectShow&#8217;s <a href="http://msdn.microsoft.com/en-us/library/ms940065.aspx">Intelligent Connect</a>. <a href="http://msdn.microsoft.com/en-us/library/dd390033%28VS.85%29.aspx">IFilterMapper2</a> interface traces provide detailed description on steps DirectShow takes in order to connect  and/or render filter pins. For example when trying to render <em>MEDIATYPE_Audio</em> pin, Filter Mapper suggested &#8220;RDP DShow Redirection Filter&#8221; and, then, &#8220;Default DirectSound Device&#8221;:</p>
<pre>
<pre style="background: #ffffff none repeat scroll 0% 0%; color: #000000; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;">FilterMapperSpy<span style="color: #008c00;">.</span>h<span style="color: #808030;">(</span><span style="color: #008c00;">186</span><span style="color: #808030;">)</span><span style="color: #808030;">:</span> CFilterMapperSpy<span style="color: #808030;">:</span><span style="color: #808030;">:</span>EnumMatchingFilters<span style="color: #808030;">:</span> nFlags 0x0<span style="color: #808030;">,</span> bExactMatch <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> nMinimalMerit 0x00200001<span style="color: #808030;">,</span> bInputNeeded <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> nInputTypeCount <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> pInputPinCategory NULL<span style="color: #808030;">,</span> bRender <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> bOutputNeeded <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> nOutputTypeCount <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> pOutputPinCategory NULL
FilterMapperSpy<span style="color: #008c00;">.</span>h<span style="color: #808030;">(</span><span style="color: #008c00;">191</span><span style="color: #808030;">)</span><span style="color: #808030;">:</span> CFilterMapperSpy<span style="color: #808030;">:</span><span style="color: #808030;">:</span>EnumMatchingFilters<span style="color: #808030;">:</span> nInputTypeIndex <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> MajorType <span style="color: #808030;">{</span><span style="color: #008c00;">73647561</span><span style="color: #808030;">-</span><span style="color: #008c00;">0000</span><span style="color: #808030;">-</span><span style="color: #008c00;">0010</span><span style="color: #808030;">-</span><span style="color: #008c00;">8000</span><span style="color: #808030;">-</span>00AA00389B71<span style="color: #808030;">}</span><span style="color: #808030;">,</span> Subtype <span style="color: #808030;">{</span><span style="color: #008c00;">00000000</span><span style="color: #808030;">-</span><span style="color: #008c00;">0000</span><span style="color: #808030;">-</span><span style="color: #008c00;">0000</span><span style="color: #808030;">-</span><span style="color: #008c00;">0000</span><span style="color: #808030;">-</span><span style="color: #008c00;">000000000000</span><span style="color: #808030;">}</span>
FilterMapperSpy<span style="color: #008c00;">.</span>h<span style="color: #808030;">(</span><span style="color: #008c00;">212</span><span style="color: #808030;">)</span><span style="color: #808030;">:</span> CFilterMapperSpy<span style="color: #808030;">:</span><span style="color: #808030;">:</span>EnumMatchingFilters<span style="color: #808030;">:</span> pMoniker @device<span style="color: #808030;">:</span>sw<span style="color: #808030;">:</span><span style="color: #808030;">{</span>083863F1<span style="color: #808030;">-</span>70DE<span style="color: #808030;">-</span>11D0<span style="color: #808030;">-</span>BD40<span style="color: #808030;">-</span>00A0C911CE86<span style="color: #808030;">}</span><span style="color: #808030;">\</span><span style="color: #808030;">{</span>AB9D6472<span style="color: #808030;">-</span>752F<span style="color: #808030;">-</span>43F6<span style="color: #808030;">-</span>B29E<span style="color: #808030;">-</span>61207BDA8E06<span style="color: #808030;">}</span>
FilterMapperSpy<span style="color: #008c00;">.</span>h<span style="color: #808030;">(</span><span style="color: #008c00;">220</span><span style="color: #808030;">)</span><span style="color: #808030;">:</span> CFilterMapperSpy<span style="color: #808030;">:</span><span style="color: #808030;">:</span>EnumMatchingFilters<span style="color: #808030;">:</span> sFriendlyName <span style="color: #800000;">"</span><span style="color: #0000e6;">RDP DShow Redirection Filter</span><span style="color: #800000;">"</span><span style="color: #808030;">,</span> sDescription <span style="color: #800000;">"</span><span style="color: #800000;">"</span><span style="color: #808030;">,</span> sDevicePath <span style="color: #800000;">"</span><span style="color: #800000;">"</span>
FilterMapperSpy<span style="color: #008c00;">.</span>h<span style="color: #808030;">(</span><span style="color: #008c00;">212</span><span style="color: #808030;">)</span><span style="color: #808030;">:</span> CFilterMapperSpy<span style="color: #808030;">:</span><span style="color: #808030;">:</span>EnumMatchingFilters<span style="color: #808030;">:</span> pMoniker @device<span style="color: #808030;">:</span>cm<span style="color: #808030;">:</span><span style="color: #808030;">{</span>E0F158E1<span style="color: #808030;">-</span>CB04<span style="color: #808030;">-</span>11D0<span style="color: #808030;">-</span>BD4E<span style="color: #808030;">-</span>00A0C911CE86<span style="color: #808030;">}</span><span style="color: #808030;">\</span>Default DirectSound Device
FilterMapperSpy<span style="color: #008c00;">.</span>h<span style="color: #808030;">(</span><span style="color: #008c00;">220</span><span style="color: #808030;">)</span><span style="color: #808030;">:</span> CFilterMapperSpy<span style="color: #808030;">:</span><span style="color: #808030;">:</span>EnumMatchingFilters<span style="color: #808030;">:</span> sFriendlyName <span style="color: #800000;">"</span><span style="color: #0000e6;">Default DirectSound Device</span><span style="color: #800000;">"</span><span style="color: #808030;">,</span> sDescription <span style="color: #800000;">"</span><span style="color: #800000;">"</span><span style="color: #808030;">,</span> sDevicePath <span style="color: #800000;">"</span><span style="color: #800000;">"</span></pre>
</pre>
<p>Important is that DirectShow&#8217;s internals are using the mapper through COM instantiation and this provides a safe method to override default behavior process wide in order to, for example, extend <a href="http://msdn.microsoft.com/en-us/library/ms940065.aspx">Intelligent Connect</a> functionality onto custom, unregistered globally, private filters.</p>
<p>Also, the binary is renamed from FilterGraphSpy.dll to DirectShowSpy.dll.</p>
<p>Partial Visual C++ .NET 2008 source code is <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy">available from SVN</a>, release binary included (<a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy/Release%20Trace/Win32/DirectShowSpy.dll?format=raw">Win32</a>, <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy/Release%20Trace/x64/DirectShowSpy.dll?format=raw">x64</a>); installation instructions are in <a href="./777">another post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1100/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>DirectShow Filter Graph Spy: 64-bit version and hook API</title>
		<link>http://alax.info/blog/1094</link>
		<comments>http://alax.info/blog/1094#comments</comments>
		<pubDate>Sun, 01 Nov 2009 19:30:19 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[ATL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[64-bit]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[spy]]></category>
		<category><![CDATA[x64]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1094</guid>
		<description><![CDATA[Today&#8217;s update for DirectShow Filter Graph Spy introduces 64-bit version (mind the beta state) and a mini-API for an external module to be involved into graph building process.
Filter Graph Spy is offering three new interfaces that provide extensibility of the spy:

IFilterGraphAddRemoveHook
IFilterGraphConnectHook
IFilterGraphStateControlHook

The interfaces are contained in the type library and can be imported using #import directive. [...]]]></description>
			<content:encoded><![CDATA[<p>Today&#8217;s update for DirectShow Filter Graph Spy introduces 64-bit version (mind the beta state) and a mini-API for an external module to be involved into graph building process.</p>
<p>Filter Graph Spy is offering three new interfaces that provide extensibility of the spy:</p>
<ul>
<li>IFilterGraphAddRemoveHook</li>
<li>IFilterGraphConnectHook</li>
<li>IFilterGraphStateControlHook</li>
</ul>
<p>The interfaces are contained in the type library and can be imported using <a href="http://msdn.microsoft.com/en-us/library/8etzzkb6%28VS.71%29.aspx">#import</a> directive. An implementation of one or more of these interfaces will receive hook style calls corresponding to respective <a href="http://msdn.microsoft.com/en-us/library/dd375786%28VS.85%29.aspx">Filter Graph Manager</a> calls, system wide including in context of other applications.</p>
<p>A COM object may be registered as a hook object with <em>Spy</em> and <em>NoThreadSpy</em> COM classes under predefined registry keys:</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2009/11/02-Image001.png"><img class="alignnone size-medium wp-image-1095" title="Registering a DirectShow Filter Graph Spy Hook" src="http://alax.info/blog/wp-content/uploads/2009/11/02-Image001-320x136.png" alt="Registering a DirectShow Filter Graph Spy Hook" width="320" height="136" /></a></p>
<p>Spy will instantiate the registered hook objects and forward them the calls it receive, before passing them to system Filter Graph Manager object. A hook object has an option to override default processing, including, for example, inserting its own filter in between. For example, <a href="http://msdn.microsoft.com/en-us/library/dd390021%28VS.85%29.aspx">IFilterGraph::Reconnect</a> call is implemented the following way:</p>
<pre>
<pre style="background: #ffffff none repeat scroll 0% 0%; color: #000000;">STDMETHOD<span style="color: #808030;">(</span>Reconnect<span style="color: #808030;">)</span><span style="color: #808030;">(</span>IPin<span style="color: #808030;">*</span> pPin<span style="color: #808030;">)</span> <span style="color: #800000; font-weight: bold;">throw</span><span style="color: #808030;">(</span><span style="color: #808030;">)</span>
<span style="color: #800080;">{</span>
    _Z4<span style="color: #808030;">(</span>atlTraceCOM<span style="color: #808030;">,</span> <span style="color: #008c00;">4</span><span style="color: #808030;">,</span> _T<span style="color: #808030;">(</span><span style="color: #800000;">"</span><span style="color: #0000e6;">...</span><span style="color: #0f69ff;">\n</span><span style="color: #800000;">"</span><span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
    HOOK_PROLOG<span style="color: #808030;">(</span>CFilterGraphConnectHookHost<span style="color: #808030;">)</span>
        OnReconnect<span style="color: #808030;">(</span>pT<span style="color: #808030;">,</span> pPin<span style="color: #808030;">,</span> <span style="color: #808030;">&amp;</span>bDefault<span style="color: #808030;">)</span><span style="color: #800080;">;</span>
    HOOK_EPILOG<span style="color: #808030;">(</span><span style="color: #808030;">)</span>
    <span style="color: #800000; font-weight: bold;">return</span> m_pInnerFilterGraph2<span style="color: #808030;">-</span><span style="color: #808030;">&gt;</span>Reconnect<span style="color: #808030;">(</span>pPin<span style="color: #808030;">)</span><span style="color: #800080;">;</span>
<span style="color: #800080;">}</span></pre>
</pre>
<p>Before passing the call to original Reconnect method, spy is iterating through associated hooks, passing them <em>IFilterGraphConnectHook::OnReconnect</em> call. Setting <em>bDefault</em> parameter to <em>FALSE</em> will prevent spy from passing the call to original method.</p>
<p>Included <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy/BdaHooks">BdaHooks</a> project shows a sample implementation of the hooking COM classes (note <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy/BdaHooks/ConnectHook.rgs">.rgs registration</a>).</p>
<p>Filter Graph Spy is compatible with all current Windows operating systems, 32-bit and 64-bit (<a href="http://en.wikipedia.org/wiki/X86-64">x64</a>), in particular including:</p>
<ul>
<li><a href="http://www.microsoft.com/windows/windows-7/">Windows 7</a></li>
<li>Windows Server 2008</li>
<li>Windows Vista</li>
<li>Windows Server 2003</li>
<li>Windows XP</li>
<li>Windows 2000</li>
</ul>
<p>NOTE: DirectShow Filter Graph Spy is <span style="text-decoration: underline;">NOT</span> suitable for production environment, it is <span style="text-decoration: underline;">NOT</span> licensed to be redistributed to be a part of production state software item.</p>
<p>Partial Visual C++ .NET 2008 source code is <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy">available from SVN</a>, release binary included (<a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy/Release%20Trace/Win32/DirectShowSpy.dll?format=raw">Win32</a>, <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy/Release%20Trace/x64/DirectShowSpy.dll?format=raw">x64</a>); installation instructions are in <a href="http://alax.info/blog/777">another post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1094/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>regsvr32 32-bit vs. 64-bit</title>
		<link>http://alax.info/blog/1090</link>
		<comments>http://alax.info/blog/1090#comments</comments>
		<pubDate>Sun, 01 Nov 2009 09:59:34 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1090</guid>
		<description><![CDATA[Regsvr32 tool is the one to register DLL hosted COM servers with the system, this is what many have learned without even knowing anything about COM.
On 64-bit operating systems DLLs are 32-bit and 64-bit images, and an important thing about them is that there is no way to mix them in a single process. That [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://msdn.microsoft.com/en-us/library/ms859484.aspx">Regsvr32</a> tool is the one to register DLL hosted COM servers with the system, this is what many have learned without even knowing anything about COM.</p>
<p>On 64-bit operating systems DLLs are 32-bit and 64-bit images, and an important thing about them is that there is no way to mix them in a single process. That is, 32-bit DLLs are for 32-bit processes, running inside <a href="http://msdn.microsoft.com/en-us/library/aa384249%28VS.85%29.aspx">WOW64</a> subsystem, 64-bit DLLs are for native processes.</p>
<p>So how comes that running regsvr32 from command line we can register both 32-bit and 64-bit DLLs. Does the system automatically identify image type of the DLL? Yes, the screenshot below illustrates registration of 64-bit DLL from command line &#8220;<em>regsvr32 FilterGraphSpy.dll</em>&#8220;.</p>
<p><img class="size-full wp-image-1091 alignnone" title="regsvr32 FilterGraphSpy.dll (64-bit)" src="http://alax.info/blog/wp-content/uploads/2009/11/01-Image001.png" alt="regsvr32 FilterGraphSpy.dll (64-bit)" width="366" height="131" /></p>
<p><a href="http://alax.info/blog/wp-content/uploads/2009/11/01-Image002.png"><img class="alignnone size-medium wp-image-1092" title="Process Explorer: regsvr32 Processes" src="http://alax.info/blog/wp-content/uploads/2009/11/01-Image002-320x179.png" alt="Process Explorer: regsvr32 Processes" width="320" height="179" /></a></p>
<p>Command line interpreter starts a 32-bit version of regsvr32 tool, which is located in SysWOW64 directory. It detects that provided image is 64-bit and spawns a 64-bit twin from system32 directory, forwarding the registration task to it. The latter loads 64-bit DLL, being native 64-bit process itself, and does the thing.</p>
<p>As simple as that.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1090/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
