<?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 &#187; Source</title>
	<atom:link href="http://alax.info/blog/tag/source/feed" rel="self" type="application/rss+xml" />
	<link>http://alax.info/blog</link>
	<description>// Software Production Line</description>
	<lastBuildDate>Wed, 02 May 2012 15:42:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>GPS Location/Coordinate Converter: Fractional Seconds, More Shortcuts</title>
		<link>http://alax.info/blog/1302</link>
		<comments>http://alax.info/blog/1302#comments</comments>
		<pubDate>Thu, 20 Oct 2011 17:48:42 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[ATL]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[WTL]]></category>
		<category><![CDATA[coordinate]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[gps]]></category>
		<category><![CDATA[map]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[utility]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1302</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1302" title="GPS Location/Coordinate Converter: Fractional Seconds, More Shortcuts"></a>This adds a small update to the recently published GPS Location/Coordinate Converter utility: Seconds in Degrees, Minutes &#38; Seconds notation are shown and are accepted as floating point numbers More shortcuts to popular online map services (note that only Google &#8230;<p class="read-more"><a href="http://alax.info/blog/1302">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1302" title="GPS Location/Coordinate Converter: Fractional Seconds, More Shortcuts"></a><p>This adds a small update to the recently published <a title="Permalink to Utility Clearance: GPS Location/Coordinate Converter" href="../1297">GPS Location/Coordinate Converter</a> utility:</p>
<ul>
<li>Seconds in <em>Degrees, Minutes &amp; Seconds</em> notation are shown and are accepted as floating point numbers</li>
<li>More shortcuts to popular online map services (note that only Google Maps and Yandex Maps are still accepted as input via clipboard):</li>
<ul>
<li style="text-align: left;">Bing Maps</li>
<li style="text-align: left;">Yahoo Maps</li>
<li style="text-align: left;">Open Street Map</li>
<li style="text-align: left;">WikiMapia</li>
</ul>
</ul>
<p>The latter makes the tool an easy to use converted between the services for a GPS POI.</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2011/10/Image0011.png"><img class="alignnone size-large wp-image-1303" title="GPS Location Converter" src="http://alax.info/blog/wp-content/uploads/2011/10/Image0011-800x316.png" alt="" width="620" height="244" /></a></p>
<p>A binary [<a href="http://www.alax.info/svn/public/trunk/Utilities/GpsLocationConverter/_Bin/Release/GpsLocationConverter.exe">Win32</a>] and partial Visual C++ .NET 2010 <a href="http://www.alax.info/trac/public/browser/trunk/Utilities/GpsLocationConverter">partial source code</a> are available from SVN.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1302/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sample: Simultaneous Audio Playback via Waveform Audio (waveOut) API</title>
		<link>http://alax.info/blog/1291</link>
		<comments>http://alax.info/blog/1291#comments</comments>
		<pubDate>Wed, 12 Oct 2011 17:15:50 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[playback]]></category>
		<category><![CDATA[waveOut]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1291</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1291" title="Sample: Simultaneous Audio Playback via Waveform Audio (waveOut) API"></a>The minimalistic sample demonstrates support of [deprecated] Waveform Audio API for multiple playback streams. Depending on command line parameters, the application starts threads to open audio hardware using separate waveOutOpen call and stream one or more generated sine waves: 1,000 &#8230;<p class="read-more"><a href="http://alax.info/blog/1291">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1291" title="Sample: Simultaneous Audio Playback via Waveform Audio (waveOut) API"></a><p>The minimalistic sample demonstrates support of [deprecated] <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd757715%28v=VS.85%29.aspx">Waveform Audio API</a> for multiple playback streams.</p>
<p>Depending on command line parameters, the application starts threads to open audio hardware using separate <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd743866%28v=VS.85%29.aspx">waveOutOpen</a> call and stream one or more generated sine waves:</p>
<ul>
<li>1,000 Hz sine wave as 22,050 Hz, Mono, 16-bit PCM (command line parameter &#8220;a&#8221;)</li>
<li>5,000 Hz sine wave as 32,000 Hz, Mono, 16-bit PCM (command line parameter &#8220;b&#8221;)</li>
<li>15,000 Hz sine wave as 44,100 Hz, Mono, 16-bit PCM (command line parameter &#8220;c&#8221;)</li>
</ul>
<pre style="color: #000000; background: #ffffff;">Check<span style="color: #808030;">(</span><span style="color: #400000;">waveOutOpen</span><span style="color: #808030;">(</span><span style="color: #808030;">&amp;</span>hWaveOut<span style="color: #808030;">,</span> WAVE_MAPPER<span style="color: #808030;">,</span> <span style="color: #808030;">&amp;</span>WaveFormatEx<span style="color: #808030;">,</span> <span style="color: #7d0045;">NULL</span><span style="color: #808030;">,</span> <span style="color: #7d0045;">NULL</span><span style="color: #808030;">,</span> CALLBACK_NULL<span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
ATLASSERT<span style="color: #808030;">(</span>hWaveOut<span style="color: #808030;">)</span><span style="color: #800080;">;</span>
WAVEHDR<span style="color: #808030;">*</span> pWaveHeader<span style="color: #800080;">;</span>
<span style="color: #603000;">HGLOBAL</span> hWaveHeader <span style="color: #808030;">=</span> <span style="color: #808030;">(</span>WAVEHDR<span style="color: #808030;">*</span><span style="color: #808030;">)</span> <span style="color: #400000;">GlobalAlloc</span><span style="color: #808030;">(</span>GMEM_MOVEABLE <span style="color: #808030;">|</span> GMEM_SHARE<span style="color: #808030;">,</span> <span style="color: #800000; font-weight: bold;">sizeof</span> <span style="color: #808030;">*</span>pWaveHeader <span style="color: #808030;">+</span> WaveFormatEx<span style="color: #808030;">.</span>nAvgBytesPerSec <span style="color: #808030;">*</span> <span style="color: #008c00;">10</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
pWaveHeader <span style="color: #808030;">=</span> <span style="color: #808030;">(</span>WAVEHDR<span style="color: #808030;">*</span><span style="color: #808030;">)</span> <span style="color: #400000;">GlobalLock</span><span style="color: #808030;">(</span>hWaveHeader<span style="color: #808030;">)</span><span style="color: #800080;">;</span>
ATLENSURE_THROW<span style="color: #808030;">(</span>pWaveHeader<span style="color: #808030;">,</span> E_OUTOFMEMORY<span style="color: #808030;">)</span><span style="color: #800080;">;</span>
pWaveHeader<span style="color: #808030;">-</span><span style="color: #808030;">&gt;</span>lpData <span style="color: #808030;">=</span> <span style="color: #808030;">(</span><span style="color: #603000;">LPSTR</span><span style="color: #808030;">)</span> <span style="color: #808030;">(</span><span style="color: #603000;">BYTE</span><span style="color: #808030;">*</span><span style="color: #808030;">)</span> <span style="color: #808030;">(</span>pWaveHeader <span style="color: #808030;">+</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
pWaveHeader<span style="color: #808030;">-</span><span style="color: #808030;">&gt;</span>dwBufferLength <span style="color: #808030;">=</span> WaveFormatEx<span style="color: #808030;">.</span>nAvgBytesPerSec <span style="color: #808030;">*</span> <span style="color: #008c00;">10</span><span style="color: #800080;">;</span>
<span style="color: #696969;">//pWaveHeader-&gt;dwUser = </span>
pWaveHeader<span style="color: #808030;">-</span><span style="color: #808030;">&gt;</span>dwFlags <span style="color: #808030;">=</span> <span style="color: #008c00;">0</span><span style="color: #800080;">;</span>
pWaveHeader<span style="color: #808030;">-</span><span style="color: #808030;">&gt;</span>dwLoops <span style="color: #808030;">=</span> <span style="color: #008c00;">0</span><span style="color: #800080;">;</span>
<span style="color: #004a43;">#</span><span style="color: #004a43; font-weight: bold;">pragma </span><span style="color: #bb7977; font-weight: bold;">region Generate Actual Data</span>
<span style="color: #800080;">{</span>
    <span style="color: #603000;">SHORT</span><span style="color: #808030;">*</span> pnData <span style="color: #808030;">=</span> <span style="color: #808030;">(</span><span style="color: #603000;">SHORT</span><span style="color: #808030;">*</span><span style="color: #808030;">)</span> pWaveHeader<span style="color: #808030;">-</span><span style="color: #808030;">&gt;</span>lpData<span style="color: #800080;">;</span>
    SIZE_T nDataCount <span style="color: #808030;">=</span> pWaveHeader<span style="color: #808030;">-</span><span style="color: #808030;">&gt;</span>dwBufferLength <span style="color: #808030;">/</span> <span style="color: #800000; font-weight: bold;">sizeof</span> <span style="color: #808030;">*</span>pnData<span style="color: #800080;">;</span>
    <span style="color: #800000; font-weight: bold;">for</span><span style="color: #808030;">(</span>SIZE_T nIndex <span style="color: #808030;">=</span> <span style="color: #008c00;">0</span><span style="color: #800080;">;</span> nIndex <span style="color: #808030;">&lt;</span> nDataCount<span style="color: #800080;">;</span> nIndex<span style="color: #808030;">+</span><span style="color: #808030;">+</span><span style="color: #808030;">)</span>
    pnData<span style="color: #808030;">[</span>nIndex<span style="color: #808030;">]</span> <span style="color: #808030;">=</span> <span style="color: #808030;">(</span><span style="color: #603000;">SHORT</span><span style="color: #808030;">)</span> <span style="color: #808030;">(</span><span style="color: #008c00;">32000</span> <span style="color: #808030;">*</span> <span style="color: #603000;">sin</span><span style="color: #808030;">(</span><span style="color: #008000;">1.0</span> <span style="color: #808030;">*</span> nIndex <span style="color: #808030;">/</span> WaveFormatEx<span style="color: #808030;">.</span>nSamplesPerSec <span style="color: #808030;">*</span> nFrequency <span style="color: #808030;">*</span> <span style="color: #008c00;">2</span> <span style="color: #808030;">*</span> M_PI<span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
<span style="color: #800080;">}</span>
<span style="color: #004a43;">#</span><span style="color: #004a43; font-weight: bold;">pragma </span><span style="color: #bb7977; font-weight: bold;">endregion </span>
Check<span style="color: #808030;">(</span>waveOutPrepareHeader<span style="color: #808030;">(</span>hWaveOut<span style="color: #808030;">,</span> pWaveHeader<span style="color: #808030;">,</span> <span style="color: #800000; font-weight: bold;">sizeof</span> <span style="color: #808030;">*</span>pWaveHeader<span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
Check<span style="color: #808030;">(</span>waveOutWrite<span style="color: #808030;">(</span>hWaveOut<span style="color: #808030;">,</span> pWaveHeader<span style="color: #808030;">,</span> <span style="color: #800000; font-weight: bold;">sizeof</span> <span style="color: #808030;">*</span>pWaveHeader<span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
<span style="color: #400000;">GlobalUnlock</span><span style="color: #808030;">(</span>hWaveHeader<span style="color: #808030;">)</span><span style="color: #800080;">;</span></pre>
<p>The operating system is supposed to mix the waves, which can be easily perceived taking place. It is possible to run the application with multiple waveforms within a process, e.g. &#8220;abc&#8221; command line parameter, and/or start multiple instances of the application.</p>
<p>A binary [<a href="http://www.alax.info/svn/public/trunk/Utilities/WaveOutMultiPlay/Release/WaveOutMultiPlay.exe">Win32</a>] and partial Visual C++ .NET 2010 <a href="http://www.alax.info/trac/public/browser/trunk/Utilities/WaveOutMultiPlay">source code</a> are available from SVN.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1291/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A tricky EVR bug was caught up: input pin may falsely report disconnected state</title>
		<link>http://alax.info/blog/1262</link>
		<comments>http://alax.info/blog/1262#comments</comments>
		<pubDate>Tue, 26 Jul 2011 17:13:38 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Seriously]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[evr]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1262</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1262" title="A tricky EVR bug was caught up: input pin may falsely report disconnected state"></a>Crime An application which builds a DirectShow graph unexpectedly started failing with VFW_E_NOT_CONNECTED (0&#215;80040209) error code. Scene The problem takes place during DirectShow graph building, yet in stopped state. Specific call which appeared to be giving out the error in &#8230;<p class="read-more"><a href="http://alax.info/blog/1262">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1262" title="A tricky EVR bug was caught up: input pin may falsely report disconnected state"></a><h4>Crime</h4>
<p>An application which builds a DirectShow graph unexpectedly started failing with VFW_E_NOT_CONNECTED (0&#215;80040209) error code.</p>
<h4>Scene</h4>
<p>The problem takes place during DirectShow graph building, yet in stopped state. Specific call which appeared to be giving out the error in first place appears to be EVR input pin&#8217;s <a href="http://connect.microsoft.com/VisualStudio/feedback/details/680766/enhanced-video-renderer-is-incorrectly-reporting-vfw-e-not-connected-0x80040209-for-a-connected-pin">IPin::ConnectionMediaType</a>, and the problem is also specific to <a href="http://msdn.microsoft.com/en-us/library/ms694916%28VS.85%29.aspx">Enhanced video Renderer</a> (Windows 7, but not necessarily only this version).</p>
<h4>Investigation</h4>
<p>The problem does not appear to be persistent. On the contrary, it is taking place for just a few milliseconds after pin connection. After the problem is gone, it does not seem to ever come up again unless the filter graph is built again from the beginning.</p>
<p>EVR pin connection is always reporting success, so the following error code stating <a href="http://msdn.microsoft.com/en-us/library/ms919477.aspx">VFW_E_NOT_CONNECTED</a> &#8220;The operation cannot be performed because the pins are not connected.&#8221; goes against documented behavior, and is thus a bug.</p>
<p>Depending on time between pin connection and media type polling, the call can reach EVR:</p>
<ul>
<li>before it starts showing the problem &#8211; stage A</li>
<li>at the time the call fails &#8211; stage B</li>
<li>after the failure time interval, when the call is successful from then on &#8211; stage C</li>
</ul>
<p>Thus, the problem is limited to specific use cases:</p>
<ul>
<li>the application should care about media type on EVR input</li>
<li>unexpected failure takes place when the call reaches in stage B</li>
<li>also found: the clipping window for the EVR has to belong to a non-primary monitor</li>
</ul>
<p>If an application keep polling for media type in a loop, the result may be about the following:</p>
<pre style="color: #000000; background: #ffffff;"><span style="color: #603000;">UINT</span> nStageA <span style="color: #808030;">=</span> <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> nStageB <span style="color: #808030;">=</span> <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> nStageC <span style="color: #808030;">=</span> <span style="color: #008c00;">0</span><span style="color: #800080;">;</span>
<span style="color: #696969;">// [...]</span>
<span style="color: #800000; font-weight: bold;">for</span><span style="color: #808030;">(</span><span style="color: #800080;">;</span> <span style="color: #800080;">;</span> <span style="color: #808030;">)</span>
<span style="color: #800080;">{</span>
    AM_MEDIA_TYPE MediaType<span style="color: #800080;">;</span>
    <span style="color: #400000;">ZeroMemory</span><span style="color: #808030;">(</span><span style="color: #808030;">&amp;</span>MediaType<span style="color: #808030;">,</span> <span style="color: #800000; font-weight: bold;">sizeof</span> MediaType<span style="color: #808030;">)</span><span style="color: #800080;">;</span>
    <span style="color: #800000; font-weight: bold;">const</span> HRESULT nConnectionMediaTypeResult <span style="color: #808030;">=</span> pInputPin<span style="color: #808030;">-</span><span style="color: #808030;">&gt;</span>ConnectionMediaType<span style="color: #808030;">(</span><span style="color: #808030;">&amp;</span>MediaType<span style="color: #808030;">)</span><span style="color: #800080;">;</span>
    <span style="color: #800000; font-weight: bold;">if</span><span style="color: #808030;">(</span>SUCCEEDED<span style="color: #808030;">(</span>nConnectionMediaTypeResult<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>nStageB<span style="color: #808030;">)</span>
        <span style="color: #800080;">{</span>
            nStageC<span style="color: #808030;">+</span><span style="color: #808030;">+</span><span style="color: #800080;">;</span>
            <span style="color: #800000; font-weight: bold;">break</span><span style="color: #800080;">;</span>
        <span style="color: #800080;">}</span> <span style="color: #800000; font-weight: bold;">else</span>
            nStageA<span style="color: #808030;">+</span><span style="color: #808030;">+</span><span style="color: #800080;">;</span>
    <span style="color: #800080;">}</span> <span style="color: #800000; font-weight: bold;">else</span>
    <span style="color: #800080;">{</span>
        ATLASSERT<span style="color: #808030;">(</span>nConnectionMediaTypeResult <span style="color: #808030;">=</span><span style="color: #808030;">=</span> VFW_E_NOT_CONNECTED<span style="color: #808030;">)</span><span style="color: #800080;">;</span>
        nStageB<span style="color: #808030;">+</span><span style="color: #808030;">+</span><span style="color: #800080;">;</span>
    <span style="color: #800080;">}</span>
    CoTaskMemFree<span style="color: #808030;">(</span>MediaType<span style="color: #808030;">.</span>pbFormat<span style="color: #808030;">)</span><span style="color: #800080;">;</span>
<span style="color: #800080;">}</span>
<span style="color: #696969;">// [...]</span>
<span style="color: #603000;">CString</span> sMessage<span style="color: #800080;">;</span>
sMessage<span style="color: #808030;">.</span>Format<span style="color: #808030;">(</span>_T<span style="color: #808030;">(</span><span style="color: #800000;">"</span><span style="color: #0000e6;">Bingo!</span><span style="color: #0f69ff;">\r</span><span style="color: #0f69ff;">\n</span><span style="color: #0f69ff;">\r</span><span style="color: #0f69ff;">\n</span><span style="color: #800000;">"</span><span style="color: #808030;">)</span> _T<span style="color: #808030;">(</span><span style="color: #800000;">"</span><span style="color: #0000e6;">nStageA </span><span style="color: #0f69ff;">%d</span><span style="color: #0000e6;">, nStageB </span><span style="color: #0f69ff;">%d</span><span style="color: #0000e6;"> - 0x</span><span style="color: #0f69ff;">%08x</span><span style="color: #0000e6;">, nStageC </span><span style="color: #0f69ff;">%d</span><span style="color: #0f69ff;">\n</span><span style="color: #800000;">"</span><span style="color: #808030;">)</span><span style="color: #808030;">,</span> nStageA<span style="color: #808030;">,</span> nStageB<span style="color: #808030;">,</span> nResult<span style="color: #808030;">,</span> nStageC<span style="color: #808030;">)</span><span style="color: #800080;">;</span>
AtlMessageBox<span style="color: #808030;">(</span>m_hWnd<span style="color: #808030;">,</span> <span style="color: #808030;">(</span><span style="color: #603000;">LPCTSTR</span><span style="color: #808030;">)</span> sMessage<span style="color: #808030;">,</span> _T<span style="color: #808030;">(</span><span style="color: #800000;">"</span><span style="color: #0000e6;">Result</span><span style="color: #800000;">"</span><span style="color: #808030;">)</span><span style="color: #808030;">,</span> MB_ICONERROR<span style="color: #808030;">)</span><span style="color: #800080;">;</span></pre>
<p><img class="alignnone size-full wp-image-1263" title="EVR Input Pin IPin::ConnectedMediaType Stages" src="http://alax.info/blog/wp-content/uploads/2011/07/Image0034.png" alt="" width="384" height="184" /></p>
<h5>Workaround</h5>
<p>An obvious straightforward workaround is to follow EVR connection with a wait for Stage B to pass, or timeout &#8211; whichever takes place first.</p>
<p>Also, <a href="http://connect.microsoft.com/VisualStudio/feedback/details/680766/enhanced-video-renderer-is-incorrectly-reporting-vfw-e-not-connected-0x80040209-for-a-connected-pin">vote for the bug on Microsoft Connect</a>.</p>
<h5>More Details</h5>
<p>Video renderer filter are notorious for re-agreeing media type and being fretful as for memory allocators and media types (for a good reason though!). So it makes sense to suggest that the problem takes place when the filter is doing something related, such as it starts background activity immediately after connection in order to discover upstream peer capabilities.</p>
<p>In order to possibly get details on this, it is possible to raise an exception as soon as Stage B is detected and take a look at thread states using a debugger. Indeed, on of the background threads is engaged in EVR reconnection activity:</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2011/07/Image0023.png"><img class="alignnone size-large wp-image-1264" title="EVR Background Thread State" src="http://alax.info/blog/wp-content/uploads/2011/07/Image0023-800x429.png" alt="" width="620" height="332" /></a></p>
<p>Yes it does the reconnection, but nevertheless it is expected to do the things undercover and transparently, it still allows a failure on the outer API.</p>
<pre>     evr.dll!GetSourceRectFromMediaType() + 0x37 bytes    
     evr.dll!CEVRInputPin::CheckMediaType() + 0x81 bytes    
     evr.dll!CBasePin::ReceiveConnection() + 0x61 bytes    
     evr.dll!CEVRInputPin::ReceiveConnection() + 0x1fc2d bytes    
     quartz.dll!CBasePin::AttemptConnection() - 0x21 bytes    
     quartz.dll!CBasePin::TryMediaTypes() + 0x60 bytes    
     quartz.dll!CBasePin::AgreeMediaType() + 0x54 bytes    
     quartz.dll!CBasePin::Connect() + 0x46 bytes    
     quartz.dll!CFilterGraph::ConnectDirectInternal() + 0x83 bytes    
     quartz.dll!CFilterGraph::ConnectRecursively() + 0x2c bytes    
     quartz.dll!CFilterGraph::ConnectInternal() + 0xde bytes    
     quartz.dll!CFilterGraph::Connect() + 0x17 bytes    
     quartz.dll!CFGControl::WorkerDisplayChanged() + 0xf1 bytes    
     quartz.dll!CFGControl::CGraphWindow::OnReceiveMessage() + 0x2e2a bytes    
&gt;    quartz.dll!WndProc() + 0x3e bytes    
     user32.dll!_InternalCallWinProc@20() + 0x23 bytes    
     user32.dll!_UserCallWinProcCheckWow@32() + 0xb7 bytes    
     user32.dll!_DispatchMessageWorker@8() + 0xed bytes    
     user32.dll!_DispatchMessageW@4() + 0xf bytes    
     quartz.dll!ObjectThread() + 0x65 bytes</pre>
<p>A test Visual C++ .NET 2010 application <a href="http://www.assembla.com/code/roatl-utilities/subversion/nodes/trunk/EvrInputPinConnectionBug">is available from SVN</a>. The code requires a media file, and refers to <em>352&#215;288 I420.avi</em>, which is included into ZIP file attached to <a href="http://connect.microsoft.com/VisualStudio/feedback/details/680766/enhanced-video-renderer-is-incorrectly-reporting-vfw-e-not-connected-0x80040209-for-a-connected-pin#details">MS Connect Feedback</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1262/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IP Video Source: Pure JPEG URLs and Software Version</title>
		<link>http://alax.info/blog/1227</link>
		<comments>http://alax.info/blog/1227#comments</comments>
		<pubDate>Tue, 07 Jun 2011 19:02:47 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[capture]]></category>
		<category><![CDATA[device]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[dshow]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[JPEG]]></category>
		<category><![CDATA[M-JPEG]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1227</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1227" title="IP Video Source: Pure JPEG URLs and Software Version"></a>This does not update the software with new features, but there are a few simple things worth mentioning explicitly. The first is that virtual DirectShow camera device can be set up with both M-JPEG and JPEG URLs. That is, IP &#8230;<p class="read-more"><a href="http://alax.info/blog/1227">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1227" title="IP Video Source: Pure JPEG URLs and Software Version"></a><p>This does not update the software with new features, but there are a few simple things worth mentioning explicitly.</p>
<p>The first is that virtual DirectShow camera device can be set up with both M-JPEG and JPEG URLs. That is, IP cameras which do not implement M-JPEG, or implement it in a buggy way (there is a *huge* deal of such out there) can still be set up to send video as individual video frames/images as long as they implement JPEG snapshots. This is taking place often at a lower frame rate, but still works.</p>
<p>The driver will automatically detect type of URL (by response from the device) and will choose best access method for the given URL.</p>
<p>Second is that if you are looking for IP Video Source software version, such as to check against available updates, it is here on the UI (right click the caption):</p>
<p><img class="alignnone size-full wp-image-1228" title="About on System Menu" src="http://alax.info/blog/wp-content/uploads/2011/06/Image004.png" alt="" width="563" height="430" /></p>
<p><img class="alignnone size-full wp-image-1229" title="About and Version" src="http://alax.info/blog/wp-content/uploads/2011/06/Image005.png" alt="" width="436" height="294" /></p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1227/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>IP Video Source: 64-bit version, resolution flexibility, Adobe FMLE</title>
		<link>http://alax.info/blog/1223</link>
		<comments>http://alax.info/blog/1223#comments</comments>
		<pubDate>Sun, 05 Jun 2011 17:42:10 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[capture]]></category>
		<category><![CDATA[device]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[dshow]]></category>
		<category><![CDATA[ecnoder]]></category>
		<category><![CDATA[encoder]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[FMLE]]></category>
		<category><![CDATA[google talk]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[JPEG]]></category>
		<category><![CDATA[M-JPEG]]></category>
		<category><![CDATA[skype]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1223</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1223" title="IP Video Source: 64-bit version, resolution flexibility, Adobe FMLE"></a>The IP Video Source update provides several improvements to the driver: copy/paste feature to backup, restore, or synchronize installed devices between 32-bit and 64-bit versions 64-bit version and .MSI dynamic video resizing (via Video Resizer DSP) Adobe FMLE compatibility Updates &#8230;<p class="read-more"><a href="http://alax.info/blog/1223">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1223" title="IP Video Source: 64-bit version, resolution flexibility, Adobe FMLE"></a><p>The <a href="http://alax.info/blog/1216">IP Video Source</a> update provides several improvements to the driver:</p>
<ul>
<li>copy/paste feature to backup, restore, or synchronize installed devices between 32-bit and 64-bit versions</li>
<li>64-bit version and .MSI</li>
<li>dynamic video resizing (via <a href="http://msdn.microsoft.com/en-us/library/ff819491%28VS.85%29.aspx">Video Resizer DSP</a>)</li>
<li>Adobe FMLE compatibility</li>
</ul>
<p>Updates in greater detail follow.</p>
<h4>Device Copy/Paste Feature</h4>
<p>The video device management window is providing Copy and Paste buttons, which let user transfer device information, including name and settings, through clipboard for various purposes:</p>
<ul>
<li>save data in order to be able to restore devices later</li>
<li>restore devices from saved list, or re-create from a list saved on another machine</li>
<li>duplicate a device</li>
<li>synchronize devices between 32-bit and 64-bit versions</li>
</ul>
<p>The device data is a text, one line per device, lines in comma-separated values (<a href="http://en.wikipedia.org/wiki/Comma-separated_values">CSV</a>) format.</p>
<p><img class="alignnone size-full wp-image-1224" title="Manage Video Devices" src="http://alax.info/blog/wp-content/uploads/2011/06/Image001.png" alt="" width="565" height="432" /></p>
<p><span id="more-1223"></span></p>
<h4>64-Bit Version</h4>
<p>Software is available in both 32-bit and 64-bit versions. While most of multimedia software is still 32-bit, sometimes 64-bit version is really helpful to, for example:</p>
<ul>
<li> interface to &#8220;Any CPU&#8221; .NET code which executes in 64-bit on a 64-bit operating system</li>
<li>go beyond 32-bit code boundaries, especially in part of multiple devices and virtual address space limit</li>
</ul>
<p>64-bit version duplicates functionality available in 32-bit version, though 32- and 64-bit modules run in completely separated environments.</p>
<p><img class="alignnone size-full wp-image-1225" title="Start Menu - Video Type-In" src="http://alax.info/blog/wp-content/uploads/2011/06/Image002.png" alt="" width="420" height="451" /></p>
<h4>Dynamic Video Resizing</h4>
<p>The source DirectShow filter is capable of connecting with media types different from original/camera media type in resolution part for decompressed video. The filter is internally taking advantage of <a href="http://msdn.microsoft.com/en-us/library/ff819491%28VS.85%29.aspx">Video Resizer DSP</a>, and resizes decompressed video to format of interest.</p>
<p>As Video Resizer DSP is available starting with Windows Vista, the functionality availability is subject to the same conditions.</p>
<p>The feature is absolutely required for Adobe Flash Media Live Encoder software, as it make certain assumptions as for supported resolutions, and completely ignores the information the filter makes available in standard way.</p>
<h4>Adobe Flash Media Live Encoder Friendliness</h4>
<p>The update make the device much closer to interoperation with Adobe product. The software works around a handful of bugs, including as ridiculous as neglecting to provide correct BI_RGB value in BITMAPINFOHEADER::biCompression structure, yet researchers are still to resolve the remained ones.</p>
<p>FMLE would start perfect and stream video being run under debugger, otherwise in a regular run chances are that Adobe application would internally respond with E_UNEXPECTED failure for unknown reason, stop any encoding without giving a single little notice on the GUI.</p>
<p>After all, the encoding runs perfectly through web based encoder, and the driver is providing a good way to stream to video distribution sites such as <a href="http://ustream.tv">http://ustream.tv</a>, <a href="http://livestream.com">http://livestream.com</a> from an IP camera or video encoder.</p>
<p><img class="alignnone size-large wp-image-1226" title="Adobe FMLE 3.2" src="http://alax.info/blog/wp-content/uploads/2011/06/Image003-800x600.png" alt="" width="620" height="465" /></p>
<h4>Download Information</h4>
<ul>
<li>Download (32-bit): <a href="../../blog-dist/AlaxInfoIpVideoSourceSetup.msi">AlaxInfoIpVideoSourceSetup.msi</a></li>
<li>Download (64-bit): <a href="http://alax.info/blog-dist/AlaxInfoIpVideoSourceSetup-x64.msi">AlaxInfoIpVideoSourceSetup-x64.msi</a></li>
<li>License: This software is free to use</li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1223/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>DirectShow Video Source Filter for JPEG and M-JPEG IP Cameras</title>
		<link>http://alax.info/blog/1216</link>
		<comments>http://alax.info/blog/1216#comments</comments>
		<pubDate>Sun, 22 May 2011 22:07:03 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[capture]]></category>
		<category><![CDATA[device]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[dshow]]></category>
		<category><![CDATA[ecnoder]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[google talk]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[JPEG]]></category>
		<category><![CDATA[M-JPEG]]></category>
		<category><![CDATA[skype]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1216</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1216" title="DirectShow Video Source Filter for JPEG and M-JPEG IP Cameras"></a>This implements a DirectShow driver/wrapper over a HTTP based JPEG/M-JPEG streamed video, widely available with IP cameras. Once installed, it provides a Start Menu shortcut to manage video capture devices, where a user can add/remove devices. The devices are automatically &#8230;<p class="read-more"><a href="http://alax.info/blog/1216">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1216" title="DirectShow Video Source Filter for JPEG and M-JPEG IP Cameras"></a><p>This implements a <a href="http://msdn.microsoft.com/en-us/library/dd375454%28VS.85%29.aspx">DirectShow</a> driver/wrapper over a HTTP based JPEG/<a href="http://en.wikipedia.org/wiki/Motion_JPEG#IP_Cameras">M-JPEG</a> streamed video, widely available with IP cameras. Once installed, it provides a Start Menu shortcut to manage video capture devices, where a user can add/remove devices. The devices are automatically registered with DriectShow and are available to applications.</p>
<p><img class="alignnone size-full wp-image-1217" title="Start Menu Shortcut" src="http://alax.info/blog/wp-content/uploads/2011/05/Image0011.png" alt="" width="451" height="482" /> <img class="alignnone size-full wp-image-1218" title="Manage Video Devices" src="http://alax.info/blog/wp-content/uploads/2011/05/Image0021.png" alt="" width="377" height="432" /></p>
<p>The compatibility list includes:</p>
<ul>
<li>Windows SDK <a href="http://msdn.microsoft.com/en-us/library/dd373424%28VS.85%29.aspx">AmCap</a> Sample (reference)</li>
<li><a href="http://msdn.microsoft.com/en-us/library/dd390950%28VS.85%29.aspx">VideoLan VLC</a></li>
<li><a href="http://www.skype.com/">Skype</a> (see below)</li>
<li><a href="http://www.google.com/talk/">Google Talk Video Chat</a></li>
<li><a href="http://luxriot.com">Luxriot</a> (as rather an example as Luxriot has its own generic JPEG/M-JPEG device driver, however this still demonstrates compatibility and interoperability of applications)</li>
<li><a href="http://msdn.microsoft.com/en-us/library/dd390950%28VS.85%29.aspx">GraphEdit</a>, GraphStudio and similar tools</li>
</ul>
<p><span id="more-1216"></span></p>
<p>For a created device it is required to configure:</p>
<ol>
<li>JPEG or M-JPEG resource URL on the device, where the driver will access video feed or sequential snapshots</li>
<li>Image/video size on the device</li>
</ol>
<p><img class="alignnone size-full wp-image-1219" title="Device Property Sheet - General Property Page" src="http://alax.info/blog/wp-content/uploads/2011/05/Image0032.png" alt="" width="377" height="432" /></p>
<p>Resource URLs vary from device to device and there is no standard identifier. This has to be looked up for specific model in device API reference or SDK. For JPEG snapshots it is possible to copy image shortcut from web browser and paste address into device settings.</p>
<p>Note that some devices, especially low end IP cameras deliver non-compliant feed which can be decoded either by manufacturer&#8217;s ActiveX control or model-specific implementation which this driver does not convert and is unlikely to ever cover. The driver will only work with hardware which honors industry standards.</p>
<p>For example, <a href="http://www.stardot.com/products/cameras">Stardot NetCam SC</a> cameras make the video feed accessible using /nph-mjpeg.cgi resource, so the full URL will consist of protocol prefix &#8220;http://&#8221;, optional username and password (see screenshot above), IP address or host name e.g. &#8220;demo2.stardotcams.com&#8221;, resource identifier on the device &#8220;/nph-mjpeg.cgi&#8221;.</p>
<p>Hence, http://demo2.stardotcams.com/nph-mjpeg.cgi</p>
<p>It is necessary to provide video size of the footage in advance so that the driver could negotiate content media types without accessing the device. Future versions of the driver might implement auto-detection.</p>
<h4>Skype Compatibility</h4>
<p>To make the device work with Skype, it is necessary to:</p>
<ol>
<li>Configure the device (using its web interface) to work at resolution 640&#215;480</li>
<li>Add/configure device with Alax.Info IP video Source as described above, including setting of 640 by 480 pixel resolution in device configuration</li>
</ol>
<p><img class="alignnone size-full wp-image-1220" title="Skype Video Device" src="http://alax.info/blog/wp-content/uploads/2011/05/Image0042.png" alt="" width="716" height="612" /></p>
<h4>Internals</h4>
<p>Software implements and registers video input/capture devices, listed under <a href="http://msdn.microsoft.com/en-us/library/ms783347%28VS.85%29.aspx">DirectShow CLSID_VideoInputDeviceCategory</a> category. The applications access devices from the list and treat as a regular device such as web camera.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/dd373424%28VS.85%29.aspx">Windows SDK AmCap sample</a> will create the following DirectShow graph where the source filter implemented by this software:</p>
<p><img class="alignnone size-full wp-image-1221" title="Outer DirectShow Fitler Graph" src="http://alax.info/blog/wp-content/uploads/2011/05/Image006.png" alt="" width="615" height="295" /></p>
<p>Internally, software creates a worker filter graph in order to stream data from the device:</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2011/05/Image0051.png"><img class="alignnone size-large wp-image-1222" title="Inner DirectShow Fitler Graph" src="http://alax.info/blog/wp-content/uploads/2011/05/Image0051-800x294.png" alt="" width="620" height="227" /></a></p>
<p>To decode video, software uses stock <a href="http://msdn.microsoft.com/en-us/library/dd390691%28VS.85%29.aspx">MJPEG Decompressor Filter</a> provided with operating system.</p>
<h4>Download Information</h4>
<ul>
<li>Download (32-bit): <a href="http://alax.info/blog-dist/AlaxInfoIpVideoSourceSetup.msi">AlaxInfoIpVideoSourceSetup.msi</a></li>
<li>Download (64-bit): <a href="http://alax.info/blog-dist/AlaxInfoIpVideoSourceSetup-x64.msi">AlaxInfoIpVideoSourceSetup.msi-x64</a></li>
<li>License: This software is free to use</li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1216/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Utility Clearance: Enumerate VCM Codecs</title>
		<link>http://alax.info/blog/1194</link>
		<comments>http://alax.info/blog/1194#comments</comments>
		<pubDate>Mon, 25 Apr 2011 15:23:16 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[codec]]></category>
		<category><![CDATA[icm]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[utility]]></category>
		<category><![CDATA[vcm]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1194</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1194" title="Utility Clearance: Enumerate VCM Codecs"></a>EnumerateVcmCodecs uses ICOpen API to enuerate available codecs and prints out information obtained from enumeration. 32-bit and 64-bit versions respectively enumerate codecs available for the platform (lists may vary because the codecs are actually provided by different DLLs, built for &#8230;<p class="read-more"><a href="http://alax.info/blog/1194">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1194" title="Utility Clearance: Enumerate VCM Codecs"></a><p>EnumerateVcmCodecs uses <a href="http://msdn.microsoft.com/en-us/library/dd756960%28VS.85%29.aspx">ICOpen</a> API to enuerate available codecs and prints out information obtained from enumeration. 32-bit and 64-bit versions respectively enumerate codecs available for the platform (lists may vary because the codecs are actually provided by different DLLs, built for respective platform).</p>
<pre>szName
  fccType: 0x63646976 (vidc), fccHandler 0x64697663 (cvid)
  dwFlags 0
  dwVersion 0x0, dwVersionICM 0x104
  szDescription ""
  szDriver "iccvid.dll"
szName
  fccType: 0x63646976 (vidc), fccHandler 0x30323469 (i420)
  dwFlags 0
  dwVersion 0x0, dwVersionICM 0x104
  szDescription ""
  szDriver "msh263.drv"
...</pre>
<p>A binary [<a href="http://trac2.assembla.com/roatl-utilities/browser/trunk/EnumerateVcmCodecs/_Bin/Win32/Release/EnumerateVcmCodecs.exe?format=raw">Win32</a>, <a href="http://trac2.assembla.com/roatl-utilities/browser/trunk/EnumerateVcmCodecs/_Bin/x64/Release/EnumerateVcmCodecs.exe?format=raw">x64</a>] and Visual C++ .NET 2010 source code <a href="http://trac2.assembla.com/roatl-utilities/browser/trunk/EnumerateVcmCodecs">are  available from SVN</a>.</p>
<p>See also:</p>
<ul>
<li><a href="http://social.msdn.microsoft.com/Forums/en-US/windowsdirectshowdevelopment/thread/d9029891-25e5-4ed1-ab31-9cae7c6c8eae">related topic on MSDN Forums</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1194/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Utility Clearance: Rasterize Font</title>
		<link>http://alax.info/blog/1192</link>
		<comments>http://alax.info/blog/1192#comments</comments>
		<pubDate>Sun, 24 Apr 2011 17:05:32 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[ATL]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[character]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[rasterize]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[ttf]]></category>
		<category><![CDATA[utility]]></category>
		<category><![CDATA[WTL]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1192</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1192" title="Utility Clearance: Rasterize Font"></a>RasterizeFont utility takes a font on the input (such as Windows .TTF &#8211; True-Type Font) and paints individual characters into bitmaps. Utility output includes separate bitmap (.BMP) files for requested characters and C++ source code of the bimap arrays (this &#8230;<p class="read-more"><a href="http://alax.info/blog/1192">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1192" title="Utility Clearance: Rasterize Font"></a><p><img class="size-full wp-image-1193 alignleft" title="RasterizeFont Output" src="http://alax.info/blog/wp-content/uploads/2011/04/Character-005a.png" alt="" width="48" height="72" /> RasterizeFont utility takes a font on the input (such as Windows .TTF &#8211; <a href="http://en.wikipedia.org/wiki/TrueType">True-Type Font</a>) and paints individual characters into bitmaps. Utility output includes separate bitmap (.BMP) files for requested characters and C++ source code of the bimap arrays (this was included into microcontroller project).</p>
<p>A configuration .INI file defines rasterizer parameters:</p>
<pre>[General]
Width=48
Height=72
Horizontal Adjustment=1
Vertical Adjustment=0
Outline=1

[Font]
Face=Times New Roman
Height=48
Weight=1024

[Bitmaps]
PathTemplate=Character-%04x.bmp</pre>
<p>And a list of characters of interest is passed as a command line argument.</p>
<pre style="color: #000000; background: #ffffff;"><span style="color: #800000; font-weight: bold;">const</span> <span style="color: #603000;">BYTE</span> pnCharacter007a<span style="color: #808030;">[</span><span style="color: #808030;">]</span> <span style="color: #808030;">=</span> <span style="color: #696969;">// 0x007a z</span>
<span style="color: #800080;">{</span>
    <span style="color: #008000;">0x55</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x55</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x55</span><span style="color: #808030;">,</span>  <span style="color: #696969;">// 01 01 01 01 01 01 01 01 01 01 01 01 </span>
    <span style="color: #008000;">0x55</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x55</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x55</span><span style="color: #808030;">,</span>  <span style="color: #696969;">// 01 01 01 01 01 01 01 01 01 01 01 01 </span>
    <span style="color: #008000;">0x55</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x55</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x55</span><span style="color: #808030;">,</span>  <span style="color: #696969;">// 01 01 01 01 01 01 01 01 01 01 01 01 </span>
    <span style="color: #008000;">0x54</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x00</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x05</span><span style="color: #808030;">,</span>  <span style="color: #696969;">// 01 01 01 00 00 00 00 00 00 00 01 01 </span>
    <span style="color: #008000;">0x52</span><span style="color: #808030;">,</span> <span style="color: #008000;">0xaa</span><span style="color: #808030;">,</span> <span style="color: #008000;">0xa1</span><span style="color: #808030;">,</span>  <span style="color: #696969;">// 01 01 00 10 10 10 10 10 10 10 00 01 </span>
    <span style="color: #008000;">0x52</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x00</span><span style="color: #808030;">,</span> <span style="color: #008000;">0xa1</span><span style="color: #808030;">,</span>  <span style="color: #696969;">// 01 01 00 10 00 00 00 00 10 10 00 01 </span>
    <span style="color: #008000;">0x54</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x42</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x85</span><span style="color: #808030;">,</span>  <span style="color: #696969;">// 01 01 01 00 01 00 00 10 10 00 01 01 </span>
    <span style="color: #008000;">0x55</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x2a</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x15</span><span style="color: #808030;">,</span>  <span style="color: #696969;">// 01 01 01 01 00 10 10 10 00 01 01 01 </span>
    <span style="color: #008000;">0x54</span><span style="color: #808030;">,</span> <span style="color: #008000;">0xa0</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x45</span><span style="color: #808030;">,</span>  <span style="color: #696969;">// 01 01 01 00 10 10 00 00 01 00 01 01 </span>
    <span style="color: #008000;">0x52</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x80</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x21</span><span style="color: #808030;">,</span>  <span style="color: #696969;">// 01 01 00 10 10 00 00 00 00 10 00 01 </span>
    <span style="color: #008000;">0x52</span><span style="color: #808030;">,</span> <span style="color: #008000;">0xaa</span><span style="color: #808030;">,</span> <span style="color: #008000;">0xa1</span><span style="color: #808030;">,</span>  <span style="color: #696969;">// 01 01 00 10 10 10 10 10 10 10 00 01 </span>
    <span style="color: #008000;">0x54</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x00</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x05</span><span style="color: #808030;">,</span>  <span style="color: #696969;">// 01 01 01 00 00 00 00 00 00 00 01 01 </span>
    <span style="color: #008000;">0x55</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x55</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x55</span><span style="color: #808030;">,</span>  <span style="color: #696969;">// 01 01 01 01 01 01 01 01 01 01 01 01 </span>
    <span style="color: #008000;">0x55</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x55</span><span style="color: #808030;">,</span> <span style="color: #008000;">0x55</span><span style="color: #808030;">,</span>  <span style="color: #696969;">// 01 01 01 01 01 01 01 01 01 01 01 01 </span>
<span style="color: #800080;">}</span><span style="color: #800080;">;</span></pre>
<p>A binary [<a href="http://trac2.assembla.com/roatl-utilities/browser/trunk/RasterizeFont/_Bin/Win32/Release/RasterizeFont.exe?format=raw">Win32</a>] and Visual C++ .NET 2008 source code <a href="http://trac2.assembla.com/roatl-utilities/browser/trunk/RasterizeFont">are  available from SVN</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1192/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Utility Clearance: Export AVI Resources</title>
		<link>http://alax.info/blog/1190</link>
		<comments>http://alax.info/blog/1190#comments</comments>
		<pubDate>Sun, 24 Apr 2011 16:10:58 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[ATL]]></category>
		<category><![CDATA[AVI]]></category>
		<category><![CDATA[GUI]]></category>
		<category><![CDATA[resource]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[utility]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1190</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1190" title="Utility Clearance: Export AVI Resources"></a>ExportAviResources walks through AVI video clips attached as resources to a binary file and exports them into separate files. Such clips can be used with Animation Controls for GUI animations. You might want to run the utility against SYSTEM32/SYSWOW64 folders &#8230;<p class="read-more"><a href="http://alax.info/blog/1190">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1190" title="Utility Clearance: Export AVI Resources"></a><p>ExportAviResources walks through AVI video clips attached as resources to a binary file and exports them into separate files.</p>
<p>Such clips can be used with <a href="http://msdn.microsoft.com/en-us/library/bb761881%28VS.85%29.aspx">Animation Controls</a> for GUI animations. You might want to run the utility against SYSTEM32/SYSWOW64 folders to see if any of stock animations are good for you:</p>
<pre>D:\&gt;for %i in (C:\Windows\system32\*.dll) do "..\Utilities\ExportAviResources\x64\Release\ExportAviResources.exe" "%i"</pre>
<p>A binary [<a href="http://trac2.assembla.com/roatl-utilities/browser/trunk/ExportAviResources/_Bin/Win32/Release/ExportAviResources.exe?format=raw">Win32</a>, <a href="http://trac2.assembla.com/roatl-utilities/browser/trunk/ExportAviResources/_Bin/x64/Release/ExportAviResources.exe?format=raw">x64</a>] and Visual C++ .NET 2010 source code <a href="http://trac2.assembla.com/roatl-utilities/browser/trunk/ExportAviResources">are  available from SVN</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1190/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Utility Clearance: Logical Processor Information</title>
		<link>http://alax.info/blog/1188</link>
		<comments>http://alax.info/blog/1188#comments</comments>
		<pubDate>Sun, 24 Apr 2011 15:45:16 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[ATL]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[cpu]]></category>
		<category><![CDATA[GetLogicalProcessorInformation]]></category>
		<category><![CDATA[msdn]]></category>
		<category><![CDATA[processor]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[WTL]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1188</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1188" title="Utility Clearance: Logical Processor Information"></a>LogicalProcessorInformation is a fronend GUI around GetLogicalProcessorInformation API and reveals CPU configuration of the system. If you are fine tuning stuff, you might want to know what sort of CPUs are powering the applications: how many? fully featured cores or &#8230;<p class="read-more"><a href="http://alax.info/blog/1188">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1188" title="Utility Clearance: Logical Processor Information"></a><p>LogicalProcessorInformation is a fronend GUI around <a href="http://msdn.microsoft.com/en-us/library/ms683194%28VS.85%29.aspx">GetLogicalProcessorInformation</a> API and reveals CPU configuration of the system. If you are fine tuning stuff, you might want to know what sort of CPUs are powering the applications:</p>
<ul>
<li>how many?</li>
<li>fully featured cores or <a href="http://www.intel.com/info/hyperthreading/">HyperThreading</a> technology?</li>
<li>mutli-processor configuration and how exactly physical processors are distributed over affinity mask</li>
</ul>
<p><img class="alignnone size-full wp-image-1189" title="Logical Processor Information" src="http://alax.info/blog/wp-content/uploads/2011/04/Image001.png" alt="" width="520" height="396" /></p>
<p>API and the application gets you the data as a user-friendly dump of GetLogicalProcessorInformation output and a summary of records at the bottom:</p>
<p><span id="more-1188"></span></p>
<pre>Logical Processors:

Mask: 0x00000003
Relationship: RelationProcessorCore (0x0)
ProcessorCore.Flags: 0x01

Mask: 0x00000003
Relationship: RelationCache (0x2)
Cache.Level: 1
Cache.Associativity: 8
Cache.LineSize: 64 (0x40)
Cache.Size: 32768 (0x8000)
Cache.Type: CacheData (0x2)

Mask: 0x00000003
Relationship: RelationCache (0x2)
Cache.Level: 1
Cache.Associativity: 4
Cache.LineSize: 64 (0x40)
Cache.Size: 32768 (0x8000)
Cache.Type: CacheInstruction (0x1)

Mask: 0x00000003
Relationship: RelationCache (0x2)
Cache.Level: 2
Cache.Associativity: 8
Cache.LineSize: 64 (0x40)
Cache.Size: 262144 (0x40000)
Cache.Type: CacheUnified (0x0)

Mask: 0x0000000c
Relationship: RelationProcessorCore (0x0)
ProcessorCore.Flags: 0x01

...

Mask: 0x000000ff
Relationship: RelationProcessorPackage (0x3)

...

Mask: 0x000000ff
Relationship: RelationNumaNode (0x1)
NumaNode.NodeNumber: 0x0

Record Count per Relationship:
 RelationProcessorCore (0x0): 4
 RelationNumaNode (0x1): 1
 RelationCache (0x2): 13
 RelationProcessorPackage (0x3): 1
 RelationGroup (0x4): 0</pre>
<p>A binary [<a href="http://trac2.assembla.com/roatl-utilities/browser/trunk/LogicalProcessorInformation/_Bin/Win32/Release/LogicalProcessorInformation.exe?format=raw">Win32</a>, <a href="http://trac2.assembla.com/roatl-utilities/browser/trunk/LogicalProcessorInformation/_Bin/x64/Release/LogicalProcessorInformation.exe?format=raw">x64</a>] and Visual C++ .NET 2010 source code <a href="http://trac2.assembla.com/roatl-utilities/browser/trunk/LogicalProcessorInformation">are  available from SVN</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1188/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

