<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" 
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Bug Captor の 開發日記帳-DirectShow</title>
<link>http://blog.roodo.com/toki_kanno/archives/cat_42395.html</link>
<description>一些開發程式時的碎碎唸，先找個地方記起來免的忘記</description>
<language>zh-tw</language>
<generator>Roodo Blog System</generator>
<copyright>All Rights Reserved</copyright>
<atom:link href="http://blog.roodo.com/toki_kanno/archives/cat_42395.xml" rel="self" type="application/rss+xml" />
<item>
	<title>從C#中取得Filter中的IMediaSample</title>
	<description><![CDATA[
			C++:HRESULT GetIMediaSample(IMediaSample ** pSample){&nbsp;&nbsp;&nbsp; *pSample = [your IMediaSample address]&nbsp;&nbsp;&nbsp; return S_OK;}C#:[PreserveSig]int GetIMediaSample(out IMediaSample pSample)兩邊有一邊宣告錯誤就會拿到NULLC# 中使用範例:IMediaSample sample = null;if (GetIMediaSample(out sample)==0){&nbsp;&nbsp;&nbsp; // do something with the sample you got}
		]]>
	</description>
	<content:encoded><![CDATA[
			C++:<br />HRESULT GetIMediaSample(IMediaSample <font color="#ff0000"><strong>**</strong></font> pSample)<br />{<br />&nbsp;&nbsp;&nbsp; *pSample = [your IMediaSample address]<br />&nbsp;&nbsp;&nbsp; return S_OK;<br />}<br /><br />C#:<br />[PreserveSig]<br />int GetIMediaSample(<font color="#0000ff"><strong>out</strong></font> IMediaSample pSample)<br /><br />兩邊有一邊宣告錯誤就會拿到NULL<br /><br />C# 中使用範例:<br /><br />IMediaSample sample = null;<br />if (GetIMediaSample(out sample)==0)<br />{<br />&nbsp;&nbsp;&nbsp; // do something with the sample you got<br />}
		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/toki_kanno/archives/5904993.html</link>
	<guid>http://blog.roodo.com/toki_kanno/archives/5904993.html</guid>
	<category>DirectShow</category>
	<pubDate>Wed, 23 Apr 2008 12:07:44 +0800</pubDate>
</item>
<item>
	<title>Direct Show SDK安裝</title>
	<description><![CDATA[
			最近重灌工作機器，DirectShow SDK要重灌由於實在不想灌多灌一個Platform SDK，選擇使用 DirectX SDK 9.0b裡面附的由於使用VS2005，所以必需做一些修正。這邊順手把修正記錄一下關於c:\program files\microsoft visual studio 8\vc\platformsdk\include\winnt.h(222) : error C2146: syntax error : missing ';' before identifier 'PVOID64' 錯誤訊息:在 winnt.h 中加入 #define POINTER_64 __ptr64  c:\program files\microsoft visual studio 8\vc\platformsdk\include\winnt.h(222) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int在project setting-&gt;C++項目下的command line裡加上 /wd4430 忽略之修正Count及iDone兩個變數找不到的問題(重新宣告即可)以上修正完應可順利使用 VS2005 來編譯 BaseClasses補充，DXSDK9裡附的filter的sample在編譯時需在 library 中增加 strmiids.lib 方可順利編譯
		]]>
	</description>
	<content:encoded><![CDATA[
			最近重灌工作機器，DirectShow SDK要重灌<br />由於實在不想灌多灌一個Platform SDK，選擇使用 DirectX SDK 9.0b裡面附的<br /><br />由於使用VS2005，所以必需做一些修正。這邊順手把修正記錄一下<br /><br /><ul><li>關於c:\program files\microsoft visual studio 8\vc\platformsdk\include\winnt.h(222) : error C2146: syntax error : missing ';' before identifier 'PVOID64' 錯誤訊息:</li></ul><blockquote>在 winnt.h 中加入 <strong>#define POINTER_64 __ptr64 </strong> <br /></blockquote><ul><li>c:\program files\microsoft visual studio 8\vc\platformsdk\include\winnt.h(222) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int</li></ul><blockquote>在project setting-&gt;C++項目下的command line裡加上 <strong>/wd4430</strong> 忽略之<br /></blockquote><ul><li>修正Count及iDone兩個變數找不到的問題(重新宣告即可)</li></ul>以上修正完應可順利使用 VS2005 來編譯 BaseClasses<br /><br />補充，DXSDK9裡附的filter的sample在編譯時需在 library 中增加 strmiids.lib 方可順利編譯
		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/toki_kanno/archives/5767465.html</link>
	<guid>http://blog.roodo.com/toki_kanno/archives/5767465.html</guid>
	<category>DirectShow</category>
	<pubDate>Fri, 28 Mar 2008 09:52:43 +0800</pubDate>
</item>
<item>
	<title>Remove reference clock from Graph for full speed transcoding &amp; preview</title>
	<description><![CDATA[
			一般DirectShow Graph在運行的時候，會選定一個reference clock做為撥放的基準(一般會在render上)。但是同時要轉檔(transcoding)以及預覽(preview)轉換後的結果時，會變成transcoding的速度會被render限制住，這時候就需要把reference clock取消，讓transcoding全速執行。// C#IMediaFilter  mf = (IMediaFilter)gb;// use IMediaFilter::SetSyncSource // to remove reference clockmf.SetSyncSource(null);
		]]>
	</description>
	<content:encoded><![CDATA[
			<p>一般DirectShow Graph在運行的時候，會選定一個reference clock做為撥放的基準(一般會在render上)。但是同時要轉檔(transcoding)以及預覽(preview)轉換後的結果時，會變成transcoding的速度會被render限制住，這時候就需要把reference clock取消，讓transcoding全速執行。</p><p><table style="WIDTH: 100%" cellspacing="1" cellpadding="1" align="left" border="1"><tbody><tr><td><p><font size="2"><em><font color="#339900">// C#</font></em><br /><strong>IMediaFilter</strong>  mf = (<strong>IMediaFilter</strong>)gb;</font></p><p><font size="2"><font color="#339900"><em>// use IMediaFilter::SetSyncSource <br />// to remove reference clock</em><br /></font>mf<strong>.</strong>SetSyncSource(<strong>null</strong>);</font></p></td></tr></tbody></table></p>
		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/toki_kanno/archives/2353262.html</link>
	<guid>http://blog.roodo.com/toki_kanno/archives/2353262.html</guid>
	<category>DirectShow</category>
	<pubDate>Mon, 23 Oct 2006 16:50:31 +0800</pubDate>
</item>
<item>
	<title>Debug directshow filter 的方法</title>
	<description><![CDATA[
			In Visual Studio[F5] (Start Debug)Choose excutable: graphedit.exeGenerate your filter in graphedit, and do something.Debug ....:P
		]]>
	</description>
	<content:encoded><![CDATA[
			<p>In Visual Studio</p><ul><li>[F5] (Start Debug)</li><li>Choose excutable: graphedit.exe</li><li>Generate your filter in graphedit, and do something.</li><li>Debug ....:P</li></ul>
		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/toki_kanno/archives/290480.html</link>
	<guid>http://blog.roodo.com/toki_kanno/archives/290480.html</guid>
	<category>DirectShow</category>
	<pubDate>Thu, 21 Jul 2005 09:25:08 +0800</pubDate>
</item>
<item>
	<title>Filter 收不到 sample 的問題解決了</title>
	<description><![CDATA[
			
今天請了 leader 來幫忙看，算是解決了不是我的 filter 有問題，是Windows內建的某 filter 有問題 ORZ接上那個問題 filter ，接在它後面的 filter 完全收不到訊號不過後來發現那邊比較像是接錯了，手動換成正確的 filter 就沒問題了

		]]>
	</description>
	<content:encoded><![CDATA[
			<br />
今天請了 leader 來幫忙看，算是解決了<br />不是我的 filter 有問題，是Windows內建的某 filter 有問題 ORZ<br />接上那個問題 filter ，接在它後面的 filter 完全收不到訊號<br /><br />不過後來發現那邊比較像是接錯了，手動換成正確的 filter 就沒問題了<br /><br />

		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/toki_kanno/archives/284436.html</link>
	<guid>http://blog.roodo.com/toki_kanno/archives/284436.html</guid>
	<category>DirectShow</category>
	<pubDate>Tue, 19 Jul 2005 14:15:19 +0800</pubDate>
</item>
<item>
	<title>IPin::ConnectionMediaType</title>
	<description><![CDATA[
			If the pin is connected, this method copies the media type into the AM_MEDIA_TYPE structure specified by pmt. The caller must free the media type's format block. You can use the MicrosoftR Win32R CoTaskMemFree function, or the FreeMediaType helper function.If the pin is not connected, this method clears the media type specified by pmt and returns an error code.
		]]>
	</description>
	<content:encoded><![CDATA[
			<p>If the pin is connected, this method copies the media type into the AM_MEDIA_TYPE structure specified by pmt. The caller must free the media type's format block. You can use the MicrosoftR Win32R CoTaskMemFree function, or the FreeMediaType helper function.</p><p>If the pin is not connected, this method clears the media type specified by pmt and returns an error code.</p>
		
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/toki_kanno/archives/267582.html</link>
	<guid>http://blog.roodo.com/toki_kanno/archives/267582.html</guid>
	<category>DirectShow</category>
	<pubDate>Thu, 14 Jul 2005 09:48:50 +0800</pubDate>
</item>
<item>
	<title>DirectShow filter 寫作</title>
	<description><![CDATA[
			DirectShow filter is a win32 DLL.Use regsvr32.exe to register filter, then u can find it in GraphEdit.For building a DirectShow filterFirst, build base classes of DirectShow in the &quot;DXSDK/Sample/DirectShow/BaseClasses&quot;.Include &lt;streams.h&gt; in BaseClasses dir.Use __stdcall in &quot;calling convention&quot; of VC++ project setting.Use multithread rulltime library.Add a xxx.def file into your project dir. The fomat should like below:LIBRARY xxx.axEXPORTS     DllMain             PRIVATE    DllGetClassObject   PRIVATE    DllCanUnloadNow     PRIVATE    DllRegisterServer   PRIVATE    DllUnregisterServer PRIVATELink these libraries to project.Debug: Strmbasd.lib, Msvcrtd.lib, Winmm.lib Release: Strmbas.lib, Msvcrtd.lib, Winmm.lib Choose &quot;ignore default library&quot; in linker options of project setting.Declear a DLL Entry as followextern &quot;C&quot; BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved){    return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);}
		]]>
	</description>
	<content:encoded><![CDATA[
			<ul><li>DirectShow filter is a win32 <span style="font-weight: bold; color: rgb(255, 0, 0);">DLL</span>.</li><li>Use <span style="font-weight: bold; color: rgb(255, 0, 0);">regsvr32.exe</span> to register filter, then u can find it in GraphEdit.</li><li>For building a DirectShow filter</li></ul><ol><ol><li>First, build base classes of DirectShow in the &quot;DXSDK/Sample/DirectShow/BaseClasses&quot;.</li><li>Include &lt;<span style="color: rgb(255, 0, 0);"><strong>streams.h</strong></span>&gt; in BaseClasses dir.</li><li>Use <span style="font-weight: bold; color: rgb(255, 0, 0);">__stdcall</span> in &quot;calling convention&quot; of VC++ project setting.</li><li>Use <span style="font-weight: bold; color: rgb(255, 0, 0);">multithread</span> rulltime library.</li><li>Add a xxx<font color="#ff0000"><strong>.def</strong></font> file into your project dir. The fomat should like below:<table cellspacing="0" cellpadding="0" border="1" style="width: 100%;"><tbody><tr><td><!--StartFragment --><code><font color="#0000ff">LIBRARY xxx.ax<br />EXPORTS <br />    DllMain             PRIVATE<br />    DllGetClassObject   PRIVATE<br />    DllCanUnloadNow     PRIVATE<br />    DllRegisterServer   PRIVATE<br />    DllUnregisterServer PRIVATE</font></code></td></tr></tbody></table></li><li>Link these libraries to project.<br /><table cellspacing="0" cellpadding="0" border="1" style="width: 100%;"><tbody><tr><td><p>Debug:</p><blockquote dir="ltr" style="margin-right: 0px;"><p><!--StartFragment --> Strmbas<strong><font color="#ff0000">d</font></strong>.lib, Msvcrt<strong><font color="#ff0000">d</font></strong>.lib, Winmm.lib </p></blockquote><p dir="ltr">Release:</p><blockquote dir="ltr" style="margin-right: 0px;"><p dir="ltr"><!--StartFragment --> Strmbas.lib, Msvcrtd.lib, Winmm.lib </p></blockquote></td></tr></tbody></table></li><li>Choose &quot;<strong><font color="#ff0000">ignore default library</font></strong>&quot; in linker options of project setting.</li><li>Declear a <strong><font color="#ff0000">DLL Entry</font></strong> as follow<table cellspacing="0" cellpadding="0" border="1" style="width: 100%;"><tbody><tr><td><!--StartFragment --><code>extern &quot;C&quot; BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);<br />BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)<br />{<br />    return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);<br />}</code></td></tr></tbody></table></li></ol></ol>
		<a class="acontinues" href="http://blog.roodo.com/toki_kanno/archives/250808.html">(繼續閱讀...)</a>
		]]>
	</content:encoded>
	<link>http://blog.roodo.com/toki_kanno/archives/250808.html</link>
	<guid>http://blog.roodo.com/toki_kanno/archives/250808.html</guid>
	<category>DirectShow</category>
	<pubDate>Fri, 08 Jul 2005 09:16:49 +0800</pubDate>
</item>
</channel>
</rss>