⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 利用 directshow 开发自己的 filter(3) - directshow - 技术应用 - 豆豆网.htm

📁 DIRECTSHOW的学习资料
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0051)http://tech.ddvip.com/2006-04/11443572604083_3.html -->
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>利用 DirectShow 开发自己的 Filter(3) - DirectShow - 技术应用 - 豆豆网</TITLE><!-- 本模板由 legmail 最后于 2007-09-19 13:47 修改 -->
<META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK 
href="利用 DirectShow 开发自己的 Filter(3) - DirectShow - 技术应用 - 豆豆网.files/tech_content.css" 
type=text/css rel=stylesheet>
<STYLE>.nav {
	BACKGROUND: #f2f6fb; WORD-SPACING: 20px; TEXT-INDENT: 5px; LINE-HEIGHT: 28px; BORDER-BOTTOM: #aaa 1px solid; HEIGHT: 28px; TEXT-ALIGN: left
}
</STYLE>

<SCRIPT><!--document.domain = 'ddvip.com';var node = 'tech';var subid = "2006-04-07_4083";--></SCRIPT>

<META content="MSHTML 6.00.2900.3314" name=GENERATOR></HEAD>
<BODY>
<DIV id=main><!-- 页面头部 -->
<DIV class=header>
<DIV class=top_nav><A href="http://www.ddvip.com/">豆豆首页</A> - <A 
href="http://down.ddvip.com/">软件下载</A> - <A 
href="http://code.ddvip.com/">源码下载</A> - <A 
href="http://down.ddvip.com/news">软件资讯</A> - <A 
href="http://book.ddvip.com/">小说阅读</A> - <A 
href="http://club.ddvip.com/">技术论坛</A> - <A 
href="http://man.ddvip.com/">技术手册</A> - <A 
href="http://www.ddvip.com/link">网址导航</A> - <A 
href="http://law.ddvip.com/">法律资讯</A> - <A 
href="http://blog.ddvip.com/">博客人生</A> </DIV>
<DIV class=sitelogo><IMG alt=网站LOGO 
src="利用 DirectShow 开发自己的 Filter(3) - DirectShow - 技术应用 - 豆豆网.files/logo.gif"> 
<DIV class=top_ad_580x60 id=top_ad_580x60></DIV></DIV>
<DIV class=clear></DIV>
<UL class=global_nav>
  <LI><A href="http://tech.ddvip.com/index.html">技术首页</A> </LI>
  <LI><A href="http://tech.ddvip.com/os/index.html">操作系统</A> </LI>
  <LI class=global_nav_c><A 
  href="http://tech.ddvip.com/program/index.html">程序设计</A> </LI>
  <LI><A href="http://tech.ddvip.com/network/index.html">网络技术</A> </LI>
  <LI><A href="http://tech.ddvip.com/network/server/index.html">服务器</A> </LI>
  <LI><A href="http://tech.ddvip.com/safe/index.html">安全技术</A> </LI>
  <LI><A href="http://tech.ddvip.com/web/index.html">Web开发</A> </LI>
  <LI><A href="http://tech.ddvip.com/db/index.html">数据库</A> </LI>
  <LI><A href="http://tech.ddvip.com/pic/index.html">平面设计</A> </LI>
  <LI><A href="http://tech.ddvip.com/mediamovice/index.html">三维动画</A> </LI>
  <LI><A href="http://tech.ddvip.com/cert/index.html">认证考试</A> </LI>
  <LI><A href="http://tech.ddvip.com/soft/index.html">软件应用</A> </LI>
  <LI><A href="http://tech.ddvip.com/machine/index.html">机械电子</A> </LI></UL>
