Windows Camera Driver Research (i)

Source: Internet
Author: User

Windows Driver Basic Series, reproduced please indicate the source: http://blog.csdn.net/ikerpeng/article/details/38865317


The main purpose of the camera driver is to capture video signals through hardware.


WDM Camera Driver Framework.

Mainly includes two kinds of drive classdriver (provided by Windows, for uniform standards), minidriver (implemented by programmers)


Class Driver:

Interacts with the operating system, including processing synchronization, to raise enough standard interfaces.

Mini Driver:

It is primarily called by class-driven and is responsible for specific hardware-related operations.

Look at their relationship through a graph:


Where SRB is the Stream Request Block.


Initialization

1. Plug and Play device, after inserting call mini driver DriverEntry routines;

2 Mini Driver fills the hw_initialization_data in its own driverentry, then returns Streamclassregisterminidriver;

3. A srb_initialize_device type of SRB is initialized in Class Driver, and the commanddata.configinfo in this SRB records information about the camera hardware;

This SRB is passed on to the small drive, where the small driver gets some hardware information and returns, and tells the class driver that the small drive has been initialized.

4. The class driver then sends a srb:srb_get_stream_info to the small drive, resulting in information such as hw_stream_header data information and hw_stream_information, including the information provided in the camera driver. The size of the video image, the format of the image and other information;

5. Then class-driven to send a hw_stream_information SRB, after this request, the small driver should do all the initialization and return to the driver.


• Each minidriver must provide a routine:


Strminicancelpacket: A callback function to cancel the HW_SRB packet;

Strminireceivedevicepacket: Gets the callback function of the HW_SRB packet;

Strminirequesttimeout: callback function for timeout processing of HW_SRB packets;

Strminievent: Enables a small drive to support an event;

Strminiinterrupt: The callback function that is called when the driver encounters an interrupt;

· MiniDriver routines provided for each individual stream:

Strminireceivestreamdatapacket: callback function for fetching a data stream

Strminireceivestreamcontrolpacket: For callback functions that control data flow

strminievent: enables data flow to support an event

Strminiclock: callback function for the digital stream clock control.


Let's take a look at the driver's workflow:


1. Device plugged in, detected by Plug and Play Device Manager;

2. The PDO is created and the corresponding IRP is generated;

3. The I/O subsystem loads the minidriver and enters into the driverentry;

4. Initialize in DriverEntry: HW_INITIALIZATION_DATA data structure (including hwreceivepacketto control SRB);

5. The class driver constructs the SRB and sets its command to Srb_initialization_device;

6,. This SRB is used as a parameter to invoke Hwreceivepacket;

7, so similar constructs: open close and so on SRB, call Hwreceivepacket.


The end of this section.


Bibliography:

A detailed description of the Windows driver Development technology

Windows Camera Driver Research (i)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.