第二十一篇:基于WDM模型的AVStream驱动架构研究
来源:互联网 发布:石家庄淘宝拍照 编辑:程序博客网 时间:2024/06/06 00:52
基于WDM模型的AVStream驱动架构研
这篇论文2006年早就发表, 与当时开发这个驱动正好差不多的时间.
最近实际项目需要, 又回过头来将AVStream中的主要框架列举一下.
整个框架由:
KSDevice
KSFilter
KSPin所构成
KSDevice负责了PNP相关的DISPATCH, 如START, STOP, ADD, REMOVE
KSFilter构成软件AVSTREAM设备的DISPATCH, 这就是所谓的FILTER CENTRIC
而KSPin构成实际硬件AVSTREAM设备的DISPATCH, 这就是所谓的PIN CENTRIC
无论哪一种, 都是在这些FILTER/PIN DISPATCH中处理相应的数据流
而每个FILTER都有对应的属性,事件与方法
这就由AUTOMATION TABLE来构建
AUTOMATION TABLE一级级往下分别是: Property Sets/Set/Item, Method Set/Set/Item, Event Set/Set/Item.
举个以前讲过的例子,USB VIDEO CLASS驱动, 它就是一个典型的AVSTREAM架构的AVSTREAM miniport驱动.
相对一个PCTV ATV AVSTREAM miniport驱动需要实现, TUNER, CROSS BAR, CAPTURE, AUDIO这四个FILTER(相应的AUTOMATION TABLE)及其相应的PIN(CAPTURE PIN, PREVIEW PIN, AUDIO OUT PIN),
USB Video相对来讲, 则更加简单一些, 因为, 往往,它只有一个FILTER(以及FILTER上的PROPERTY), 需要实际实现的则是一个CAPTURE PIN(根据 USB DEVICE DESCRIPTOR中的 IT/OUT TERMINALS的描述符来建立相应的PIN 实例)
例如:
这个WDM STREAMING CAPTURE DEVICE FILTER, 在它的PIN上实现了视频数据流的管理,
以及FILTER PROPERTY中对于
VIDEO的属性如, BRIGHTNESS, CONTRAST, HUE, SATURATION, SHARPNESS, GAMMA, WHITE BALANCE BACKLIGHT COMP
CAMERA的属性控制,如ZOOM, FOCUS, EXPOSURE, PAN, APERURE, PAN, TILT, ROLL, LOW LIGHT COMPENSATION.
而这个USB VIDEO CLASS 驱动的难度, 不仅仅在于KSDEVICE, KSFILTER, KSPIN以及DISPATCH, AUTOMATION TABLE的建立
而是根据USB VIDEO DEVICE的DESCRIPTOR中描述的TOPOLOGY动态地建立一张由KSFILTER/KSPIN构成的KS GRAPH, 同时, 在这些KSFILTER/KSPIN中实现相应的属性,事件,方法及它们的DISPATCH.
同时, 需要完成PIN与PIN之间, DATA RANGE, DATA INTERSECTION的处理.
动态地转化过程, 是USB VIDEO CLASS DRIVER的一个主要与重要的部分, 相对较一电视卡的固定GRAPH结构.
也有人对AVSTREAM架构的复杂产生怀疑, 感觉没有必要采用这种框架去实际设备驱动, 但它的好处就在于, 你所实现的设备驱动, 是完全符合DSHOW COM接口的, 可以与市面上所有符合DSHOW的应用程序去配合工作.
这就是微软为什么要设计这样一个复杂的AVSTREAM架构的根本原因.
USB Video Class Implementation
The Microsoft-provided USB Video Class driver (usbvideo.sys) is a pin-centric AVStream minidriver. It creates a filter factory for each USB Video Class–compliant device instance enumerated by the operating system. The driver also creates a pin factory for each input or output terminal on the device, with the DataFlow member of the KSPIN_DESCRIPTOR structure set to the relevant value.
The USB Video Class driver uses the internal device topology reported by the device descriptors to construct a kernel streaming (KS) topology graph comprised of filters, nodes, and connections.
Based on the number and types of controls supported by the device, USB Video Class dynamically reports filter, pin, and node property sets through the KS automation tables in the AVStream filter and pin descriptors.
Based on the data formats supported by each video or still image data endpoint on the device, USB Video Class reports the corresponding list of KS data ranges supported and a data intersection handler in the respective AVStream pin descriptor. The USB Video Class driver exports the information through the Kernel Streaming Proxy module.
The USB Video Class driver also supports audio/video stream synchronization; usbvideo.sys can serve as a KS master clock and add time stamps to video samples. The USB Video Class specification includes details about how the hardware should provide timing information to the class driver.
To communicate with USB Video Class, user-mode clients call DirectShow or Media Foundation interfaces. These interfaces are COM interface wrappers defined by thekernel streaming proxy as plug-ins. See the Microsoft Windows SDK documentation for more information about Media Foundation.
- 第二十一篇:基于WDM模型的AVStream驱动架构研究
- RMI、Hessian、Burlap、Httpinvoker、WebService的比较
- Hibernate merge、update与saveOrUpdate方法的区别
- Windows环境下Oracle VM VirtualBox安装ubuntu
- Hibernate discriminator-value用法
- HashMap , TreeMap , TreeMap 默认排序方式
- VMware虚拟机RedHat联网实施步骤
- 详解使用wsgen和wsimport开发WebService
- Device-Mapper+Multipath
- Linux-->基础知识-->虚拟机中的Linux安装VMware Tools
- C#中DataGridView控件使用大全
- 重新安装mysql最后出现startService未响应解决方法
- oracle_SQL中ROWID与ROWNUM的使用
- Computer - Administrator登陆后变成Temp用户
- MappedByteBuffer的使用
- gethibernatetemplate的find方法大全
- EXECUTE IMMEDIATE
- ARM IMPORT Image$RO$Limit 的含义
- POCO库 Foundation::SharedLibrary模块分析
- TabHost的两种使用方式
- 搭建Ubuntu14.04编译环境并下载源码(一)
- linux下core文件调试方法
- rman 每日备份
- 第二十一篇:基于WDM模型的AVStream驱动架构研究
- 专访许鹏:谈C程序员修养及大型项目源码阅读与学习
- OpenCV 1.0 Ubuntu安装
- oracle sql应用总结
- 【总结】在VirtualBox上面安装Mac的注意事项
- cocos2d-x v3.2环境配置(目前对3.x版本都可以这样配置)
- HTML学习第三天...
- 如何用Maven创建web项目(具体步骤)
- 使用python创建cocos2d-x项目