<DIV class=nav><A 
href="http://tech.ddvip.com/program/vc/visualstudio/index.html">VisualStudio</A> 
<A href="http://tech.ddvip.com/program/vc/interface/index.html">界面</A> <A 
href="http://tech.ddvip.com/program/vc/view/index.html">视图</A> <A 
href="http://tech.ddvip.com/program/vc/pic/index.html">图像</A> <A 
href="http://tech.ddvip.com/program/vc/multimedia/index.html">多媒体</A> <A 
href="http://tech.ddvip.com/program/vc/database/index.html">数据库</A> <A 
href="http://tech.ddvip.com/program/vc/windows/index.html">Windows系统</A> <A 
href="http://tech.ddvip.com/program/vc/file/index.html">文件</A> <A 
href="http://tech.ddvip.com/program/vc/comnet/index.html">COM/.NET</A> <A 
href="http://tech.ddvip.com/program/vc/network/index.html">网络通信</A> <A 
href="http://tech.ddvip.com/program/vc/integrated/index.html">综合</A> <A 
href="http://tech.ddvip.com/program/softjeer/index.html">软件工程</A> </DIV></DIV>
<DIV class=tlad id=tech_content_tl></DIV><!-- 内容部分 -->
<DIV class=content>
<DIV class=location><A href="http://www.ddvip.com/" target=_balnk>豆豆网</A> &gt; 
<A href="http://tech.ddvip.com/index.html">技术应用</A> &gt; <A 
href="http://tech.ddvip.com/program/index.html">程序设计</A> &gt; <A 
href="http://tech.ddvip.com/program/vc/index.html">VC</A> &gt; <A 
href="http://tech.ddvip.com/program/vc/multimedia/index.html">VC多媒体编程</A> &gt; 
正文 </DIV>
<DIV class=content_left>
<DIV class=article>
<DIV class=article_title>
<H1>利用 DirectShow 开发自己的 Filter</H1>
<DIV class=title_bottom>
<SCRIPT language=javascript 
src="利用 DirectShow 开发自己的 Filter(3) - DirectShow - 技术应用 - 豆豆网.files/title_bottom.js"></SCRIPT>
</DIV>
<P><A href="http://www.ddvip.com/">豆豆网</A> &nbsp;&nbsp;<A 
href="http://tech.ddvip.com/">技术应用频道</A>&nbsp;&nbsp;&nbsp;2006年07月23日 
&nbsp;&nbsp;&nbsp;<A href="http://club.ddvip.com/">社区交流</A></P></DIV>
<DIV class=article_content>
<DIV class=title_bottom_cpr>
<SCRIPT 
src="利用 DirectShow 开发自己的 Filter(3) - DirectShow - 技术应用 - 豆豆网.files/ad_title_bottom.js"></SCRIPT>
</DIV><!--ID="929"-->
<DIV class=searchhot>关键字: <A href="http://tech.ddvip.com/search.php?key=汉诺塔" 
target=_blank>汉诺塔</A> <A href="http://tech.ddvip.com/search.php?key=VC++编程" 
target=_blank>VC++编程</A> <A href="http://tech.ddvip.com/search.php?key=应用程序" 
target=_blank>应用程序</A> <A href="http://tech.ddvip.com/search.php?key=无闪烁刷屏" 
target=_blank>无闪烁刷屏</A> <A href="http://tech.ddvip.com/search.php?key=DirectX" 
target=_blank>DirectX</A> <A href="http://tech.ddvip.com/search.php?key=图形特技" 
target=_blank>图形特技</A> </DIV>
<DIV class=article_z>
<H2>本文详细介绍利用 DirectShow 开发自己的 Filter </H2></DIV>
<DIV class=article_ad>
<SCRIPT language=javascript 
src="利用 DirectShow 开发自己的 Filter(3) - DirectShow - 技术应用 - 豆豆网.files/ads_250x250.js"></SCRIPT>
</DIV>
<DIV class=article_c id=fontsize>
<P>  到了这里你恐怕要做点工作,还是要设置一下你的项目环境,否则恐怕你编译是通不过的,因为你用到了基类的一些东西,所以你要将你的dshow基类的定义和库文件包含进来。首先包含:</P><CODE>#include 
Streams.h </CODE>
<P>  其次在Project –Setting菜单下配置自己的Filter输出的名字和连接的lib文件</P><IMG 
onclick=get_larger(this) 
src="利用 DirectShow 开发自己的 Filter(3) - DirectShow - 技术应用 - 豆豆网.files/1153633134_ddvip_3351.gif">
<P>  图5</P>
<P>  其中library modules里的包含的动态库如下</P>
<P>  c:\DX90SDK\Samples\C++\DirectShow\BaseClasses\debug\strmbasd.lib 
msvcrtd.lib quartz.lib vfw32.lib winmm.lib kernel32.lib advapi32.lib version.lib 
largeint.lib user32.lib gdi32.lib comctl32.lib ole32.lib olepro32.lib 
oleaut32.lib uuid.lib</P>
<P>  此时你编译一下,好像还是通不过,它提示有一个全局的用于实现COM接口的变量没有定义,不着急,下面我们就开始实现Filter的com接口。</P>
<P>  三、如何实现Filter 的类厂对象</P>
<P>  我们知道一个Filter是一个com组件,所以它com特性的实现其实在其基类中实现的,比如IUnknown接口,我们直接从基类派生出我们的Filter后,它就支持com接口了,它就是一个com组件了。</P>
<P>  所有的com组件为了实现二进制的封装,所以连创建的接口都封装了,因此每个com对象都有个类对象(也叫类厂对象,本身也是com对象,用来创建com组件)来创建com组件。</P>
<P>  下面温习一下com组件的创建过程,其中涉及到几个函数:</P>
<OL>
  <LI>当客户端要创建一个com组件时,它通过底层的COM API函数 
  CoGetClassObject()使用SCM的服务,这个函数请SCM把一个指针绑定到客户端请求的com组件的类对象上,其实在CoGetClassObject()里它装载了该DLL的库,通过该dll的导出函数DllGetClassObject();DllGetClassObject根据客户端提供的com组件CLASSID,返回该com组件类对象的指针。下面com组件的创建和SCM无关了。 

  <LI>客户端利用组件的类对象(类厂对象)的IClassFactory::CreateInstance方法创建com组件。
  <P></P></LI></OL></DIV><!-- 分页 -->
