Initialization Sequence for Camera Drivers of CE6.0

在MSDN上看到一篇关于CE6.0 camera 驱动初始化过程的文章,对整个初始化过程做了介绍,能帮助我们理解整个驱动框架,本想翻译过来,但自己的英文水平太烂了,就贴出原文吧,原汁原味的更好!

  

The initialization sequence for camera devices is as follows:

  • All camera drivers must be registered under the same GUID. The following code shows the stream interface driver registry entry for a camera driver.
    [HKEY_LOCAL_MACHINE/Drivers/BuiltIn/CameraDriver]
       "Prefix"="<Driver prefix>"
       "Dll"="<Driver DLL name>"
       "Order"=dword:10
       "Index"=dword:1
       "IClass"=multi_sz: "{CB998A05-122C-4166-846A-933E4D7E3C86}"
    
  • The Windows Embedded CE Device Manager loads the camera driver and calls the driver's entry point, CAM_Init. Upon receiving the call, the camera driver detects and initializes the hardware, allocates and initializes its data structures, and returns device instance identifier. This device identifier will be used in subsequent calls to CAM_Open.
  • DirectShow calls CreateFile using the appropriate device name. Applications should use FindFirstDevice to retrieve the actual name based on the appropriate device class GUID. For more information, see Capture Device Selection.
  • DirectShow queries the camera driver for the number of pins it supports using CSPROPERTY_PIN_CTYPES (see CSPROPERTY_PIN). It then queries for the type (preview, capture, or still) of each of these pins using CSPROPERTY_PIN_CATEGORY.
  • DirectShow queries the camera driver for the name of the pin device using CSPROPERTY_PIN_DEVICENAME. This will commonly be PIN1:, but drivers are free to use whatever name they wish.
  • DirectShow calls CreateFile on the pin driver for each pin type the camera driver supports.
  • The driver initializes the stream by setting its properties and data formats and by allocating buffers for it.
  • The client sets the stream type for the given pin handle using IOCTL_STREAM_INSTANTIATE by passing, as input, the identifier of the pin and a handle to the message queue that will be used for transferring asynchronous bundles between the driver and the DirectShow middleware. For example, if CSPROPERTY_PIN_CTYPES returned 3 and if the CSPROPERTY_PIN_CATEGORY for Id = 0 returned PINNAME_VIDEO_PREVIEW, then calling IOCTL_STREAM_INSTANTIATE with PinId = 0 would associate the given handle to preview stream.
  • Begin streaming data through the pins

From the perspective of the camera driver, there are at least two objects to instantiate: one for the adapter and one for the stream. If the camera supports more than one stream then driver must instantiate additional pins. The camera adapter entry points are referred to as CAM_XXX and stream entry points are referred to as PIN_XXX. For a complete list of entry point functions, see Camera Driver Functions

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值