• DSHOW_IVideoWindow的不解


    [时间]    10:46 2010-9-19

    [开发环境]
        WINCE 5.0 + VS2008
    [参考资料]
    PAGE
    http://msdn.microsoft.com/en-us/library/dd377276(VS.85).aspx

    [视频窗口的设置]
        大局思路:
        首先 从DSHOW的STR(SOURCE FILTER, TRANSFORM FITLER, RENDER FITLER)模型,
        然后 从建立STR
        再       从控制STR, FILTER GRAPH MANAGER入手。
        再       从IVideoWindow 接口思考,思考其与RENDER FITLER, FILTER  GRAPH MANAGER  之间的关系。

     

    [DIRECTSHOW所提供的例子的界面]

    3d
        3D播放窗口

    流动

        流动窗口

        看到这些我给很大的震撼与鼓舞。

    [首先]
        首先让我们来看摄像头的预览和保存的FILTER GRAPH
           保存为MP4   

    从摄像头的SOURCE FITLER当中得到图像数据,然后经过TRANSFORM FILTER(具体的Smart tee filter ,encode filter ,decode filter) ,再到RENDER FITLER。


        RENDER FILTER 其与显卡驱动打交道,用户通过RENDER FITLER 所提供的接口来操作,如设置明亮,灰度。


        那么其要输出到某一个窗口当中,其应该与RENDER FITLER 有密切在关系。但用户是通过FILTER GRAPH MANAGER 来进行的操作。FGM( FITLER GRAPH MANAGER) 其是通过IVideoWindow,IMediaControl等操作接口来处理的。在FGM的具体实现当中,其通过组合模式将这三种FILTER组合进来的,


        但好像也不应该是这样的。


        因为STR 其只是一个抽象的东西。在一个真正的FILTER GRAPH 当中,如:transform FITLER 其是由许多FILTER 所组成,如本应用的FILTER GRAPH,其的transform filter 就是由:smart tee filter,decode filter,encode filter, aux filter 所组成的。

    [查找PAGE]

        IVedioWindow其与render filter, FGM之间的关系。

     

    “The Video Renderer filter and the Filter Graph Manager both expose this interface. The Filter Graph Manager forwards all method calls to the Video Renderer"

     

        VIDEO REDNER filter 与Filter Graph Manager均是实现这个接口,其有点使用了装饰者模式,


    因为通过FGM的IVideoWindow的调用,其最终都是调用VIDEO render 。


    ==> 在开发自己的render fitler 的时候,我们应该实现此IVedioWindow接口,这是最本原则,也是标准作法。


    但MS 的DSHOW考虑到程序员,一般很 lazy,所以提供了一些基类,我们只要继承这些基类就可以了且自己也可

    以自定义一些操作接口,如IVedioWindow 的实现基类CBaseVideoWindow

     

    [ 突感]
        之前在硬件产商所提供的RENDER FILTER 的时候,其只提供了操作接口
        IMES_VID_RENDERER : public IUnknown
    为什么其不继承IVideoWindow接口呢,原来其在实现类当中继承了CBaseVideoWindow,这是我空想的原因其没有提供源代码。


      IMES_VID_RENDERER其提供了许多的新的特点。

    " It also forwards certain window messages that the Video Renderer needs to receive, such as

    WM_DISPLAYCHANGE. Because the video window is usually a child of an application window, the filter would not

    otherwise receive these messages. Therefore it relies on the Filter Graph Manager to forward ”

     

        FGM其也需要转发VIDEO Render FITLER 所需要的消息,其具体是怎么样进行的呢,是否是要FGM转换,内部是方法调用的形式。
        视频播放窗口其通常是作为一个应用程序的子窗口(主窗口与子窗口的相关信息),如果不是通过FGM,视频窗口是接受不到这些消息。接受不到这些消息,又怎么样,


    “In most cases, an application should query the Filter Graph Manager for this interface, and not call the filterdirectly, because of the messaging issue just described. However, if the filter graph has more than one Video Renderer, the Filter Graph Manager only communicates with one of them, selected arbitrarily. Therefore, if your application uses multiple video windows, use the IVideoWindow interface directly on the filters. In that case, you must forward window messages to each Video Renderer instance, using the IVideoWindow::NotifyOwnerMessage method” 

    在大多数情况

     

    小数情况

     

    这两种情况之间的相异之处

     

    =>     主要区别在于 视频播放窗口的个数来建议,我们查找FGM,还是VIDEO RENDER WINDOW的

    IVideoWindow接口。其要影响着与应用程序之间通信的方式。(应用程序 ==> FILTER,FILTER => 应用程序)


    [突感]
        前几天,想好好的分析一下WINCE6.0的SDK的,GOOGLE一下,没有查找到分析SDK头文件的文章,

    原来MSDN就是最好的文章。

     

     

    [附]

    [主窗口与子窗口的相关信息]
    PAGE:
    http://msdn.microsoft.com/en-us/library/ms632598%28VS.85%29.aspx
    问题:
        主窗口,子窗口其有什么相同,又有什么不同,WINDOWS其是使用什么策略来管理的呢。如窗口之

    间通信,窗口关系的建立,主窗口关闭其的子窗口也跟着关闭。
        这些问题将在另外的文章当中解决。

  • 相关阅读:
    Oracle EBS R12 (12.1.3) Installation Linux(64 bit)
    LINUX的磁盘管理du命令详解
    Solution for Error FRM-92095: Oracle Jnitiator version too low
    EBS learning history (to know about the environment)
    MD5 Checksums for R12.1.1 Rapid Install Media (文档 ID 802195.1)
    adpatch options=hotpatch
    B树和B+树
    Elasticsearch倒排索引
    mysql主从复制
    Found option without preceding group in config file /etc/mysql/my.cnf
  • 原文地址:https://www.cnblogs.com/pengxinglove/p/1831201.html
Copyright © 2020-2023  润新知