<DIV class=page><A 
href="http://tech.ddvip.com/2006-04/11443572604083_2.html">上一页</A><A 
href="http://tech.ddvip.com/2006-04/11443572604083.html">1</A><A 
href="http://tech.ddvip.com/2006-04/11443572604083_2.html">2</A><SPAN 
class=current>3</SPAN><A 
href="http://tech.ddvip.com/2006-04/11443572604083_4.html">4</A><A 
href="http://tech.ddvip.com/2006-04/11443572604083_5.html">5</A><A 
href="http://tech.ddvip.com/2006-04/11443572604083_6.html">6</A><A 
href="http://tech.ddvip.com/2006-04/11443572604083_7.html">7</A><A 
href="http://tech.ddvip.com/2006-04/11443572604083_8.html">8</A><A 
href="http://tech.ddvip.com/2006-04/11443572604083_9.html">9</A><A 
href="http://tech.ddvip.com/2006-04/11443572604083_4.html">下一页</A></DIV><!-- 分页end -->
<P 
style="PADDING-RIGHT: 4px; FONT-SIZE: 12px; COLOR: #000000; TEXT-ALIGN: right">作者:智慧的鱼 
&nbsp;&nbsp; 责编:豆豆技术应用</P>
<DIV id=art_content_end_468x60>
<SCRIPT 
src="利用 DirectShow 开发自己的 Filter(3) - DirectShow - 技术应用 - 豆豆网.files/ads_468x60.js"></SCRIPT>
</DIV>
<DIV class=realated_search>点击搜索更多"<A 
href="http://tech.ddvip.com/search.php?key=DirectShow" 
target=_blank>DirectShow</A>"相关信息</DIV></DIV>
<DIV class=related>
<DIV class=relatedtop>与“利用 DirectShow 开发自己的 Filter”相关的文章</DIV>
<UL>
  <LI><A 
  href="http://tech.ddvip.com/2007-03/117395236821211.html">VC+DirectShow对视频进行图片处理之二</A> 
  </LI>
  <LI><A 
  href="http://tech.ddvip.com/2007-03/117395231221210.html">VC+DirectShow对视频进行图片处理之三</A> 
  </LI>
  <LI><A 
  href="http://tech.ddvip.com/2007-03/117390782121190.html">VC+DirectShow对视频进行图片处理之四</A> 
  </LI>
  <LI><A 
  href="http://tech.ddvip.com/2007-03/117390773621189.html">VC+DirectShow对视频进行图片处理之五</A> 
  </LI>
  <LI><A 
  href="http://tech.ddvip.com/2007-03/117390736921184.html">VC+DirectShow对视频进行图片处理之六</A> 
  </LI>
  <LI><A 
  href="http://tech.ddvip.com/2006-04/11443595404132.html">基于DirectShow非线性编辑DES</A> 
  </LI>
  <LI><A 
  href="http://tech.ddvip.com/2006-04/11443554004063.html">用DirectShow抓取影片帧</A> 
  </LI>
  <LI><A 
  href="http://tech.ddvip.com/2006-04/11443526404035.html">使用DirectShow驱动摄像头</A> 
  </LI>
  <LI><A 
  href="http://tech.ddvip.com/2006-04/11443525804034.html">在VC中调用DirectShow全屏播放视频</A> 
  </LI></UL></DIV>
<DIV class=clear></DIV>
<DIV class=related>
<DIV class=relatedtop>本栏目更新</DIV>
<UL>
  <LI><A href="http://tech.ddvip.com/2007-09/118923357233810.html">汉诺塔游戏的设计</A> 
  </LI>
  <LI><A 
  href="http://tech.ddvip.com/2007-03/117475629722007.html">也玩视觉效果:VC++编程实现仿真火焰</A> 
  </LI>
  <LI><A 
  href="http://tech.ddvip.com/2007-03/117449675921901.html">将视频演示作为应用程序的启动封面</A> 
  </LI>
  <LI><A 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -